Support Request: Script doesn't start at SiteKiosk start

Description

I created a script to check at the activation of the screen saver if the user interacts within 10 seconds. If yes, nothing happens, otherwise the user is logged out and a redirect to Google should happen. I configured the script to run at SiteKiosk startup, unfortunately that doesn't seem to happen.

Here is the script (logout.js):

<SCRIPT TYPE="text/javascript">
window.external.InitScriptInterface();
SiteKiosk.ScreenSaver.OnScreenSaverBegin = OnScreenSaverBegin;
function OnScreenSaverBegin()
{
evtid = SiteKiosk.Scheduler.AddDelayedEvent(10000, logoutIfInactive);
}
function logoutIfInactive(eventID)
{
if(SiteKiosk.ScreenSaver.Active == true){
SiteKiosk.Logout();
window.location = "http://www.google.com";
}
</SCRIPT>

The path of the script (E:\) was allowed to run JavaScripts and also the Access to E:\ is allowed in the file manager.

Could you please tell me, what is wrong? I'm pretty shure, that the script doesn't starts at SiteKiosk startup. I also replaced the logout.js with a script that just opens an alert-box, which also dindn't work. I also removed the script-tags in the js file and that doesn't helps too.

Thank you very much for support!

Answer: (3)

Re: Script doesn't start at SiteKiosk start 4/27/2015 2:12 PM
Hello,

First you should remove the script tags (<SCRIPT TYPE="text/javascript"> and </SCRIPT>) and the command "window.external.InitScriptInterface();".
They only must be used when the SiteKiosk Object Model code is used in a web page but not within an external script.
As general advice you should store the script into the "Html" subfolder in the SiteKiosk program folder.

Furthermore please note that also the alert box and the command “window.location” only work with a script in a web page but not in an external script (where no window exists).

To let SiteKiosk navigate to a certain URL when using an external script you need to use the navigate method of the SiteKiosk Object Model:
http://www.provisio.com/helpconsole/SiteKiosk%20Object%20Model%20Help/en-US/default.htm?sitekioskwebbrowser_navigate_mth.htm

Note that the SiteKioskWindow object can only be used from within a browser skin file.
To use the SiteKioskWindow object in other files it can be referenced through the main object SiteKiosk. E.g.:

SiteKiosk.WindowList.MainWindow.SiteKioskWindow.SiteKioskWebBrowser.Navigate("http://www.google.com", false);



Alternatively you may check activating the screen saver warning that displays a dialog before the screen saver activates and configure Google as start page in SiteKiosk.
With the old 7.x version you should find that setting at “-->Themes/Design-->Customize-->Screensaver”

With current versions 8.x you even can configure to display the start page when the screen saver activates (-->Screensaver):
http://www.provisio.com/helpconsole/SiteKiosk%20Help/en-US/default.htm?screen_saver___2nd_monitor.htm



Please understand that our free support cannot offer you any assistance with creating your own code or customizing the skin files (apart from the detailed SiteKiosk and SiteKiosk Object Model documentation).
- General Information about customizing SiteKiosk: http://www.sitekiosk.com/en-US/SiteKiosk/SiteSkin.aspx
- SiteKiosk help: http://www.provisio.com/helpconsole/SiteKiosk%20Help/en-US/default.htm?customization_%28site_skin%29.htm
- SiteKiosk Object model help: http://www.provisio.com/helpconsole/SiteKiosk%20Object%20Model%20Help/en-US/default.htm?index.htm
If you need further assistance in creating individual coding solutions you can contact us via e-mail that we may find a solution against payment for your needs.
(Or maybe one of the forum visitors who have already worked on this kind of code can give you some help.)

In case you are interested in a solution against payment please write a detailed description to support-europe(at)provisio.com that we can check the technical feasibility and the amount of work to make a quotation.
The adjustment fees are depending on the complexity of the changes and in general it costs 120 Euro per hour.

Regards,
Michael Olbrich
Re: Script doesn't start at SiteKiosk start 4/27/2015 5:17 PM
Hello

First, thank you very much for the help! With your Information I could modify the script, so that it works now.

Now I have the problem, that the screen saver closes the open websites. I disabled the return homepage option (<return-homepage>false</return-homepage>) and also disabled clear cache and delete cookies (<clear-cache>false</clear-cache> and <delete-cookies>false</delete-cookies>). But if the screen saver becomes active and then I move the mouse immediately to go back to the website, the page content is white/blank, even if the URL is still as before (what is correct).

How can I disable the "close behaviour" of the screen saver?

Many thanks for your help.
Re: Script doesn't start at SiteKiosk start 4/28/2015 11:54 AM
Hello,

It is not officially supported but for the white screen after screen saver activation/deactivation you may set the following entry to false

<reset-browser-on-screensaver-start>false</reset-browser-on-screensaver-start>


That SiteKiosk does close all additional windows is a dedicated behavior and cannot be changed.

Alternatively you may check deactivating the screen saver (see: http://www.provisio.com/helpconsole/SiteKiosk%20Help/en-US/default.htm?screen_saver___2nd_monitor.htm)
and initiate the script functions after a certain idle time.

The Idle time can also be checked via Object Model script:
http://www.provisio.com/helpconsole/SiteKiosk%20Object%20Model%20Help/en-US/default.htm?screensaver_idletime_prop.htm

Regards,
Michael Olbrich
My Account
Login
Language (Tickets):