Igalia / cog

WPE launcher and webapp container
MIT License
235 stars 61 forks source link

(wpe-webkit-mir-kiosk) - Launch homepage on idle #710

Open cails07 opened 4 months ago

cails07 commented 4 months ago

Hi all,

I'm using ubuntu-frame with wpe-webkit-mir-kiosk as a web kiosk. There is one specific page on the website which I'm displaying (the sign-in page) where there are no links back to the homepage until after you sign-in. If a guest enters this page and walks away, I have no way for the next guest to use the kiosk unless I manually restart the session.

Is there an ability to force a relaunch of the homepage if any page sits idle for a specific period of time?

Thanks in advance

vrazzer commented 4 months ago

I have not seen any such functionality within cog. Any reason you are not using javascript? A super crude return-to-home after 60 seconds on a page :

if (history.length > 1) setTimeout(() => history.go(1-history.length), 60*1000);

cails07 commented 3 months ago

Thanks vrazzer, Unfortunately I don't control the website of the page being displayed so I'm unable to deploy javascript to achieve this result.

vrazzer commented 3 months ago

Understood. For COG, I dealt with this situation by adding a signal handler for "load-changed" and then calling webkit_web_view_run_javascript() on the view. That allows injecting arbitrary javascript into pages you cannot change. Might be a consideration if you are building mir-kiosk from source. Good luck.