MFH: r466694

www/waterfox: apply some FF60 fixes

Approved by:	ports-secteam blanket
This commit is contained in:
Jan Beich 2018-04-07 00:23:52 +00:00
parent ef63829717
commit 7e4a6419d3
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/branches/2018Q2/; revision=466697
11 changed files with 1819 additions and 1 deletions

View File

@ -2,7 +2,7 @@
PORTNAME= waterfox
DISTVERSION= 56.1.0
PORTREVISION= 5
PORTREVISION= 6
CATEGORIES= www ipv6
MAINTAINER= jbeich@FreeBSD.org

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,53 @@
commit c978a96e849c
Author: Chung-Sheng Fu <cfu@mozilla.com>
Date: Thu Aug 31 17:06:22 2017 +0800
Bug 1395486 - Move resource://gre-resource/plaintext.css to resource://content-accessible/plaintext.css. r=heycam
MozReview-Commit-ID: Efz2Z78W2ix
--HG--
extra : rebase_source : 0522f382acd14372c6fea0a695f1d09300810912
---
layout/style/jar.mn | 1 -
layout/style/moz.build | 1 +
parser/html/nsHtml5PlainTextUtils.cpp | 2 +-
3 files changed, 2 insertions(+), 2 deletions(-)
diff --git layout/style/jar.mn layout/style/jar.mn
index 81af0f7540fc..4a4418218290 100644
--- layout/style/jar.mn
+++ layout/style/jar.mn
@@ -6,7 +6,6 @@ toolkit.jar:
* res/ua.css (res/ua.css)
* res/html.css (res/html.css)
res/quirk.css (res/quirk.css)
- res/plaintext.css (res/plaintext.css)
res/counterstyles.css (res/counterstyles.css)
res/noscript.css (res/noscript.css)
res/noframes.css (res/noframes.css)
diff --git layout/style/moz.build layout/style/moz.build
index d4fbd0fef384..b5b19ee62232 100644
--- layout/style/moz.build
+++ layout/style/moz.build
@@ -304,6 +304,7 @@ RESOURCE_FILES += [
CONTENT_ACCESSIBLE_FILES += [
'ImageDocument.css',
+ 'res/plaintext.css',
'res/viewsource.css',
'TopLevelImageDocument.css',
'TopLevelVideoDocument.css',
diff --git parser/html/nsHtml5PlainTextUtils.cpp parser/html/nsHtml5PlainTextUtils.cpp
index e68522987784..920c5eee89d1 100644
--- parser/html/nsHtml5PlainTextUtils.cpp
+++ parser/html/nsHtml5PlainTextUtils.cpp
@@ -22,7 +22,7 @@ nsHtml5PlainTextUtils::NewLinkAttributes()
nsHtml5String type = nsHtml5Portability::newStringFromLiteral("text/css");
linkAttrs->addAttribute(nsHtml5AttributeName::ATTR_TYPE, type, -1);
nsHtml5String href = nsHtml5Portability::newStringFromLiteral(
- "resource://gre-resources/plaintext.css");
+ "resource://content-accessible/plaintext.css");
linkAttrs->addAttribute(nsHtml5AttributeName::ATTR_HREF, href, -1);
nsresult rv;

View File

@ -0,0 +1,72 @@
commit bd563cddc5dd
Author: Jan Henning <jh+bugzilla@buttercookie.de>
Date: Sun Jan 28 23:01:42 2018 +0100
Bug 1433715 - Make fallback folder icon content-accessible. r=Gijs, a=RyanVM
The skin used on Firefox for Android doesn't style directory listing, hence we
fall back to using the default icon from gre/res/html. As of bug 863246, this
location is no longer accessible from content as a resource://, hence the file
needs moving into the special content-accessible directory.
MozReview-Commit-ID: obtefafqul
--HG--
extra : source : 2703a2d5b196fb2fb61929e0ce5d3596799d52cd
---
browser/installer/package-manifest.in | 1 -
layout/generic/moz.build | 2 +-
mobile/android/installer/package-manifest.in | 1 -
netwerk/streamconv/converters/nsIndexedToHTML.cpp | 2 +-
4 files changed, 2 insertions(+), 4 deletions(-)
diff --git browser/installer/package-manifest.in browser/installer/package-manifest.in
index b215cada67ce..015568109c48 100644
--- browser/installer/package-manifest.in
+++ browser/installer/package-manifest.in
@@ -690,7 +690,6 @@
#endif
@RESPATH@/res/fonts/*
@RESPATH@/res/dtd/*
-@RESPATH@/res/html/*
@RESPATH@/res/language.properties
#ifdef XP_MACOSX
@RESPATH@/res/MainMenu.nib/
diff --git layout/generic/moz.build layout/generic/moz.build
index 13d64901ebf6..c277ca131e81 100644
--- layout/generic/moz.build
+++ layout/generic/moz.build
@@ -212,7 +212,7 @@ LOCAL_INCLUDES += [
JAR_MANIFESTS += ['jar.mn']
-RESOURCE_FILES.html = [
+CONTENT_ACCESSIBLE_FILES.html = [
'folder.png',
]
diff --git mobile/android/installer/package-manifest.in mobile/android/installer/package-manifest.in
index 01c8bc32408d..3489bd812787 100644
--- mobile/android/installer/package-manifest.in
+++ mobile/android/installer/package-manifest.in
@@ -469,7 +469,6 @@
@BINPATH@/res/table-remove-row.gif
@BINPATH@/res/grabber.gif
@BINPATH@/res/dtd/*
-@BINPATH@/res/html/*
@BINPATH@/res/language.properties
#ifndef MOZ_ANDROID_EXCLUDE_FONTS
diff --git netwerk/streamconv/converters/nsIndexedToHTML.cpp netwerk/streamconv/converters/nsIndexedToHTML.cpp
index f18c39e99c8c..91372de3a617 100644
--- netwerk/streamconv/converters/nsIndexedToHTML.cpp
+++ netwerk/streamconv/converters/nsIndexedToHTML.cpp
@@ -351,7 +351,7 @@ nsIndexedToHTML::DoOnStartRequest(nsIRequest* request, nsISupports *aContext,
" vertical-align: middle;\n"
"}\n"
".dir::before {\n"
- " content: url(resource://gre/res/html/folder.png);\n"
+ " content: url(resource://content-accessible/html/folder.png);\n"
"}\n"
"</style>\n"
"<link rel=\"stylesheet\" media=\"screen, projection\" type=\"text/css\""

View File

@ -0,0 +1,28 @@
commit fb1d12efaddd
Author: Kris Maglione <maglione.k@gmail.com>
Date: Wed Apr 4 17:01:59 2018 -0700
Bug 1436482 - Always use the principal URI as the principal URI. r=mixedpuppy, a=jcristau
MozReview-Commit-ID: 7oePANQBCxK
--HG--
extra : source : 07ab807639ee42a407a9bdb0d374206c0f17678d
---
toolkit/components/extensions/WebExtensionPolicy.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git toolkit/components/extensions/WebExtensionPolicy.cpp toolkit/components/extensions/WebExtensionPolicy.cpp
index d59507fcdd59..2580bc932dd1 100644
--- toolkit/components/extensions/WebExtensionPolicy.cpp
+++ toolkit/components/extensions/WebExtensionPolicy.cpp
@@ -681,8 +681,7 @@ DocInfo::Principal() const
const URLInfo&
DocInfo::PrincipalURL() const
{
- if (!URL().InheritsPrincipal() ||
- !(Principal() && Principal()->GetIsCodebasePrincipal())) {
+ if (!(Principal() && Principal()->GetIsCodebasePrincipal())) {
return URL();
}

View File

@ -0,0 +1,26 @@
commit 37c440a66fbb
Author: accakks <aakanksha.jain8@gmail.com>
Date: Fri Mar 23 20:04:34 2018 +0530
Bug 1437880 - Disable "Remove Selected" button in the site data manager dialog if a website is deselected. r=prathiksha, a=RyanVM
MozReview-Commit-ID: 7YhXjg84QSx
--HG--
extra : source : e7de3b21524c2d56a5c82ecde470b43f3ddb2d87
---
browser/components/preferences/siteDataSettings.js | 1 +
1 file changed, 1 insertion(+)
diff --git browser/components/preferences/siteDataSettings.js browser/components/preferences/siteDataSettings.js
index 2be61084a8bd..141a4ec850ba 100644
--- browser/components/preferences/siteDataSettings.js
+++ browser/components/preferences/siteDataSettings.js
@@ -263,6 +263,7 @@ let gSiteDataSettings = {
onClickTreeCol(e) {
this._sortSites(this._sites, e.target);
this._buildSitesList(this._sites);
+ this._list.clearSelection();
},
onCommandSearch() {

View File

@ -0,0 +1,32 @@
commit f708f8644183
Author: Julien Cristau <jcristau@mozilla.com>
Date: Wed Mar 14 10:39:36 2018 +0100
Bug 1445582 - Error out when the searchplugins list is empty or a plugin is missing. r=froydnj, a=release
MozReview-Commit-ID: DCUEc526d8D
--HG--
extra : source : 9bdac68266e290963ad3a47cad717339345d1f8a
extra : intermediate-source : 031af54f082d87d8a4b0bf6bb09556115ff59f20
---
browser/locales/Makefile.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git browser/locales/Makefile.in browser/locales/Makefile.in
index 6b0455bf0285..f4abd1f5e6ea 100644
--- browser/locales/Makefile.in
+++ browser/locales/Makefile.in
@@ -61,10 +61,10 @@ STUB_HOOK = $(NSINSTALL) -D '$(ABS_DIST)/$(PKG_INST_PATH)'; \
$(NULL)
endif
-SEARCHPLUGINS_FILENAMES := $(shell $(call py_action,output_searchplugins_list,$(srcdir)/search/list.json $(AB_CD)))
+SEARCHPLUGINS_FILENAMES := $(or $(shell $(call py_action,output_searchplugins_list,$(srcdir)/search/list.json $(AB_CD))), $(error Missing search plugins))
SEARCHPLUGINS_PATH := .deps/generated_$(AB_CD)
SEARCHPLUGINS_TARGET := libs searchplugins
-SEARCHPLUGINS := $(foreach plugin,$(addsuffix .xml,$(SEARCHPLUGINS_FILENAMES)),$(or $(wildcard $(srcdir)/searchplugins/$(plugin)),$(warning Missing searchplugin: $(plugin))))
+SEARCHPLUGINS := $(foreach plugin,$(addsuffix .xml,$(SEARCHPLUGINS_FILENAMES)),$(or $(wildcard $(srcdir)/searchplugins/$(plugin)),$(error Missing searchplugin: $(plugin))))
# Some locale-specific search plugins may have preprocessor directives, but the
# default en-US ones do not.
SEARCHPLUGINS_FLAGS := --silence-missing-directive-warnings

View File

@ -0,0 +1,26 @@
commit 7cc076355a82
Author: Gijs Kruitbosch <gijskruitbosch@gmail.com>
Date: Wed Mar 28 14:57:09 2018 +0100
Bug 1447969 - r=nchevobbe,a=abillings
--HG--
extra : rebase_source : e87a95170d907ddbc486e8536cee8685d6fe4a50
---
devtools/client/debugger/new/debugger.js | 2 +-
devtools/client/webconsole/console-output.js | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git devtools/client/webconsole/console-output.js devtools/client/webconsole/console-output.js
index 98fa15cb2858..701a38e970bd 100644
--- devtools/client/webconsole/console-output.js
+++ devtools/client/webconsole/console-output.js
@@ -29,7 +29,7 @@ const defer = require("devtools/shared/defer");
const MAX_STRING_GRIP_LENGTH = 36;
const {ELLIPSIS} = require("devtools/shared/l10n");
-const validProtocols = /^(http|https|ftp|data|javascript|resource|chrome):/i;
+const validProtocols = /^(http|https|ftp|resource|chrome):/i;
// Constants for compatibility with the Web Console output implementation before
// bug 778766.

View File

@ -0,0 +1,35 @@
commit 4afe466a9d1d
Author: Randell Jesup <rjesup@jesup.org>
Date: Thu Apr 5 17:15:07 2018 -0400
Bug 1448705 - Use input latency for draining. r=jya, a=jcristau
--HG--
extra : source : b2904f128f854a71216f299b835da5a422ceb3cd
---
dom/media/AudioConverter.cpp | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git dom/media/AudioConverter.cpp dom/media/AudioConverter.cpp
index 9293b09bd5e0..f0f816ab8a3f 100644
--- dom/media/AudioConverter.cpp
+++ dom/media/AudioConverter.cpp
@@ -365,15 +365,13 @@ size_t
AudioConverter::ResampleRecipientFrames(size_t aFrames) const
{
if (!aFrames && mIn.Rate() != mOut.Rate()) {
- // The resampler will be drained, account for frames currently buffered
- // in the resampler.
if (!mResampler) {
return 0;
}
- return speex_resampler_get_output_latency(mResampler);
- } else {
- return (uint64_t)aFrames * mOut.Rate() / mIn.Rate() + 1;
+ // We drain by pushing in get_input_latency() samples of 0
+ aFrames = speex_resampler_get_input_latency(mResampler);
}
+ return (uint64_t)aFrames * mOut.Rate() / mIn.Rate() + 1;
}
size_t

View File

@ -0,0 +1,151 @@
commit 23ab7188ecaa
Author: Alexander Surkov <surkov.alexander@gmail.com>
Date: Thu Apr 5 16:07:35 2018 -0400
Bug 1449530 - Clean up ATK states mapping. r=eeejay, a=RyanVM
---
accessible/atk/AccessibleWrap.cpp | 46 ++++++++++++++++++++++-----------------
accessible/atk/nsStateMap.h | 21 +++++++-----------
accessible/base/States.h | 5 +++++
3 files changed, 39 insertions(+), 33 deletions(-)
diff --git accessible/atk/AccessibleWrap.cpp accessible/atk/AccessibleWrap.cpp
index 3abfff51cd18..0a4c44f1b4f4 100644
--- accessible/atk/AccessibleWrap.cpp
+++ accessible/atk/AccessibleWrap.cpp
@@ -930,9 +930,8 @@ TranslateStates(uint64_t aState, AtkStateSet* aStateSet)
aState &= ~states::EDITABLE;
// Convert every state to an entry in AtkStateMap
- uint32_t stateIndex = 0;
uint64_t bitMask = 1;
- while (gAtkStateMap[stateIndex].stateMapEntryType != kNoSuchState) {
+ for (auto stateIndex = 0U; stateIndex < gAtkStateMapLen; stateIndex++) {
if (gAtkStateMap[stateIndex].atkState) { // There's potentially an ATK state for this
bool isStateOn = (aState & bitMask) != 0;
if (gAtkStateMap[stateIndex].stateMapEntryType == kMapOpposite) {
@@ -943,7 +942,6 @@ TranslateStates(uint64_t aState, AtkStateSet* aStateSet)
}
}
bitMask <<= 1;
- ++ stateIndex;
}
}
@@ -1539,24 +1537,32 @@ a11y::ProxyCaretMoveEvent(ProxyAccessible* aTarget, int32_t aOffset)
void
MaiAtkObject::FireStateChangeEvent(uint64_t aState, bool aEnabled)
{
- int32_t stateIndex = AtkStateMap::GetStateIndexFor(aState);
- if (stateIndex >= 0) {
- NS_ASSERTION(gAtkStateMap[stateIndex].stateMapEntryType != kNoSuchState,
- "No such state");
-
- if (gAtkStateMap[stateIndex].atkState != kNone) {
- NS_ASSERTION(gAtkStateMap[stateIndex].stateMapEntryType != kNoStateChange,
- "State changes should not fired for this state");
-
- if (gAtkStateMap[stateIndex].stateMapEntryType == kMapOpposite)
- aEnabled = !aEnabled;
-
- // Fire state change for first state if there is one to map
- atk_object_notify_state_change(&parent,
- gAtkStateMap[stateIndex].atkState,
- aEnabled);
- }
+ auto state = aState;
+ int32_t stateIndex = -1;
+ while (state > 0) {
+ ++stateIndex;
+ state >>= 1;
+ }
+
+ MOZ_ASSERT(stateIndex >= 0 && stateIndex < static_cast<int32_t>(gAtkStateMapLen),
+ "No ATK state for internal state was found");
+ if (stateIndex < 0 || stateIndex >= static_cast<int32_t>(gAtkStateMapLen)) {
+ return;
+ }
+
+ if (gAtkStateMap[stateIndex].atkState != kNone) {
+ MOZ_ASSERT(gAtkStateMap[stateIndex].stateMapEntryType != kNoStateChange,
+ "State changes should not fired for this state");
+
+ if (gAtkStateMap[stateIndex].stateMapEntryType == kMapOpposite) {
+ aEnabled = !aEnabled;
}
+
+ // Fire state change for first state if there is one to map
+ atk_object_notify_state_change(&parent,
+ gAtkStateMap[stateIndex].atkState,
+ aEnabled);
+ }
}
void
diff --git accessible/atk/nsStateMap.h accessible/atk/nsStateMap.h
index 38aad5365a4e..d715d215a953 100644
--- accessible/atk/nsStateMap.h
+++ accessible/atk/nsStateMap.h
@@ -7,6 +7,8 @@
#include <atk/atk.h>
#include "AccessibleWrap.h"
+#include <type_traits>
+
/******************************************************************************
The following accessible states aren't translated, just ignored:
STATE_READONLY: Supported indirectly via EXT_STATE_EDITABLE
@@ -39,7 +41,6 @@ enum EStateMapEntryType {
kMapDirectly,
kMapOpposite, // For example, UNAVAILABLE is the opposite of ENABLED
kNoStateChange, // Don't fire state change event
- kNoSuchState
};
const AtkStateType kNone = ATK_STATE_INVALID;
@@ -47,16 +48,6 @@ const AtkStateType kNone = ATK_STATE_INVALID;
struct AtkStateMap {
AtkStateType atkState;
EStateMapEntryType stateMapEntryType;
-
- static int32_t GetStateIndexFor(uint64_t aState)
- {
- int32_t stateIndex = -1;
- while (aState > 0) {
- ++ stateIndex;
- aState >>= 1;
- }
- return stateIndex; // Returns -1 if not mapped
- }
};
@@ -110,6 +101,10 @@ static const AtkStateMap gAtkStateMap[] = { // Cross Platfor
{ ATK_STATE_SENSITIVE, kMapDirectly }, // states::SENSITIVE = 1 << 45
{ ATK_STATE_EXPANDABLE, kMapDirectly }, // states::EXPANDABLE = 1 << 46
{ kNone, kMapDirectly }, // states::PINNED = 1 << 47
- { ATK_STATE_ACTIVE, kMapDirectly }, // states::CURRENT = 1 << 48
- { kNone, kNoSuchState }, // = 1 << 49
+ { ATK_STATE_ACTIVE, kMapDirectly } // states::CURRENT = 1 << 48
};
+
+static const auto gAtkStateMapLen = std::extent<decltype(gAtkStateMap)>::value;
+
+static_assert(((uint64_t) 0x1) << (gAtkStateMapLen - 1) == mozilla::a11y::states::LAST_ENTRY,
+ "ATK states map is out of sync with internal states");
diff --git accessible/base/States.h accessible/base/States.h
index 786d36076b18..637b08de1231 100644
--- accessible/base/States.h
+++ accessible/base/States.h
@@ -283,6 +283,11 @@ namespace states {
*/
const uint64_t CURRENT = ((uint64_t) 0x1) << 48;
+ /**
+ * Not a real state, used for static assertions.
+ */
+ const uint64_t LAST_ENTRY = CURRENT;
+
} // namespace states
} // namespace a11y
} // namespace mozilla

View File

@ -0,0 +1,186 @@
commit d422b5f2f8bd
Author: Gijs Kruitbosch <gijskruitbosch@gmail.com>
Date: Wed Mar 28 13:48:09 2018 +0100
Bug 1449548. r=mconley, r=aswan, a=RyanVM
--HG--
extra : source : a578a9117c193ecfd6c7abdca5fbb841e46155ab
---
browser/base/content/browser-addons.js | 73 ++++++++++++++++++----------------
browser/base/content/content.js | 4 +-
2 files changed, 41 insertions(+), 36 deletions(-)
diff --git browser/base/content/browser-addons.js browser/base/content/browser-addons.js
index 902011f9f2a0..077626a29ee1 100644
--- browser/base/content/browser-addons.js
+++ browser/base/content/browser-addons.js
@@ -575,6 +575,8 @@ var LightWeightThemeWebInstaller = {
mm.addMessageListener("LightWeightThemeWebInstaller:Install", this);
mm.addMessageListener("LightWeightThemeWebInstaller:Preview", this);
mm.addMessageListener("LightWeightThemeWebInstaller:ResetPreview", this);
+
+ XPCOMUtils.defineLazyPreferenceGetter(this, "_apiTesting", "extensions.webapi.testing", false);
},
receiveMessage(message) {
@@ -587,15 +589,15 @@ var LightWeightThemeWebInstaller = {
switch (message.name) {
case "LightWeightThemeWebInstaller:Install": {
- this._installRequest(data.themeData, data.baseURI);
+ this._installRequest(data.themeData, data.principal, data.baseURI);
break;
}
case "LightWeightThemeWebInstaller:Preview": {
- this._preview(data.themeData, data.baseURI);
+ this._preview(data.themeData, data.principal, data.baseURI);
break;
}
case "LightWeightThemeWebInstaller:ResetPreview": {
- this._resetPreview(data && data.baseURI);
+ this._resetPreview(data && data.principal);
break;
}
}
@@ -617,33 +619,24 @@ var LightWeightThemeWebInstaller = {
return this._manager = temp.LightweightThemeManager;
},
- _installRequest(dataString, baseURI) {
+ _installRequest(dataString, principal, baseURI) {
+ // Don't allow installing off null principals.
+ if (!principal.URI) {
+ return;
+ }
+
let data = this._manager.parseTheme(dataString, baseURI);
if (!data) {
return;
}
- let uri = makeURI(baseURI);
-
// A notification bar with the option to undo is normally shown after a
// theme is installed. But the discovery pane served from the url(s)
// below has its own toggle switch for quick undos, so don't show the
// notification in that case.
- let notify = uri.prePath != "https://discovery.addons.mozilla.org";
- if (notify) {
- try {
- if (Services.prefs.getBoolPref("extensions.webapi.testing")
- && (uri.prePath == "https://discovery.addons.allizom.org"
- || uri.prePath == "https://discovery.addons-dev.allizom.org")) {
- notify = false;
- }
- } catch (e) {
- // getBoolPref() throws if the testing pref isn't set. ignore it.
- }
- }
-
- if (this._isAllowed(baseURI)) {
+ let notify = this._shouldShowUndoPrompt(principal);
+ if (this._isAllowed(principal)) {
this._install(data, notify);
return;
}
@@ -652,7 +645,7 @@ var LightWeightThemeWebInstaller = {
header: gNavigatorBundle.getFormattedString("webextPerms.header", ["<>"]),
addonName: data.name,
text: gNavigatorBundle.getFormattedString("lwthemeInstallRequest.message2",
- [uri.host]),
+ [principal.URI.host]),
acceptText: gNavigatorBundle.getString("lwthemeInstallRequest.allowButton2"),
acceptKey: gNavigatorBundle.getString("lwthemeInstallRequest.allowButton.accesskey2"),
cancelText: gNavigatorBundle.getString("webextPerms.cancel.label"),
@@ -706,8 +699,8 @@ var LightWeightThemeWebInstaller = {
AddonManager.removeAddonListener(listener);
},
- _preview(dataString, baseURI) {
- if (!this._isAllowed(baseURI))
+ _preview(dataString, principal, baseURI) {
+ if (!this._isAllowed(principal))
return;
let data = this._manager.parseTheme(dataString, baseURI);
@@ -719,27 +712,37 @@ var LightWeightThemeWebInstaller = {
this._manager.previewTheme(data);
},
- _resetPreview(baseURI) {
- if (baseURI && !this._isAllowed(baseURI))
+ _resetPreview(principal) {
+ if (!this._isAllowed(principal))
return;
gBrowser.tabContainer.removeEventListener("TabSelect", this);
this._manager.resetPreview();
},
- _isAllowed(srcURIString) {
- let uri;
- try {
- uri = makeURI(srcURIString);
- } catch (e) {
- // makeURI fails if srcURIString is a nonsense URI
+ _isAllowed(principal) {
+ if (!principal || !principal.URI || !principal.URI.schemeIs("https")) {
+ return false;
+ }
+
+ let pm = Services.perms;
+ return pm.testPermission(principal.URI, "install") == pm.ALLOW_ACTION;
+ },
+
+ _shouldShowUndoPrompt(principal) {
+ if (!principal || !principal.URI) {
+ return true;
+ }
+
+ let prePath = principal.URI.prePath;
+ if (prePath == "https://discovery.addons.mozilla.org") {
return false;
}
- if (!uri.schemeIs("https")) {
+ if (this._apiTesting && (prePath == "https://discovery.addons.allizom.org" ||
+ prePath == "https://discovery.addons-dev.allizom.org")) {
return false;
}
+ return true;
+ },
- let pm = Services.perms;
- return pm.testPermission(uri, "install") == pm.ALLOW_ACTION;
- }
};
diff --git browser/base/content/content.js browser/base/content/content.js
index 8b3f6af14783..08fe4ba2efe3 100644
--- browser/base/content/content.js
+++ browser/base/content/content.js
@@ -749,6 +749,7 @@ var LightWeightThemeWebInstallListener = {
case "InstallBrowserTheme": {
sendAsyncMessage("LightWeightThemeWebInstaller:Install", {
baseURI: event.target.baseURI,
+ principal: event.target.nodePrincipal,
themeData: event.target.getAttribute("data-browsertheme"),
});
break;
@@ -756,6 +757,7 @@ var LightWeightThemeWebInstallListener = {
case "PreviewBrowserTheme": {
sendAsyncMessage("LightWeightThemeWebInstaller:Preview", {
baseURI: event.target.baseURI,
+ principal: event.target.nodePrincipal,
themeData: event.target.getAttribute("data-browsertheme"),
});
this._previewWindow = event.target.ownerGlobal;
@@ -770,7 +772,7 @@ var LightWeightThemeWebInstallListener = {
case "ResetBrowserThemePreview": {
if (this._previewWindow) {
sendAsyncMessage("LightWeightThemeWebInstaller:ResetPreview",
- {baseURI: event.target.baseURI});
+ {principal: event.target.nodePrincipal});
this._resetPreviewWindow();
}
break;