Raspberry Pi auto-reload webpage solution - midori

I have my raspberry pi set up, I intend to use it as a "kiosk". The pi will not need interaction, It will just display a webpage.
Until now I have been using meta tags to refresh the page evey three minutes, however, if there is a problem with the internet and the page cannot connect it will not attempt to connect again as it cannot load the page.
Is there any way to display the webpage (using midori) and automatically refresh the page through the browser every three minutes? This way if there is a internet problem it will simply not display the page for three minutes.
Thanks!

midori -a http://sitename **-i 120** -e Fullscreen
will refresh inactive page every 120 sec.

Related

PWA version of site slow and sometimes reloads on each activation

This is an intermittent behavior with the progressive web app version of my site.
I made a website with React. Then I visited it with my iPhone 5 and saved it to my Home screen with Safari's "Add to Home Screen" feature. The behavior is different between (1) visiting the site using the home screen shortcut and (2) opening Safari and going to the page that way.
Doing (1) has the problem. If I do that and then go to the Home screen and touch the shortcut and go back to the website, the page turns all white for about 1-5 seconds, the internet connecting indicator spins and the page appears. Sometimes the page returns to the state I left it and sometimes it reloads entirely. Doing (2), the page doesn't reload at all and doesn't try to access the internet. Same with accessing the site using Chrome.
It seems to completely reload more often if more time has passed since I .
According to Chrome developer tools, a Service Worker is activated and Lighthouse gives the site a perfect PWA score.
I have questions... Why is the behavior different when accessing the page these two ways? Why is it trying to access the internet or doing anything at all every time I switch from the Home screen or another app to this app? Why is it totally reloading the page sometimes? How do I make it not do this? I want it to work offline and I want it to not attempt connect to the internet unnecessarily.

Freezing one page from time to time

I've got case when user wants to login and from time to time, the login page freezes (page is loading all the time) and nothing happens. The problem disappears when user open the app in “Incognito” mode in Chrome. I observed the same situation happening sometimes in Incognito mode too however, when performing some internally tests. The only way to solve this situation when it happens is to clear all caches and delete all web browsing history. I've got this response from the server https://monosnap.com/file/jmEkKWaGelHYzTODq385choJ8pke3J
I thought it the problem could be in some docker images (some container/image overrider) but I've only one container so this is not the case.
Is it possible to set automatic data cleansing in Rails app that the user does not do this? I'm using Rails and Grape in this app.

Cache entire website in chrome app

I am making a chrome app. It is for a kiosk type application. At times the computer will be offline when it starts up. So I'm looking to make an application that a user can navigate to a website and then the entire website is cached. Then when they turn on the Chromebox/Chromebook the website will come up as it was. Including JS/CSS/dynamically loaded content.
Overall I'm looking to save the state of the entire webview and have it keep going after the machine reboots. I looked into saving the JS/CSS/HTML but then the dynamically loaded content (ajax calls) is not available. Is there a higher level function for saving the ENTIRE state of the webview in a google chrome app?
Zebradog's Kiosk Chrome App recently added "Serve local content" support. It works by using Web Server for Chrome in the background. It loads the content in a webview. You may not want a whole kiosk app, but this could at least be a starting point for you to use as reference.
One way of actually getting all the files, if you don't have them already, would be to use wget -r -k

is it possible to get notification from browser when page is loaded completely?

if I want to design an iPhone app to do this monitoring, is it possible? such as open the app and input web address, the app can call safari's function to request and render the webpage, so that i can monitor the page load event in the app. How can I achieve that?
or
create an app that monitors the time taken to load a web page by any browser on iPhone. let suppose i have button in my app on clicking the button my app will start monitoring the other apps, now if i start safari(or any browser) and try to open web page, than the time taken to load web page must be calculated by my app. is it possible to do??

Check for active users in rails if the users stays in one page and dont click through the app

I am trying to build an rails app and trying to see what users are online. I know how to implement the method to show online users if the user clicks through my app, but lets assume that my app is only 1 page, so there are no links to be clicked. How would I track the users online without the user having to click anywhere? Also i if the user has been idle for 15 min i will need to update the status to idle instead of online and if the user closes the browser or navigates to another page the status goes to offline.
Any help would be appreciated. Thanks
Presumably they interact in some way with the page (ajax perhaps?) so you'll need to detect those interactions and use them to determine if the user is idle or not. You could use javascript's onbeforeunload to determine when they have left the page.
I'd suggest to make AJAX pings to your server side like:
$.get( '/user_activity/ping' );
You can do it automatically using JS Timers or explicitly when the user interacts with the page some how.

Resources