| 128 | | function load(urls) { |
|---|
| 129 | | var loader = Cc["@mozilla.org/moz/jssubscript-loader;1"] |
|---|
| 130 | | .getService(Ci.mozIJSSubScriptLoader); |
|---|
| 131 | | for (var i = 0; i < arguments.length; i++) |
|---|
| 132 | | loader.loadSubScript(arguments[i]); |
|---|
| 133 | | } |
|---|
| 134 | | |
|---|
| 135 | | load("chrome://global/content/XPCNativeWrapper.js", |
|---|
| 136 | | "chrome://greasemonkey/content/prefmanager.js", |
|---|
| 137 | | "chrome://greasemonkey/content/utils.js", |
|---|
| 138 | | "chrome://greasemonkey/content/config.js", |
|---|
| 139 | | "chrome://greasemonkey/content/convert2RegExp.js", |
|---|
| 140 | | "chrome://greasemonkey/content/miscapis.js", |
|---|
| 141 | | "chrome://greasemonkey/content/xmlhttprequester.js", |
|---|
| 142 | | "chrome://greasemonkey/content/updater.js"); |
|---|
| | 128 | var loader = Cc["@mozilla.org/moz/jssubscript-loader;1"] |
|---|
| | 129 | .getService(Ci.mozIJSSubScriptLoader); |
|---|
| | 130 | loader.loadSubScript("chrome://global/content/XPCNativeWrapper.js"); |
|---|
| | 131 | loader.loadSubScript("chrome://greasemonkey/content/prefmanager.js"); |
|---|
| | 132 | loader.loadSubScript("chrome://greasemonkey/content/utils.js"); |
|---|
| | 133 | loader.loadSubScript("chrome://greasemonkey/content/config.js"); |
|---|
| | 134 | loader.loadSubScript("chrome://greasemonkey/content/convert2RegExp.js"); |
|---|
| | 135 | loader.loadSubScript("chrome://greasemonkey/content/miscapis.js"); |
|---|
| | 136 | loader.loadSubScript("chrome://greasemonkey/content/xmlhttprequester.js"); |
|---|
| | 137 | loader.loadSubScript("chrome://greasemonkey/content/updater.js"); |
|---|
| 405 | | var firebug = chromeWin.Firebug.Console; |
|---|
| 406 | | var fbContext = chromeWin.TabWatcher.getContextByWindow(unsafeContentWin); |
|---|
| 407 | | |
|---|
| 408 | | if (!firebug.isEnabled(fbContext)) return null; |
|---|
| 409 | | |
|---|
| 410 | | firebugConsole = {}; |
|---|
| 411 | | var commands = ["log", "debug", "info", "warn", "error"]; |
|---|
| 412 | | commands.forEach(function(command) { |
|---|
| 413 | | firebugConsole[command] = function() { |
|---|
| 414 | | firebug.logFormatted.call( |
|---|
| 415 | | firebug, Array.slice(arguments), firebugContext, command |
|---|
| 416 | | ); |
|---|
| 417 | | } |
|---|
| 418 | | }); |
|---|
| | 400 | if (!chromeWin.Firebug.Console.isEnabled(firebugContext)) { |
|---|
| | 401 | return null; |
|---|
| | 402 | } |
|---|
| | 403 | var handler = eval("FirebugConsoleHandler", |
|---|
| | 404 | chromeWin.Firebug.Console.injector.attachConsole); |
|---|
| | 405 | firebugConsole = new handler(firebugContext, unsafeContentWin); |
|---|