Continue to reload the page until the installed text appears (javascript - for greasekit)

I want to save the reload page until May 23rd, 2013 appears on this page, BUT after it appears, does nothing.

I am using Fluid.app with Greasekit, so I want to do this in Javascript. (There, I can make sure that this only happens on my selected page).

+4
source share
1 answer

call the onload() function like this <body onload="redirector()"> in javascript and check for the presence of the string on May 23, 2013 on the page. If then you do not use the location.reload() function to reload the page. "text1" is the identifier of the tag from which you want to check the string.

 <script type='text/javascript'> function redirector() { element=document.getElementById("text1"); text=element.innerHTML; if(text=="your text") { location.reload(); } } </script> 
+1
source

Source: https://habr.com/ru/post/1481495/


All Articles