diff options
author | Moonchild <mcwerewolf@gmail.com> | 2018-03-19 01:03:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-19 01:03:04 +0100 |
commit | dcd332ecece7e1eaa73179a8497e6469488f8048 (patch) | |
tree | fe2ef2305f5105133ed2c316276b733392761b7f | |
parent | 1832d2b0f420ed598019b61710794d7edd2dd699 (diff) | |
parent | 59a8c7bfb05e6151b9b768e7af69f810df28cbd6 (diff) | |
download | palemoon-gre-dcd332ecece7e1eaa73179a8497e6469488f8048.tar.gz |
Merge pull request #1642 from janekptacijarabaci/desktopNotifications_click_1
Clicking on a notification should select the originating tab
-rw-r--r-- | browser/base/content/content.js | 6 | ||||
-rw-r--r-- | browser/base/content/tabbrowser.xml | 13 |
2 files changed, 17 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..51f7063f3 100644 --- a/browser/base/content/tabbrowser.xml +++ b/browser/base/content/tabbrowser.xml @@ -2950,13 +2950,23 @@ 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"); + break; + } + case "DOMWebNotificationClicked": { + let tab = this.getTabForBrowser(browser); + if (!tab) + return; + this.selectedTab = tab; + window.focus(); + break; + } } ]]></body> </method> @@ -3022,6 +3032,7 @@ this._outerWindowIDBrowserMap.set(this.mCurrentBrowser.outerWindowID, this.mCurrentBrowser); } + messageManager.addMessageListener("DOMWebNotificationClicked", this); ]]> </constructor> |