[Pkg-mozext-commits] [greasemonkey] 05/43: [WIP] Remove unused/broken GM_BrowserUI observer
David Prévot
taffit at moszumanska.debian.org
Sun Feb 22 21:56:09 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 98a1d8767a06389c4b01fb4258f74f10d6729360
Author: Ventero <ventero at ventero.de>
Date: Sat Sep 27 06:07:49 2014 +0200
[WIP] Remove unused/broken GM_BrowserUI observer
Since GM_BrowserUI is a function, the observer service calls it
directly instead of GM_BrowserUI.observe.
---
content/browser.js | 39 ---------------------------------------
1 file changed, 39 deletions(-)
diff --git a/content/browser.js b/content/browser.js
index 4e2328d..5fcebe4 100644
--- a/content/browser.js
+++ b/content/browser.js
@@ -8,19 +8,6 @@ Components.utils.import('resource://greasemonkey/util.js');
function GM_BrowserUI() {};
-/**
- * nsISupports.QueryInterface
- */
-GM_BrowserUI.QueryInterface = function(aIID) {
- if (!aIID.equals(Components.interfaces.nsISupports) &&
- !aIID.equals(Components.interfaces.nsIObserver) &&
- !aIID.equals(Components.interfaces.nsISupportsWeakReference))
- throw Components.results.NS_ERROR_NO_INTERFACE;
-
- return GM_BrowserUI;
-};
-
-
GM_BrowserUI.init = function() {
window.addEventListener("load", GM_BrowserUI.chromeLoad, false);
window.addEventListener("unload", GM_BrowserUI.chromeUnload, false);
@@ -58,16 +45,6 @@ GM_BrowserUI.chromeLoad = function(e) {
document.getElementById("contentAreaContextMenu")
.addEventListener("popupshowing", GM_BrowserUI.contextMenuShowing, false);
- var observerService = Components.classes["@mozilla.org/observer-service;1"]
- .getService(Components.interfaces.nsIObserverService);
- observerService.addObserver(GM_BrowserUI, "install-userscript", true);
- observerService.addObserver(GM_BrowserUI, "inner-window-destroyed", true);
-
- // we use this to determine if we are the active window sometimes
- GM_BrowserUI.winWat = Components
- .classes["@mozilla.org/embedcomp/window-watcher;1"]
- .getService(Components.interfaces.nsIWindowWatcher);
-
GM_BrowserUI.gmSvc = GM_util.getService();
// Reference this once, so that the getter is called at least once, and the
// initialization routines will run, no matter what.
@@ -96,22 +73,6 @@ GM_BrowserUI.pageshow = function(aEvent) {
GM_MenuCommander.onPageShow(windowId);
};
-// nsIObserve
-GM_BrowserUI.observe = function(subject, topic, data) {
- if (topic == "install-userscript") {
- if (window == GM_BrowserUI.winWat.activeWindow) {
- GM_BrowserUI.installCurrentScript();
- }
- } else if (topic == "dom-window-destroyed") {
- GM_BrowserUI.gmSvc.contentDestroyed(GM_util.windowId(subject));
- } else if (topic == "inner-window-destroyed") {
- GM_BrowserUI.gmSvc.contentDestroyed(
- subject.QueryInterface(Components.interfaces.nsISupportsPRUint64).data);
- } else {
- throw new Error("Unexpected topic received: {" + topic + "}");
- }
-};
-
GM_BrowserUI.openTab = function(url) {
gBrowser.selectedTab = gBrowser.addTab(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