Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome: Auto-run for Javascript code?

Does anybody know if there is some way to run a piece of Javascript code for each page that loads in a browser? Sort of like inserting <script> first thing inside the head tag. I am most interested in a solution for Chrome. Maybe that is a job for a Chrome extension?

like image 233
Jonas N Avatar asked Mar 16 '12 16:03

Jonas N


1 Answers

Check out Tampermonkey, it's a Chrome extension for running user scripts (equivalent to GreaseMonkey for FF). To run a script on every page, you'd have a line like this near the beginning of your script:

// @include     *

Here's a tutorial on writing user scripts.

like image 130
calebds Avatar answered Oct 19 '22 12:10

calebds