How to Trigger a Customizable Navigation Command in SiteKiosk Windows Chrome Browser from Another Application

We will create a little C# example to show how to trigger a navigation in the Chrome Browser of SiteKiosk Windows from an external application.

It makes use of the SendCustomCommand method from the ISiteKiosk9 object, that is part of the SiteKioskRuntime type library (..\SiteKiosk\Typelib\SiteKioskRuntime.tlb). Add the library to your C# project and access the ISiteKiosk9 object similar to what you find in this description (

The main part of the code for a small application with a button to call looks like this:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using SiteKioskRuntimeLib;

namespace NavigateInSKWchrome
    public partial class Form1 : Form
        [DllImport("ole32.dll", CallingConvention = CallingConvention.StdCall)]
        public static extern int CoGetClassObject(ref Guid rclsid, uint dwClsContext, IntPtr pServerInfo, ref Guid riid, out IntPtr ppv);

        public Form1()

        private void button1_Click(object sender, EventArgs e)
            // initialize GUID's for classes and interfaces
            Guid lr_FactoryGuid = typeof(ISiteKioskFactory).GUID;
            Guid lr_FactoryClass = Guid.Parse("1CA0D073-4ABB-4D06-B318-BFFDE38E4903");
            Guid lr_SiteKioskGuid = typeof(ISiteKiosk9).GUID;

            ISiteKiosk9 mk_pSiteKiosk;

            // try to get the ISiteKioskFactory interface of the instance
            // of SiteKioskFactoryClass
            IntPtr lk_FactoryPtr = new IntPtr();
            CoGetClassObject(ref lr_FactoryClass, 4, new IntPtr(), ref lr_FactoryGuid, out lk_FactoryPtr);
            // convert the received IntPtr to the requested ISiteKioskFactory
            // interface
            ISiteKioskFactory lk_Factory = (ISiteKioskFactory)Marshal.GetObjectForIUnknown(lk_FactoryPtr);

            // call CreateSiteKiosk to get the ISiteKiosk interface of the
            // current instance of SiteKiosk
            IntPtr lk_SiteKioskPtr = new IntPtr();
            lk_Factory.CreateSiteKiosk(ref lr_SiteKioskGuid, out lk_SiteKioskPtr);

            // convert the received IntPtr to the requested
            // ISiteKioskFactory interface
            mk_pSiteKiosk = (ISiteKiosk9)Marshal.GetObjectForIUnknown(lk_SiteKioskPtr);

            mk_pSiteKiosk.SendCustomCommand("openBrowser", "");

When building the project, make sure to build it as an x86 project, so that it can communicate with SiteKiosk. Also make sure that you run the application within the same user context as SiteKiosk, otherwise the application will not be able to access SiteKiosk.

SendCustomCommand can also be used from an external script by simply calling this line in an external Javascript file:

SiteKiosk.SendCustomCommand("openBrowser", "");

Note that the SendCustomCommand method is handled in the file ..\SiteKioskNG\assets\rootApp\modules\browser.js. By default the onCustomCommand method, that is fired when a custom command is received, only includes the openBrowser command. It uses the navigateinMainBrowser method to open the requested page in a new tab, when the first parameter is false, or in the acitve tab, when the parameter is true. Feel free to add your own code to the browser.js file to enable your own custom commands to be used with the Chrome Browser of SiteKiosk Windows.