Sample Greasemonkey Script in Chrome to process local files

The following script will fire an alert box for local files:

// ==UserScript==
// @name Matcher
// @descriptions Match Local Files
// @version 1
// @match file://*
// ==/UserScript==

alert(1);

Save as “match.user.js”. Drop into a Chrome tab and you will be prompted to install. These are done per user profile. Each time you re-install the script, you need to remove the script from the extensions tab and repeat this process.

In order for this to work correctly, you need to open the Extensions settings in Chrome. You need to allow access to file urls, and incognito mode, if necessary.


(Click to enlarge)

Looking for a good programming book? Code Complete influenced me a lot as a programmer (the first edition starts at $0.01 used on Amazon).
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *