Bug 1386337 - Disable Photon page actions when Photon is not enabled. r?Gijs
MozReview-Commit-ID: 3GrsscIxeyW
--- a/browser/base/content/browser-pageActions.js
+++ b/browser/base/content/browser-pageActions.js
@@ -42,16 +42,19 @@ var BrowserPageActions = {
delete this.mainViewBodyNode;
return this.mainViewBodyNode = this.mainViewNode.querySelector(".panel-subview-body");
},
/**
* Inits. Call to init.
*/
init() {
+ if (!AppConstants.MOZ_PHOTON_THEME) {
+ return;
+ }
for (let action of PageActions.actions) {
this.placeAction(action, PageActions.insertBeforeActionIDInUrlbar(action));
}
},
/**
* Adds or removes as necessary DOM nodes for the given action.
*
--- a/browser/modules/PageActions.jsm
+++ b/browser/modules/PageActions.jsm
@@ -13,31 +13,37 @@ this.EXPORTED_SYMBOLS = [
// PageActions.ACTION_ID_BUILT_IN_SEPARATOR
];
const { utils: Cu } = Components;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
+ "resource://gre/modules/AppConstants.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "BinarySearch",
"resource://gre/modules/BinarySearch.jsm");
const ACTION_ID_BOOKMARK_SEPARATOR = "bookmarkSeparator";
const ACTION_ID_BUILT_IN_SEPARATOR = "builtInSeparator";
const PREF_PERSISTED_ACTIONS = "browser.pageActions.persistedActions";
this.PageActions = {
/**
* Inits. Call to init.
*/
init() {
+ if (!AppConstants.MOZ_PHOTON_THEME) {
+ return;
+ }
+
let callbacks = this._deferredAddActionCalls;
delete this._deferredAddActionCalls;
this._loadPersistedActions();
// Add the built-in actions, which are defined below in this file.
for (let options of gBuiltInActions) {
if (options._isSeparator || !this.actionForID(options.id)) {
--- a/browser/modules/test/browser/browser.ini
+++ b/browser/modules/test/browser/browser.ini
@@ -14,16 +14,17 @@ skip-if = !e10s # Bug 1373549
support-files =
contentSearch.js
contentSearchBadImage.xml
contentSearchSuggestions.sjs
contentSearchSuggestions.xml
!/browser/components/search/test/head.js
!/browser/components/search/test/testEngine.xml
[browser_PageActions.js]
+run-if = nightly_build # Photon only
[browser_PermissionUI.js]
[browser_PermissionUI_prompts.js]
[browser_ProcessHangNotifications.js]
skip-if = !e10s
[browser_SitePermissions.js]
[browser_SitePermissions_combinations.js]
[browser_SitePermissions_expiry.js]
[browser_SitePermissions_tab_urls.js]