File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,7 @@ The following environment variables allow configuration of the `browser` block:
9292|`WINDOW_POSITION`|`x,y`|`0,0`|Specifies the browser window position on the screen|
9393|`API_PORT`|port number|5011|Specifies the port number the API runs on|
9494|`REMOTE_DEBUG_PORT`|port number|35173|Specifies the port number the chrome remote debugger runs on|
95+ |`AUTO_REFRESH`|interval|0 (disabled)|Specifies the number of seconds before the page automatically refreshes|
9596
9697---
9798
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ const REMOTE_DEBUG_PORT = process.env.REMOTE_DEBUG_PORT || 35173;
2222const FLAGS = process . env . FLAGS || null ;
2323const EXTRA_FLAGS = process . env . EXTRA_FLAGS || null ;
2424const HTTPS_REGEX = / ^ h t t p s ? : \/ \/ / i //regex for HTTP/S prefix
25+ const AUTO_REFRESH = process . env . AUTO_REFRESH || 0 ;
2526
2627// Environment variables which can be overriden from the API
2728let kioskMode = process . env . KIOSK || '0' ;
@@ -182,6 +183,7 @@ async function SetDefaultFlags() {
182183}
183184
184185async function setTimer ( interval ) {
186+ console . log ( "Auto refresh interval: " , interval ) ;
185187 timer = setIntervalAsync (
186188 async ( ) => {
187189 try {
@@ -204,6 +206,10 @@ async function main(){
204206 await SetDefaultFlags ( ) ;
205207 let url = await getUrlToDisplayAsync ( ) ;
206208 await launchChromium ( url ) ;
209+ if ( AUTO_REFRESH > 0 )
210+ {
211+ await setTimer ( AUTO_REFRESH * 1000 ) ;
212+ }
207213}
208214
209215
You can’t perform that action at this time.
0 commit comments