diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-07-18 08:24:24 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-07-18 08:24:24 +0200 |
commit | fc61780b35af913801d72086456f493f63197da6 (patch) | |
tree | f85891288a7bd988da9f0f15ae64e5c63f00d493 /toolkit/mozapps/extensions/content/newaddon.js | |
parent | 69f7f9e5f1475891ce11cc4f431692f965b0cd30 (diff) | |
parent | 50d3e596bbe89c95615f96eb71f6bc5be737a1db (diff) | |
download | UXP-fc61780b35af913801d72086456f493f63197da6.tar UXP-fc61780b35af913801d72086456f493f63197da6.tar.gz UXP-fc61780b35af913801d72086456f493f63197da6.tar.lz UXP-fc61780b35af913801d72086456f493f63197da6.tar.xz UXP-fc61780b35af913801d72086456f493f63197da6.zip |
Merge commit '50d3e596bbe89c95615f96eb71f6bc5be737a1db' into Basilisk-releasev2018.07.18
# Conflicts:
# browser/app/profile/firefox.js
# browser/components/preferences/jar.mn
Diffstat (limited to 'toolkit/mozapps/extensions/content/newaddon.js')
-rw-r--r-- | toolkit/mozapps/extensions/content/newaddon.js | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/toolkit/mozapps/extensions/content/newaddon.js b/toolkit/mozapps/extensions/content/newaddon.js index e45b3c1cc..79978a698 100644 --- a/toolkit/mozapps/extensions/content/newaddon.js +++ b/toolkit/mozapps/extensions/content/newaddon.js @@ -13,7 +13,7 @@ var gAddon = null; // If the user enables the add-on through some other UI close this window var EnableListener = { - onEnabling: function EnableListener_onEnabling(aAddon) { + onEnabling: function(aAddon) { if (aAddon.id == gAddon.id) window.close(); } @@ -38,11 +38,14 @@ function initialize() { let bundle = Services.strings.createBundle("chrome://mozapps/locale/extensions/newaddon.properties"); - AddonManager.getAddonByID(id, function initialize_getAddonByID(aAddon) { - // If the add-on doesn't exist or it is already enabled or it cannot be - // enabled then this UI is useless, just close it. This shouldn't normally - // happen unless session restore restores the tab + AddonManager.getAddonByID(id, function(aAddon) { + // If the add-on doesn't exist or it is already enabled or it has already + // been seen or it cannot be enabled then this UI is useless, just close it. + // This shouldn't normally happen unless session restore restores the tab. if (!aAddon || !aAddon.userDisabled || +#ifdef MOZ_WEBEXTENSIONS + aAddon.seen || +#endif !(aAddon.permissions & AddonManager.PERM_CAN_ENABLE)) { window.close(); return; @@ -79,6 +82,16 @@ function initialize() { document.getElementById("location").hidden = true; } +#ifdef MOZ_WEBEXTENSIONS + // Only mark the add-on as seen if the page actually gets focus + if (document.hasFocus()) { + aAddon.markAsSeen(); + } + else { + document.addEventListener("focus", () => aAddon.markAsSeen(), false); + } +#endif + var event = document.createEvent("Events"); event.initEvent("AddonDisplayed", true, true); document.dispatchEvent(event); |