diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-03-14 15:52:02 +0100 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-03-14 15:52:02 +0100 |
commit | 9bbb73578165bfc1078ef87943eee2cbc0b6a406 (patch) | |
tree | d14434efe4440eb8900939c9e7ec16665f165139 | |
parent | 43baba48cda84a42c4241e0e4feaa10ecd0596de (diff) | |
download | palemoon-gre-9bbb73578165bfc1078ef87943eee2cbc0b6a406.tar.gz |
Clicking on a notification should select the originating tab
Issue #1641
-rw-r--r-- | browser/base/content/content.js | 6 | ||||
-rw-r--r-- | browser/base/content/tabbrowser.xml | 12 |
2 files changed, 16 insertions, 2 deletions
diff --git a/browser/base/content/content.js b/browser/base/content/content.js index 19032eb84..3587bbeef 100644 --- a/browser/base/content/content.js +++ b/browser/base/content/content.js @@ -61,4 +61,8 @@ addEventListener("blur", function(event) { addMessageListener("Finder:Initialize", function () { let {RemoteFinderListener} = Cu.import("resource://gre/modules/RemoteFinder.jsm", {}); new RemoteFinderListener(global); -});
\ No newline at end of file +}); + +addEventListener("DOMWebNotificationClicked", function(event) { + sendAsyncMessage("DOMWebNotificationClicked", {}); +}, false); diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml index b8d5f3e41..8f94ded8a 100644 --- a/browser/base/content/tabbrowser.xml +++ b/browser/base/content/tabbrowser.xml @@ -2950,13 +2950,22 @@ let browser = aMessage.target; switch (aMessage.name) { - case "DOMTitleChanged": + case "DOMTitleChanged": { let tab = this.getTabForBrowser(browser); if (!tab) return; let titleChanged = this.setTabTitle(tab); if (titleChanged && !tab.selected && !tab.hasAttribute("busy")) tab.setAttribute("titlechanged", "true"); + } + case "DOMWebNotificationClicked": { + let tab = this._getTabForBrowser(browser); + if (!tab) + return; + this.selectedTab = tab; + window.focus(); + break; + } } ]]></body> </method> @@ -3022,6 +3031,7 @@ this._outerWindowIDBrowserMap.set(this.mCurrentBrowser.outerWindowID, this.mCurrentBrowser); } + messageManager.addMessageListener("DOMWebNotificationClicked", this); ]]> </constructor> |