Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run Greasemonkey on html files located on the local filesystem?

I have an API documentation lying around on my Harddrive and to ease my workflow, I have written a simple script that modifies the page for my needs. I've developed it using FireBug on FireFox.

@include-ing webpages works correctly, but Greasemonkey does not seem to detect pages on the local file-system?

I would like to have an include like

// @include        *R13/Python*R13/*

Which should match for example

file:///Z:/Eigene%20Dateien/Cinema4D/Documentations/R13/Python%20R13/modules/c4d/index.html

But it is not recognized. How can I achieve that the userscript runs on local html files, too?

Thanks in advance,

like image 334
Niklas R Avatar asked Mar 29 '12 18:03

Niklas R


People also ask

Is Tampermonkey the same as Greasemonkey?

Tampermonkey is used to run so-called userscripts (sometimes also called Greasemonkey scripts) on websites. Userscripts are small computer programs that change the layout of a page, add or remove new functionality and content, or automate actions.

What language does Greasemonkey use?

Technical details. Greasemonkey user scripts are written in JavaScript and manipulate the contents of a web page using the Document Object Model interface.

What can you do with Greasemonkey?

Greasemonkey is an extension for the Firefox browser that allows users to write or install scripts that change the functionality of a website. The scripts are executed every time a website is loaded, so Greasemonkey could be used to permanently alter a user's experience of that website.


2 Answers

Since a couple of releases there are two new 'hidden' preferences:

greasemonkey.aboutIsGreaseable
greasemonkey.fileIsGreaseable

The default value is "false". If you want Greasemonkey to run on file:/// urls, you have to set the second one to "true" (in about:config).

Quoted from here:

http://groups.google.com/group/greasemonkey-users/browse_thread/thread/ad67ee03ae92e3f0/1dc4075bdb53438a

like image 80
Mikey G Avatar answered Oct 16 '22 06:10

Mikey G


tampermonkey

If you're here for the same reason I am, which is -> looking for the tampermonkey equivalent, (and you're using Chrome)... go to Chrome Preferences -> Extensions, aka chrome://extensions/, and you'll see Allow access to file URLs

Allow access to file URLs

like image 40
samstav Avatar answered Oct 16 '22 06:10

samstav