[Greasemonkey] Alternative script injection technique proof of concept

Aaron Boodman zboogs at gmail.com
Mon Jul 18 15:57:10 EDT 2005


I believe that this approach will allow user scripts to access any
XPCOM interface.

Try, for instance, putting this in a user script:

var file = Components.classes["@mozilla.org/file/directory_service;1"]
                     .getService(Components.interfaces.nsIProperties)
                     .get("TmpD", Components.interfaces.nsIFile);
file.append("suggestedName.tmp");
file.createUnique(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 0664);
alert(file.path);

-- 
Aaron


More information about the Greasemonkey mailing list