开发者

How would you automatically restart a javascript application when it crashes?

开发者 https://www.devze.com 2023-02-09 03:11 出处:网络
I am interested 开发者_Go百科in running a slideshow in an unattended web browser. I would rather it didn\'t crash. How should I make sure the javascript application continues to run or the browser rel

I am interested 开发者_Go百科in running a slideshow in an unattended web browser. I would rather it didn't crash. How should I make sure the javascript application continues to run or the browser reloads the home page when it crashes?


Prepare a frameset with one hidden frame, and your actual content frame as the other. Have a setTimeout running continuously in the hidden frame, which gets reset by the "content" frame from time to time. Lets say that the setTimeout in the hidden frame is 20 seconds, have the content frame reset that timeout (clearTimeout) every 10 seconds or so. If no reset is received (content frame has crashed), force reload the content frame from the hidden frame.

0

精彩评论

暂无评论...
验证码 换一张
取 消