[Greasemonkey] Does GM work on local XML files?

oldgrandet1-groups at yahoo.com oldgrandet1-groups at yahoo.com
Wed Jul 20 09:00:09 EDT 2005


A quick newbie question:

I use Firefox to view XML files on my hard drive. I
was wondering if I could have Greasemonkey work with
those local XML files, but I can't seem to get GM to
activate scripts when I load them.


For example, here's a user script:

// @name          Local file detector
// @include       file:///*

alert("This is a local file");


I've installed this script and then opened local text
files, HTML files, and XML files in Firefox. With text
files and HTML files, I see the message, but not with
XML files. Perhaps the part of FF that handles XML
files is separate from the part that handles HTML and
text files.

Is there any way to write a GM script that will
activate when I load local XML files (that is, XML
files on my computer's hard drive)?



(The goal here is to automatically add XSL stylesheet
information to the XML files to I can read the XML
files more easily. I think I can add the stylesheet
information, but of course the first step is to get
the script to activate when I load the file.)


Thanks!


More information about the Greasemonkey mailing list