Permalink
Browse files

Make install window 'show script source' work again.

  • Loading branch information...
arantius committed Dec 1, 2011
1 parent b95cfd6 commit 94711904e5b17795b273a13f7b5cd72e566b89f7
Showing with 13 additions and 1 deletion.
  1. +10 −1 content/install.js
  2. +3 −0 modules/remoteScript.js
View
@@ -1,3 +1,5 @@
+Components.utils.import('resource://greasemonkey/util.js');
+
var gRemoteScript = window.arguments[0].wrappedJSObject[0];
var gScript = window.arguments[0].wrappedJSObject[1];
var gHtmlNs = 'http://www.w3.org/1999/xhtml';
@@ -95,7 +97,14 @@ function onProgress(aRemoteScript, aEventType, aData) {
}
function onShowSource() {
- // _scriptDownloader.showScriptView();
+ gRemoteScript.cleanup();
+ GM_util.getService().ignoreNextScript();
+
+ var win = GM_util.getBrowserWindow();
+ // TODO: Test this in Firefox 3.
+ win.gBrowser.loadURI(
+ gRemoteScript.url, /* aReferrer */ null, /* aCharset */ null);
+
window.setTimeout(window.close, 0);
}
View
@@ -155,6 +155,9 @@ function RemoteScript(aUrl) {
this.script = null;
}
+RemoteScript.prototype.__defineGetter__(
+ 'url', function() { return new String(this._url); });
+
/** Clean up all temporary files, stop all actions. */
RemoteScript.prototype.cleanup = function(aErrorMessage) {
this.errorMessage = aErrorMessage || null;

0 comments on commit 9471190

Please sign in to comment.