28

I have created some javascript code which searches the DOM and exposes some information for myself in the console, but in order this to work every time I have to go to Sources part of the console, go to the snippets part, click on the snippet name and run it.

Is there a way to make it autorun? Thanks!

funguy
  • 2,072
  • 7
  • 30
  • 41

4 Answers4

4

idk, been using "Custom JavaScript for websites" chrome extension: https://chrome.google.com/webstore/detail/custom-javascript-for-web/poakhlngfciodnhlhhgnaaelnpjljija

Jason
  • 1,974
  • 24
  • 19
3

nov 2019 : These are current Chrome Extensions that can run scripts on any page you want

Danny '365CSI' Engelman
  • 16,526
  • 2
  • 32
  • 49
2

From what I understand, currently, this is not possible. If you want to auto-run javascript on websites I recommend using something like Tampermonkey chrome extension. It allows you to inject your client's webpage with javascript that automatically runs.

0

I use Chrome feature "Event Listener Breakpoint > Script > Script First Statement" that places breakpoint before first line of each script.

I check it on ten reload the page and before first script execution the Chrome pauses. I run all the snippets and code I need then I remove the breakpoint and resume the page load.

elixon
  • 1,123
  • 12
  • 15