Home > Blockchain >  Execute Javascript code in browser via xJavascript
Execute Javascript code in browser via xJavascript

Time:11-18

I am looking for how to execute javascript code in the URL bar via xJavascript.

The standard way would be xJavascript:JAVASCRIPTCODEHERE, you would remove the "x" and it would execute the code, but that is not working.

Am I doing it wrong, or is no longer possible?

Please help!

CodePudding user response:

I'm not sure what browser you are on but this is what I use:

javascript: (() => { document.title = "Hello World";})();

It also might not be working because you are running it on a new tab (which doesn't work for chrome)

CodePudding user response:

If you are using this feature frequirently, make a bookmark with javascript:... code.

If you want to run some random JS while editing this JS, use Devtools (F12 or Ctrl Shift I in browser), Sources tab on top, Snippets tab on left. Snippets are persistent, editable, may run on any page.

If you want to run the same code on every page of a website, try https://chrome.google.com/webstore/detail/user-javascript-and-css/nbhcbdghjpllgmfilhnhkllmkecfmpld or Tampermonkey

  • Related