I am trying to run a JavaScript code, something like this document.getElementById('someID').innerHTML = '';
in a web browser console. It works fine until the page is refreshed or redirected to another page. Soon after the page refreshes the console gets erased, and I have to manually run it again. Is there a way to run JavaScript code continuously in the browser console even after the page reloads, or is there any other way (externally from the browser console) to accomplish the above task?
Asked
Active
Viewed 2,497 times
2

karel
- 5,489
- 46
- 45
- 50

Naveen Yamparala
- 43
- 6
-
You can only do that with cooperation from code in the page. – SLaks Oct 05 '18 at 16:18
-
You could write a browser extension. – SLaks Oct 05 '18 at 16:19
2 Answers
2
You can try tamper monkey there are chrome and firefox versions https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=en

PHP_Developer
- 386
- 3
- 11
0
GreaseMonkey is one more option for Firefox to run external js along with page loaded js

MukundK
- 86
- 2