34

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,

Niklas R
  • 16,299
  • 28
  • 108
  • 203
  • 1
    maybe look at this: http://groups.google.com/group/greasemonkey-users/browse_thread/thread/ad67ee03ae92e3f0/1dc4075bdb53438a?pli=1 – Mikey G Mar 29 '12 at 18:56
  • In Greasemonkey 4.10.0, I was able to match all files within the metadata block by setting `@match` to `file:///*`. To match mp4 and webm files I used: `file:///*.mp4` and `file:///*.webm`. To check if the specified files were being matched, I initially used `console.log` to output a simple message in the browser's console tab in the web developer window. Also, I didn't need to modify any configuration values within the browser to do this. – Dave F Jan 03 '21 at 10:46

2 Answers2

45

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

Community
  • 1
  • 1
samstav
  • 1,945
  • 1
  • 20
  • 20
40

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

Mikey G
  • 3,473
  • 1
  • 22
  • 27
  • 4
    As of firefox 49.0 this seems to be extensions.greasemonkey.fileIsGreaseable, and you need to restart firefox after installing greasemonkey for the preference to appear – yms Sep 20 '16 at 19:03