[Pkg-mozext-commits] [greasemonkey] 24/41: Fix arguments to showInstallDialog().
David Prévot
taffit at moszumanska.debian.org
Thu Apr 30 22:06:34 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository greasemonkey.
commit 1201a6737cd8e203c19881b8104563b53d98522d
Author: Anthony Lieuallen <arantius at gmail.com>
Date: Wed Apr 22 14:47:41 2015 -0400
Fix arguments to showInstallDialog().
Never pass now unused service referencs. Instead pass referer URL (in case of HTML navigation) when known.
---
components/greasemonkey.js | 3 ++-
content/addons4-overlay.js | 3 +--
content/browser.js | 6 +++---
modules/util/showInstallDialog.js | 4 ++--
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/components/greasemonkey.js b/components/greasemonkey.js
index 397214d..0428b94 100644
--- a/components/greasemonkey.js
+++ b/components/greasemonkey.js
@@ -194,7 +194,8 @@ service.prototype.handleScriptValMsg = function(aMessage) {
};
service.prototype.scriptInstall = function(aMessage) {
- GM_util.showInstallDialog(aMessage.data.url, aMessage.target);
+ GM_util.showInstallDialog(
+ aMessage.data.url, aMessage.target, aMessage.data.referer);
};
service.prototype.urlIsTempFile = function(aMessage) {
diff --git a/content/addons4-overlay.js b/content/addons4-overlay.js
index 67fd5e4..c958bed 100644
--- a/content/addons4-overlay.js
+++ b/content/addons4-overlay.js
@@ -39,8 +39,7 @@ gDragDrop.onDrop = function GM_onDrop(aEvent) {
var droppedNonUserScript = false;
for (var i = urls.length - 1, url = null; url = urls[i]; i--) {
if (url.match(/\.user\.js$/)) {
- GM_util.showInstallDialog(
- url, GM_util.getBrowserWindow().gBrowser, GM_util.getService());
+ GM_util.showInstallDialog(url, GM_util.getBrowserWindow().gBrowser);
} else {
droppedNonUserScript = true;
}
diff --git a/content/browser.js b/content/browser.js
index 96642f4..996fb51 100644
--- a/content/browser.js
+++ b/content/browser.js
@@ -138,7 +138,7 @@ GM_BrowserUI.refreshStatus = function() {
// Not used directly, kept for GreaseFire. See #1507.
GM_BrowserUI.startInstallScript = function(aUri) {
- GM_util.showInstallDialog(aUri.spec, gBrowser, GM_util.getService());
+ GM_util.showInstallDialog(aUri.spec, gBrowser);
};
GM_BrowserUI.viewContextItemClicked = function() {
@@ -205,7 +205,7 @@ GM_BrowserUI.checkDisabledScriptNavigation = function(aEvent, aSafeWin, aHref) {
'popup': null,
'callback': function() {
GM_util.setEnabled(true);
- GM_util.showInstallDialog(aHref, gBrowser, GM_util.getService());
+ GM_util.showInstallDialog(aHref, gBrowser);
}
});
}
@@ -215,7 +215,7 @@ GM_BrowserUI.checkDisabledScriptNavigation = function(aEvent, aSafeWin, aHref) {
'accessKey': GM_BrowserUI.bundle.GetStringFromName('disabledWarning.install.accessKey'),
'popup': null,
'callback': GM_util.hitch(this, function() {
- GM_util.showInstallDialog(aHref, gBrowser, GM_util.getService());
+ GM_util.showInstallDialog(aHref, gBrowser);
})
});
diff --git a/modules/util/showInstallDialog.js b/modules/util/showInstallDialog.js
index 71f7971..98a7a8d 100644
--- a/modules/util/showInstallDialog.js
+++ b/modules/util/showInstallDialog.js
@@ -7,7 +7,7 @@ var gWindowWatcher = Components
.classes["@mozilla.org/embedcomp/window-watcher;1"]
.getService(Components.interfaces.nsIWindowWatcher);
-function showInstallDialog(aUrlOrRemoteScript, aBrowser) {
+function showInstallDialog(aUrlOrRemoteScript, aBrowser, aRefererUrl) {
var rs = null;
if ('string' == typeof aUrlOrRemoteScript) {
rs = new RemoteScript(aUrlOrRemoteScript);
@@ -41,7 +41,7 @@ function showInstallDialog(aUrlOrRemoteScript, aBrowser) {
if (!aSuccess && 'script' == aType) {
aBrowser.messageManager.sendAsyncMessage(
'greasemonkey:load-failed-script',
- {'url': rs.url});
+ {'referer': aRefererUrl, 'url': rs.url});
}
});
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/greasemonkey.git
More information about the Pkg-mozext-commits
mailing list