Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running snippets in chrome after page reload

Is there any way to make chrome or any other browser run a snippet right after a page reloads? Thanks!

like image 513
Vladimir Mironov Avatar asked Feb 20 '16 21:02

Vladimir Mironov


People also ask

How do I automatically run snippet in Chrome?

Press Control + Shift + P (Windows/Linux) or Command + Shift + P (Mac) to open the Command Menu. Start typing Snippet , select Create new snippet, then press Enter to run the command.

How do I save a chrome snippet?

Pieces for Chrome makes it incredibly easy to save snippets from the web. To save, simply hover over any code block on a webpage and click the Pieces buttons to save the code or generate a link to share that snippet with others.

Where are chrome snippets stored?

its stored here C:\Users\Webdev\AppData\Local\Google\Chrome\User Data\Default\Local Storage\chrome-devtools_devtools_0. localstorage.


1 Answers

Since Snippets at the moment cannot be referenced (and started) from your code, you are not able to simply run them, you have to select and run it via the DevTools interface.

  • Related question
  • Chromium feature request

But you can automatically run your own code with other browser extensions, eg. Tampermonkey/Greasemonkey. In this case the logic that is implemented in the required snippet should be put into a Tampermonkey script.

like image 95
Attila Kevei Avatar answered Nov 02 '22 01:11

Attila Kevei