Bug 1583665 - Fixed AddonManager.jsm fullscreen check to only cancel installation for DOM fullscreen. r=johannh

Differential Revision: https://phabricator.services.mozilla.com/D47933

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Paul Zuehlcke 2019-10-09 09:28:19 +00:00
parent 5aaa18113b
commit 53a3c77cec
2 changed files with 10 additions and 5 deletions

View File

@ -543,7 +543,7 @@ var FullScreen = {
// fullscreen window is refocused.
window.addEventListener("activate", this);
// Addon installation should be cancelled when entering fullscreen for security and usability reasons.
// Addon installation should be cancelled when entering DOM fullscreen for security and usability reasons.
// Installation prompts in fullscreen can trick the user into installing unwanted addons.
// In fullscreen the notification box does not have a clear visual association with its parent anymore.
if (gXPInstallObserver.removeAllNotifications(aBrowser)) {

View File

@ -2300,10 +2300,15 @@ var AddonManagerInternal = {
}
try {
if (topBrowser.ownerGlobal.fullScreen) {
// Addon installation and the resulting notifications should be blocked in fullscreen for security and usability reasons.
// Installation prompts in fullscreen can trick the user into installing unwanted addons.
// In fullscreen the notification box does not have a clear visual association with its parent anymore.
// Use fullscreenElement to check for DOM fullscreen, while still allowing
// macOS fullscreen, which still has a browser chrome.
if (topBrowser.ownerDocument.fullscreenElement) {
// Addon installation and the resulting notifications should be
// blocked in DOM fullscreen for security and usability reasons.
// Installation prompts in fullscreen can trick the user into
// installing unwanted addons.
// In fullscreen the notification box does not have a clear
// visual association with its parent anymore.
aInstall.cancel();
this.installNotifyObservers(