Run Greasemonkey on html files located on the local filesystem?

拥有回忆 提交于 2019-11-28 22:19:15

问题


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,


回答1:


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




回答2:


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



来源:https://stackoverflow.com/questions/9931115/run-greasemonkey-on-html-files-located-on-the-local-filesystem

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!