阅读:1736回复:1
这段userChrome.js代码,是不是在firefox4.0失效了
// automatically includes all files ending in .uc.js and .uc.xul from the profile's chrome folder
(function() { var getURLSpecFromFile = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService).getProtocolHandler("file").QueryInterface(Components.interfaces.nsIFileProtocolHandler).getURLSpecFromFile; var chromeDir = Components.classes["@mozilla.org/file/directory_service;1"].getService(Components.interfaces.nsIProperties).get("UChrm", Components.interfaces.nsILocalFile); var files = chromeDir.directoryEntries.QueryInterface(Components.interfaces.nsISimpleEnumerator); var xul_files = []; while (files.hasMoreElements()) { var file = files.getNext().QueryInterface(Components.interfaces.nsIFile); if (/\.uc\.js$/i.test(file.leafName)) { setTimeout(function(aFile) { Components.classes["@mozilla.org/moz/jssubscript-loader;1"].getService(Components.interfaces.mozIJSSubScriptLoader).loadSubScript(getURLSpecFromFile(aFile)); }, 0, file); } else if (/(^userChrome|\.uc)\.xul$/i.test(file.leafName)) { xul_files.push(file); } } setTimeout(function() { if (xul_files.length > 0) { document.loadOverlay(getURLSpecFromFile(xul_files.shift()), null); setTimeout(arguments.callee, 0); } }, 0); })(); |
|
1楼#
发布于:2011-04-02 12:48
不懂,你可以换用UC扩展试试
|
|