Permalink
Browse files

'View user script source' feature w/out scriptDownloader.

Refs #1458
  • Loading branch information...
1 parent 268f716 commit a7d957f98db94403fd13c6ccfd57e97294301c3b @arantius arantius committed Nov 19, 2011
Showing with 11 additions and 5 deletions.
  1. +2 −1 components/greasemonkey.js
  2. +9 −4 content/browser.js
@@ -379,9 +379,10 @@ service.prototype.shouldLoad = function(ct, cl, org, ctx, mt, ext) {
installDialog(cl, ctx, this);
ret = Ci.nsIContentPolicy.REJECT_REQUEST;
}
+
+ this._ignoreNextScript = false;
}
- this._ignoreNextScript = false;
return ret;
};
View
@@ -268,10 +268,15 @@ GM_BrowserUI.refreshStatus = function() {
GM_BrowserUI.viewContextItemClicked = function() {
var uri = GM_BrowserUI.getUserScriptLinkUnderPointer();
-
- GM_BrowserUI._scriptDownloader = new GM_ScriptDownloader(
- window, uri, GM_BrowserUI.bundle);
- GM_BrowserUI._scriptDownloader.startViewScript();
+ if (!uri) return;
+
+ var doc = document.popupNode.ownerDocument;
+ GM_util.getService().ignoreNextScript();
+ // TODO: Is this right for Firefox 3?
+ openLinkIn(uri.spec, 'tab', {
+ 'charset': doc.characterset,
+ 'referrerURI': doc.documentURIObject
+ });
};
GM_BrowserUI.showToolbarButton = function() {

0 comments on commit a7d957f

Please sign in to comment.