Support Request: js setup

Description

I have just starting working with SiteKiosk. For the most part, it is going well. However, I cannot seem to get a .js file to run. I believe, I am missing something during configuration. I am now trying a single line script to see if I can get it to fire.

From the documentation and support tickets, it appears that I should:
a) create a .js file (test.js) and save it as ...SiteKiosk\Html\test.js
b) appears to be unnecessary, but I have also added that script to Start Page & Browser -> Internet Explorer -> Advanced -> Execute Script (...SiteKiosk\Html\test.js)
c) I then Start Once SiteKiosk, but the script does not appear to fire.

The script contains 1 line: alert("test");

Answer: (4)

Re: js setup 2/11/2020 4:02 PM
Hello,

Thank you for your inquiry. Based on your project, you will be using the SiteKiosk Object Model. The "alert" method creates a window, but windows are not directly available in the external script for security reasons. This will be different if called in the browser as part of your webpage. See the example code line below, it will get a log entry in the SiteKiosk log if used in the external script:

SiteKiosk.Logfile.Notification('This is a notification.');

If you want to create a window, you should have a look at the CreateHTMLDialog Method page (SIteKiosk Object Model):
https://www.provisio.com/helpconsole/SiteKiosk%20Object%20Model%20Help/en-US/default.htm?sitekioskui_createhtmldialog_mth.htm .

A few things to note:
- In the external script you must use the example without HTML <SCRIPT> tag AND without the "window.external.InitScriptInterface();" command. The mentioned command is for web pages to initialize the SiteKiosk Object Model (your website will need permission to use the Object Model in SiteKiosk Configuration>>Access/Security>>URLs with SiteKiosk Object Model permission). Also you should add a delay to make sure SiteKiosk is loaded before.

Here is an example without further free support:
evtid = SiteKiosk.Scheduler.AddDelayedEvent(5000, myfunction); function myfunction(eventID) { mydialog = SiteKiosk.SiteKioskUI.CreateHTMLDialog();
mydialog.URL = "https://www.provisio.com"; mydialog.ShowDialog(); }

Please understand that our free support cannot offer any assistance with creating your own code or customizing the skin files (apart from the detailed SiteKiosk and SiteKiosk Object Model documentation). http://www.provisio.com/helpconsole/SiteKiosk%20Help/en-US/default.htm?support.htm

Documentation:
- General Information about customizing SiteKiosk: http://www.provisio.com/web/us/features/siteskin
- SiteKiosk help: http://www.provisio.com/helpconsole/SiteKiosk%20Help/en-US/default.htm?customization_%28site_skin%29.htm
- SiteKiosk Object model help for IE based skins: http://www.provisio.com/helpconsole/SiteKiosk%20Object%20Model%20Help/en-US/default.htm?index.htm
- The SiteKiosk Object model help for Chrome Browser Skin can be requested via e-mail at support-america(at)provisio.com

Further hints and suggestions can be found in our Developer Blog at http://devblog.provisio.com/

In case you are interested in a solution against payment, please submit a detailed description stating the exact requirements/behavior of the customization request to support-america(at)provisio.com. After the developers look at the request, we will contact you in regard to time frame and pricing for the cost of the customization.

Best Regards,
Andre.
Re: js setup 2/11/2020 5:25 PM
Thank you for the help. I used your example and I see the notification message in the log. So the script is firing, but it only seems to fire upon SiteKiosk startup. I thought the script was supposed to fire for each web page displayed. For instance, my starting page is page1 and it has link for page2. When I click on the link in page1, page2 comes up, but the script does not fire when page2 is displayed.

How do I configure SiteKiosk to fire a script for either all pages or for a specific page? I intend on writing code that will perform a specific action (fill in some input fields) for certain pages. I don't think I need help with the code, just the mechanics on how to get the script to fire for either all or specific pages.

I have looked in the documentation and I am either not finding this information or not understanding it. If you could either explain the proper configuration steps or point me to the specific area in the documentation, it would be much appreciated. Again, not looking for programming help, just configuration settings.
Re: js setup 2/11/2020 7:03 PM
Never mind. I think I understand now. The initialization during startup is used to bind processing to specific events in subsequent webpages.
Re: js setup 2/11/2020 8:19 PM
Hello,

Thank you for asking. See example of this External Application Watchdog Script: https://devblog.provisio.com/post/2017/12/18/How-to-Build-an-Extended-Script-Watchdog-for-External-Applications.aspx that watches for window events and acts accordingly. You could use the same concept and watch for events that happens in the browser, i.e. navigating to another page. Please see these two topics.

WindowList Object: https://www.provisio.com/helpconsole/SiteKiosk%20Object%20Model%20Help/en-US/default.htm?sitekioskwebbrowser_obj.htm

SiteKioskWebBrowser Object: https://www.provisio.com/helpconsole/SiteKiosk%20Object%20Model%20Help/en-US/default.htm?sitekioskwebbrowser_obj.htm

For Chrome Object Model, you will need to specifically request it.

Best Regards,
Andre.
My Account
Login
Language (Tickets):