Merge mozilla-central to inbound. a=merge CLOSED TREE

This commit is contained in:
Tiberius Oros 2018-03-16 11:59:14 +02:00
commit baf9f48740
522 changed files with 133139 additions and 5529 deletions

View File

@ -142,7 +142,6 @@ devtools/client/webaudioeditor/**
devtools/client/webconsole/net/**
!devtools/client/webconsole/new-console-output/test/mochitest/**
devtools/client/webconsole/test/**
devtools/client/webconsole/webconsole-connection-proxy.js
devtools/client/webconsole/webconsole.js
devtools/client/webide/**
!devtools/client/webide/components/webideCli.js

View File

@ -44,16 +44,16 @@
<command id="View:FullScreen" oncommand="BrowserFullScreen();"/>
<command id="View:ReaderView" oncommand="ReaderParent.toggleReaderMode(event);"/>
<command id="cmd_find"
oncommand="gFindBar.onFindCommand();"
oncommand="gLazyFindCommand('onFindCommand')"
observes="isImage"/>
<command id="cmd_findAgain"
oncommand="gFindBar.onFindAgainCommand(false);"
oncommand="gLazyFindCommand('onFindAgainCommand', false)"
observes="isImage"/>
<command id="cmd_findPrevious"
oncommand="gFindBar.onFindAgainCommand(true);"
oncommand="gLazyFindCommand('onFindAgainCommand', true)"
observes="isImage"/>
#ifdef XP_MACOSX
<command id="cmd_findSelection" oncommand="gFindBar.onFindSelectionCommand();"/>
<command id="cmd_findSelection" oncommand="gLazyFindCommand('onFindSelectionCommand')"/>
#endif
<!-- work-around bug 392512 -->
<command id="Browser:AddBookmarkAs"
@ -116,12 +116,7 @@
#endif
</commandset>
<commandset id="placesCommands">
<command id="Browser:ShowAllBookmarks"
oncommand="PlacesCommandHook.showPlacesOrganizer('UnfiledBookmarks');"/>
<command id="Browser:ShowAllHistory"
oncommand="PlacesCommandHook.showPlacesOrganizer('History');"/>
</commandset>
#include ../../components/places/content/placesCommands.inc.xul
<broadcasterset id="mainBroadcasterSet">
<broadcaster id="viewBookmarksSidebar" autoCheck="false" label="&bookmarksButton.label;"

View File

@ -266,7 +266,7 @@ Object.defineProperty(this, "gFindBar", {
configurable: true,
enumerable: true,
get() {
return window.gBrowser.getFindBar();
return gBrowser.getCachedFindBar();
},
});
@ -274,10 +274,26 @@ Object.defineProperty(this, "gFindBarInitialized", {
configurable: true,
enumerable: true,
get() {
return window.gBrowser.isFindBarInitialized();
return gBrowser.isFindBarInitialized();
},
});
Object.defineProperty(this, "gFindBarPromise", {
configurable: true,
enumerable: true,
get() {
return gBrowser.getFindBar();
},
});
async function gLazyFindCommand(cmd, ...args) {
let fb = await gFindBarPromise;
// We could be closed by now, or the tab with XBL binding could have gone away:
if (fb && fb[cmd]) {
fb[cmd].apply(fb, args);
}
}
Object.defineProperty(this, "AddonManager", {
configurable: true,
enumerable: true,
@ -1174,14 +1190,7 @@ function RedirectLoad({ target: browser, data }) {
}
if (document.documentElement.getAttribute("windowtype") == "navigator:browser") {
window.addEventListener("MozBeforeInitialXULLayout", () => {
gBrowserInit.onBeforeInitialXULLayout();
}, { once: true });
// The listener of DOMContentLoaded must be set on window, rather than
// document, because the window can go away before the event is fired.
// In that case, we don't want to initialize anything, otherwise we
// may be leaking things because they will never be destroyed after.
window.addEventListener("DOMContentLoaded", () => {
addEventListener("DOMContentLoaded", function() {
gBrowserInit.onDOMContentLoaded();
}, { once: true });
}
@ -1194,27 +1203,6 @@ var delayedStartupPromise = new Promise(resolve => {
var gBrowserInit = {
delayedStartupFinished: false,
onBeforeInitialXULLayout() {
// Set a sane starting width/height for all resolutions on new profiles.
if (Services.prefs.getBoolPref("privacy.resistFingerprinting")) {
// When the fingerprinting resistance is enabled, making sure that we don't
// have a maximum window to interfere with generating rounded window dimensions.
document.documentElement.setAttribute("sizemode", "normal");
} else if (!document.documentElement.hasAttribute("width")) {
const TARGET_WIDTH = 1280;
const TARGET_HEIGHT = 1040;
let width = Math.min(screen.availWidth * .9, TARGET_WIDTH);
let height = Math.min(screen.availHeight * .9, TARGET_HEIGHT);
document.documentElement.setAttribute("width", width);
document.documentElement.setAttribute("height", height);
if (width < TARGET_WIDTH && height < TARGET_HEIGHT) {
document.documentElement.setAttribute("sizemode", "maximized");
}
}
},
onDOMContentLoaded() {
gBrowser = window._gBrowser;
delete window._gBrowser;
@ -1258,6 +1246,25 @@ var gBrowserInit = {
initBrowser.removeAttribute("blank");
}
// Set a sane starting width/height for all resolutions on new profiles.
if (Services.prefs.getBoolPref("privacy.resistFingerprinting")) {
// When the fingerprinting resistance is enabled, making sure that we don't
// have a maximum window to interfere with generating rounded window dimensions.
document.documentElement.setAttribute("sizemode", "normal");
} else if (!document.documentElement.hasAttribute("width")) {
const TARGET_WIDTH = 1280;
const TARGET_HEIGHT = 1040;
let width = Math.min(screen.availWidth * .9, TARGET_WIDTH);
let height = Math.min(screen.availHeight * .9, TARGET_HEIGHT);
document.documentElement.setAttribute("width", width);
document.documentElement.setAttribute("height", height);
if (width < TARGET_WIDTH && height < TARGET_HEIGHT) {
document.documentElement.setAttribute("sizemode", "maximized");
}
}
gBrowser.updateBrowserRemoteness(initBrowser, isRemote, {
remoteType, sameProcessAsFrameLoader
});
@ -2069,7 +2076,7 @@ function HandleAppCommandEvent(evt) {
BrowserCloseTabOrWindow();
break;
case "Find":
gFindBar.onFindCommand();
gLazyFindCommand("onFindCommand");
break;
case "Help":
openHelpLink("firefox-help");
@ -3517,7 +3524,7 @@ var PrintPreviewListener = {
gBrowser.getNotificationBox().notificationsHidden = false;
if (this._chromeState.findOpen)
gFindBar.open();
gLazyFindCommand("open");
if (this._chromeState.globalNotificationsOpen)
document.getElementById("global-notificationbox").notificationsHidden = false;

View File

@ -16,8 +16,6 @@
<?xml-stylesheet href="chrome://browser/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://browser/content/tabbrowser.css" type="text/css"?>
<?xul-overlay href="chrome://browser/content/places/placesOverlay.xul"?>
# All DTD information is stored in a separate file so that it can be shared by
# hiddenWindow.xul.
#include browser-doctype.inc
@ -68,6 +66,20 @@
<script type="application/javascript">
Services.scriptloader.loadSubScript("chrome://global/content/contentAreaUtils.js", this);
Services.scriptloader.loadSubScript("chrome://browser/content/tabbrowser.js", this);
ChromeUtils.defineModuleGetter(window,
"PlacesUtils", "resource://gre/modules/PlacesUtils.jsm");
ChromeUtils.defineModuleGetter(window,
"PlacesUIUtils", "resource:///modules/PlacesUIUtils.jsm");
ChromeUtils.defineModuleGetter(window,
"PlacesTransactions", "resource://gre/modules/PlacesTransactions.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyScriptGetter(window, "PlacesTreeView",
"chrome://browser/content/places/treeView.js");
XPCOMUtils.defineLazyScriptGetter(window,
["PlacesInsertionPoint", "PlacesController", "PlacesControllerDragHelper"],
"chrome://browser/content/places/controller.js");
</script>
# All sets except for popupsets (commands, keys, stringbundles and broadcasters) *must* go into the
@ -395,7 +407,7 @@
#include browser-context.inc
</menupopup>
<menupopup id="placesContext"/>
#include ../../components/places/content/placesContextMenu.inc.xul
<panel id="ctrlTab-panel" hidden="true" norestorefocus="true" level="top">
<hbox>
@ -472,8 +484,7 @@
oncommand="BrowserPageActions.openAboutAddonsForContextAction();"/>
</menupopup>
<!-- Bookmarks and history tooltip -->
<tooltip id="bhTooltip"/>
#include ../../components/places/content/bookmarksHistoryTooltip.inc.xul
<tooltip id="tabbrowser-tab-tooltip" onpopupshowing="gBrowser.createTooltip(event);"/>

View File

@ -23,6 +23,9 @@ for (let script of [
"chrome://browser/content/browser-sidebar.js",
"chrome://browser/content/browser-tabsintitlebar.js",
"chrome://browser/content/browser-trackingprotection.js",
"chrome://global/content/globalOverlay.js",
"chrome://browser/content/utilityOverlay.js",
#ifdef XP_MACOSX
"chrome://global/content/macWindowMenu.js",
#endif

View File

@ -10,8 +10,6 @@
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://browser/content/places/places.css" type="text/css"?>
<?xul-overlay href="chrome://browser/content/places/placesOverlay.xul"?>
# All DTD information is stored in a separate file so that it can be shared by
# hiddenWindow.xul.
#include browser-doctype.inc
@ -40,6 +38,20 @@
addEventListener("load", function() { gBrowserInit.nonBrowserWindowStartup() }, false);
addEventListener("unload", function() { gBrowserInit.nonBrowserWindowShutdown() }, false);
ChromeUtils.defineModuleGetter(window,
"PlacesUtils", "resource://gre/modules/PlacesUtils.jsm");
ChromeUtils.defineModuleGetter(window,
"PlacesUIUtils", "resource:///modules/PlacesUIUtils.jsm");
ChromeUtils.defineModuleGetter(window,
"PlacesTransactions", "resource://gre/modules/PlacesTransactions.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyScriptGetter(window, "PlacesTreeView",
"chrome://browser/content/places/treeView.js");
XPCOMUtils.defineLazyScriptGetter(window,
["PlacesInsertionPoint", "PlacesController", "PlacesControllerDragHelper"],
"chrome://browser/content/places/controller.js");
</script>
# All sets except for popupsets (commands, keys, stringbundles and broadcasters) *must* go into the

View File

@ -113,13 +113,6 @@ window._gBrowser = {
*/
_tabForBrowser: new WeakMap(),
/**
* Holds a unique ID for the tab change that's currently being timed.
* Used to make sure that multiple, rapid tab switches do not try to
* create overlapping timers.
*/
_tabSwitchID: null,
_preloadedBrowser: null,
/**
@ -484,20 +477,54 @@ window._gBrowser = {
return (aTab || this.selectedTab)._findBar != undefined;
},
getFindBar(aTab) {
if (!aTab)
aTab = this.selectedTab;
/**
* Get the already constructed findbar
*/
getCachedFindBar(aTab = this.selectedTab) {
return aTab._findBar;
},
if (aTab._findBar)
return aTab._findBar;
/**
* Get the findbar, and create it if it doesn't exist.
* @return the find bar (or null if the window or tab is closed/closing in the interim).
*/
async getFindBar(aTab = this.selectedTab) {
let findBar = this.getCachedFindBar(aTab);
if (findBar) {
return findBar;
}
// Avoid re-entrancy by caching the promise we're about to return.
if (!aTab._pendingFindBar) {
aTab._pendingFindBar = this._createFindBar(aTab);
}
return aTab._pendingFindBar;
},
/**
* Create a findbar instance.
* @param aTab the tab to create the find bar for.
* @param aForce Whether to force a sync flush to trigger XBL construction immediately.
* @return the created findbar, or null if the window or tab is closed/closing.
*/
async _createFindBar(aTab, aForce = false) {
let findBar = document.createElementNS(this._XUL_NS, "findbar");
let browser = this.getBrowserForTab(aTab);
let browserContainer = this.getBrowserContainer(browser);
browserContainer.appendChild(findBar);
// Force a style flush to ensure that our binding is attached.
findBar.clientTop;
if (aForce) {
// Force a style flush to ensure that our binding is attached.
// Remove after bug 1371523 makes more of this async.
findBar.clientTop;
} else {
await new Promise(r => requestAnimationFrame(r));
if (window.closed || aTab.closing) {
delete aTab._pendingFindBar;
return null;
}
}
delete aTab._pendingFindBar;
findBar.browser = browser;
findBar._findField.value = this._lastFindValue;
@ -586,7 +613,7 @@ window._gBrowser = {
anim instanceof CSSAnimation &&
(anim.animationName === "tab-throbber-animation" ||
anim.animationName === "tab-throbber-animation-rtl") &&
(anim.playState === "running" || anim.playState === "pending"));
anim.playState === "running");
// Synchronize with the oldest running animation, if any.
const firstStartTime = Math.min(
@ -905,29 +932,6 @@ window._gBrowser = {
document.commandDispatcher.lock();
TelemetryStopwatch.start("FX_TAB_SWITCH_UPDATE_MS");
if (!gMultiProcessBrowser) {
// old way of measuring tab paint which is not valid with e10s.
// Waiting until the next MozAfterPaint ensures that we capture
// the time it takes to paint, upload the textures to the compositor,
// and then composite.
if (this._tabSwitchID) {
TelemetryStopwatch.cancel("FX_TAB_SWITCH_TOTAL_MS");
}
let tabSwitchID = Symbol();
TelemetryStopwatch.start("FX_TAB_SWITCH_TOTAL_MS");
this._tabSwitchID = tabSwitchID;
let onMozAfterPaint = () => {
if (this._tabSwitchID === tabSwitchID) {
TelemetryStopwatch.finish("FX_TAB_SWITCH_TOTAL_MS");
this._tabSwitchID = null;
}
window.removeEventListener("MozAfterPaint", onMozAfterPaint);
};
window.addEventListener("MozAfterPaint", onMozAfterPaint);
}
}
let oldTab = this.selectedTab;
@ -1127,7 +1131,7 @@ window._gBrowser = {
oldBrowser._urlbarFocused = (gURLBar && gURLBar.focused);
if (this.isFindBarInitialized(oldTab)) {
let findBar = this.getFindBar(oldTab);
let findBar = this.getCachedFindBar(oldTab);
oldTab._findBarFocused = (!findBar.hidden &&
findBar._findField.getAttribute("focused") == "true");
}
@ -1702,7 +1706,7 @@ window._gBrowser = {
// If the findbar has been initialised, reset its browser reference.
if (this.isFindBarInitialized(tab)) {
this.getFindBar(tab).browser = aBrowser;
this.getCachedFindBar(tab).browser = aBrowser;
}
evt = document.createEvent("Events");
@ -3111,10 +3115,17 @@ window._gBrowser = {
let otherFindBar = aOtherTab._findBar;
if (otherFindBar &&
otherFindBar.findMode == otherFindBar.FIND_NORMAL) {
let ourFindBar = this.getFindBar(aOurTab);
ourFindBar._findField.value = otherFindBar._findField.value;
if (!otherFindBar.hidden)
ourFindBar.onFindCommand();
let oldValue = otherFindBar._findField.value;
let wasHidden = otherFindBar.hidden;
let ourFindBarPromise = this.getFindBar(aOurTab);
ourFindBarPromise.then(ourFindBar => {
if (!ourFindBar) {
return;
}
ourFindBar._findField.value = oldValue;
if (!wasHidden)
ourFindBar.onFindCommand();
});
}
// Finish tearing down the tab that's going away.
@ -3821,7 +3832,13 @@ window._gBrowser = {
}
if (shouldFastFind) {
// Make sure we return the result.
return this.getFindBar(tab).receiveMessage(aMessage);
// This needs sync initialization of the find bar, unfortunately.
// bug 1371523 tracks removing all of this.
// This returns a promise, so don't use the result...
this._createFindBar(tab, true);
// ... just grab the 'cached' version now we know it exists.
this.getCachedFindBar().receiveMessage(aMessage);
}
}
break;
@ -4519,7 +4536,7 @@ class TabProgressListener {
}
if (gBrowser.isFindBarInitialized(this.mTab)) {
let findBar = gBrowser.getFindBar(this.mTab);
let findBar = gBrowser.getCachedFindBar(this.mTab);
// Close the Find toolbar if we're in old-style TAF mode
if (findBar.findMode != findBar.FIND_NORMAL) {

View File

@ -42,19 +42,21 @@ function test() {
// Set up the first tab
gBrowser.selectedTab = tabs[0];
gBrowser.getFindBar().then(initialTest);
}
function initialTest() {
setFindString(texts[0]);
// Turn on highlight for testing bug 891638
gFindBar.getElement("highlight").checked = true;
// Make sure the second tab is correct, then set it up
gBrowser.selectedTab = tabs[1];
gBrowser.selectedTab.addEventListener("TabFindInitialized", continueTests1);
gBrowser.selectedTab.addEventListener("TabFindInitialized", continueTests1, {once: true});
// Initialize the findbar
gFindBar;
gBrowser.getFindBar();
}
function continueTests1() {
gBrowser.selectedTab.removeEventListener("TabFindInitialized",
continueTests1);
ok(true, "'TabFindInitialized' event properly dispatched!");
ok(gFindBar.hidden, "Second tab doesn't show find bar!");
gFindBar.open();
@ -97,6 +99,11 @@ function continueTests3() {
// Set up a third tab, no tests here
gBrowser.selectedTab = tabs[2];
gBrowser.selectedTab.addEventListener("TabFindInitialized", continueTests4, {once: true});
gBrowser.getFindBar();
}
function continueTests4() {
setFindString(texts[2]);
// Now we jump to the second, then first, and then fourth

View File

@ -21,7 +21,7 @@ add_task(async function() {
await SimpleTest.promiseFocus(newwindow);
ok(!newwindow.gFindBarInitialized, "find bar is not yet initialized");
let findBar = newwindow.gFindBar;
let findBar = await newwindow.gFindBarPromise;
await ContentTask.spawn(selectedBrowser, { }, async function() {
let elt = content.document.getElementById("h1");

View File

@ -6,24 +6,25 @@
const DUMMY_PAGE = "http://example.org/browser/browser/base/content/test/general/dummy_page.html";
function test() {
waitForExplicitFinish();
/**
* This test checks that if you search for something on one tab, then close
* that tab and have the find bar open on the next tab you get switched to,
* closing the find bar in that tab works without exceptions.
*/
add_task(async function test_bug749738() {
// Open find bar on initial tab.
await gFindBarPromise;
let tab = BrowserTestUtils.addTab(gBrowser);
gBrowser.selectedTab = tab;
BrowserTestUtils.loadURI(tab.linkedBrowser, DUMMY_PAGE);
BrowserTestUtils.browserLoaded(tab.linkedBrowser).then(() => {
await BrowserTestUtils.withNewTab(DUMMY_PAGE, async function() {
await gFindBarPromise;
gFindBar.onFindCommand();
EventUtils.sendString("Dummy");
gBrowser.removeTab(tab);
try {
gFindBar.close();
ok(true, "findbar.close should not throw an exception");
} catch (e) {
ok(false, "findbar.close threw exception: " + e);
}
finish();
});
}
try {
gFindBar.close();
ok(true, "findbar.close should not throw an exception");
} catch (e) {
ok(false, "findbar.close threw exception: " + e);
}
});

View File

@ -16,6 +16,7 @@ add_task(async function findbar_test() {
"browser/base/content/test/general/test_bug628179.html");
await promise;
await gFindBarPromise;
gFindBar.open();
await new ContentTask.spawn(newTab.linkedBrowser, null, async function() {

View File

@ -2,79 +2,60 @@
* http://creativecommons.org/publicdomain/zero/1.0/
*/
var gTab = null;
function load(url, cb) {
gTab = BrowserTestUtils.addTab(gBrowser, url);
gBrowser.addEventListener("load", function listener(event) {
if (event.target.location != url)
return;
gBrowser.removeEventListener("load", listener, true);
// Trigger onLocationChange by switching tabs.
gBrowser.selectedTab = gTab;
cb();
}, true);
}
function test() {
waitForExplicitFinish();
ok(gFindBar.hidden, "Find bar should not be visible by default");
add_task(async function findBarDisabledOnSomePages() {
ok(!gFindBar || gFindBar.hidden, "Find bar should not be visible by default");
let findbarOpenedPromise = BrowserTestUtils.waitForEvent(gBrowser.selectedTab, "TabFindInitialized");
document.documentElement.focus();
// Open the Find bar before we navigate to pages that shouldn't have it.
EventUtils.synthesizeKey("f", { accelKey: true });
await findbarOpenedPromise;
ok(!gFindBar.hidden, "Find bar should be visible");
nextTest();
}
let urls = [
"about:config",
"about:addons",
];
var urls = [
"about:config",
"about:addons",
];
function nextTest() {
let url = urls.shift();
if (url) {
testFindDisabled(url, nextTest);
} else {
// Make sure the find bar is re-enabled after disabled page is closed.
testFindEnabled("about:blank", function() {
EventUtils.synthesizeKey("KEY_Escape");
ok(gFindBar.hidden, "Find bar should now be hidden");
finish();
});
for (let url of urls) {
await testFindDisabled(url);
}
}
function testFindDisabled(url, cb) {
load(url, function() {
ok(gFindBar.hidden, "Find bar should not be visible");
EventUtils.synthesizeKey("/", {}, gTab.linkedBrowser.contentWindow);
ok(gFindBar.hidden, "Find bar should not be visible");
// Make sure the find bar is re-enabled after disabled page is closed.
await testFindEnabled("about:about");
gFindBar.close();
ok(gFindBar.hidden, "Find bar should now be hidden");
});
function testFindDisabled(url) {
return BrowserTestUtils.withNewTab(url, async function(browser) {
let waitForFindBar = async () => {
await new Promise(r => requestAnimationFrame(r));
await new Promise(r => Services.tm.dispatchToMainThread(r));
};
ok(!gFindBar || gFindBar.hidden, "Find bar should not be visible at the start");
await BrowserTestUtils.synthesizeKey("/", {}, browser);
await waitForFindBar();
ok(!gFindBar || gFindBar.hidden, "Find bar should not be visible after fast find");
EventUtils.synthesizeKey("f", {accelKey: true});
ok(gFindBar.hidden, "Find bar should not be visible");
await waitForFindBar();
ok(!gFindBar || gFindBar.hidden, "Find bar should not be visible after find command");
ok(document.getElementById("cmd_find").getAttribute("disabled"),
"Find command should be disabled");
gBrowser.removeTab(gTab);
cb();
});
}
function testFindEnabled(url, cb) {
load(url, function() {
async function testFindEnabled(url) {
return BrowserTestUtils.withNewTab(url, async function(browser) {
ok(!document.getElementById("cmd_find").getAttribute("disabled"),
"Find command should not be disabled");
// Open Find bar and then close it.
let findbarOpenedPromise = BrowserTestUtils.waitForEvent(gBrowser.selectedTab, "TabFindInitialized");
EventUtils.synthesizeKey("f", { accelKey: true });
await findbarOpenedPromise;
ok(!gFindBar.hidden, "Find bar should be visible again");
EventUtils.synthesizeKey("KEY_Escape");
ok(gFindBar.hidden, "Find bar should now be hidden");
gBrowser.removeTab(gTab);
cb();
});
}

View File

@ -22,16 +22,16 @@ add_task(async function() {
let frame = frames[i], previousFrame = frames[i - 1];
let rects = compareFrames(frame, previousFrame);
// The first screenshot we get in OSX / Windows shows an unfocused browser
// window for some reason. See bug 1445161.
//
// The first screenshot we get shows an unfocused browser window for some
// reason. This is likely due to the test harness, so we want to ignore it.
// We'll assume the changes we are seeing are due to this focus change if
// there are at least 5 areas that changed near the top of the screen, but
// will only ignore this once (hence the alreadyFocused variable).
if (!alreadyFocused && rects.length > 5 && rects.every(r => r.y2 < 100)) {
alreadyFocused = true;
// This is likely an issue caused by the test harness, but log it anyway.
todo(false,
"bug 1445161 - the window should be focused at first paint, " + rects.toSource());
"the window should be focused at first paint, " + rects.toSource());
continue;
}

View File

@ -61,7 +61,6 @@ const whitelist = [
{
file: "chrome://browser/skin/chevron.svg",
platforms: ["win", "linux", "macosx"],
intermittentShown: ["win"],
},
{

View File

@ -71,25 +71,17 @@ add_task(async function() {
win.removeEventListener("MozAfterPaint", afterPaintListener);
let unexpectedRects = 0;
let alreadyFocused = false;
let ignoreTinyPaint = true;
for (let i = 1; i < frames.length; ++i) {
let frame = frames[i], previousFrame = frames[i - 1];
let rects = compareFrames(frame, previousFrame);
// The first screenshot we get in OSX / Windows shows an unfocused browser
// window for some reason. See bug 1445161.
//
// We'll assume the changes we are seeing are due to this focus change if
// there are at least 5 areas that changed near the top of the screen, but
// will only ignore this once (hence the alreadyFocused variable).
if (!alreadyFocused && rects.length > 5 && rects.every(r => r.y2 < 100)) {
alreadyFocused = true;
todo(false,
"bug 1445161 - the window should be focused at first paint, " + rects.toSource());
if (ignoreTinyPaint &&
previousFrame.width == 1 && previousFrame.height == 1) {
todo(false, "shouldn't initially paint a 1x1px window");
continue;
}
rects = rects.filter(rect => {
ignoreTinyPaint = false;
let rects = compareFrames(frame, previousFrame).filter(rect => {
let inRange = (val, min, max) => min <= val && val <= max;
let width = frame.width;

View File

@ -62,8 +62,12 @@ add_task(async function() {
let win = OpenBrowserWindow();
await withReflowObserver(async function() {
await TestUtils.topicObserved("browser-delayed-startup-finished",
subject => subject == win);
let resizeEvent = BrowserTestUtils.waitForEvent(win, "resize");
let delayedStartup =
TestUtils.topicObserved("browser-delayed-startup-finished",
subject => subject == win);
await resizeEvent;
await delayedStartup;
}, EXPECTED_REFLOWS, win);
await BrowserTestUtils.closeWindow(win);

View File

@ -32,12 +32,6 @@ add_task(async function() {
// Prime the content process
await promiseTabLoadEvent(gBrowser.selectedTab, "data:text/html,<html>hi</html>");
// Make sure the blocklist service(s) are running
// eslint-disable-next-line no-unused-expressions
Services.blocklist;
let exmsg = await promiseInitContentBlocklistSvc(gBrowser.selectedBrowser);
ok(!exmsg, "exception: " + exmsg);
});
// Tests a vulnerable, updatable plugin

View File

@ -29,8 +29,6 @@ add_task(async function() {
// Prime the blocklist service, the remote service doesn't launch on startup.
await promiseTabLoadEvent(gBrowser.selectedTab, "data:text/html,<html></html>");
let exmsg = await promiseInitContentBlocklistSvc(gBrowser.selectedBrowser);
ok(!exmsg, "exception: " + exmsg);
});
add_task(async function() {

View File

@ -29,9 +29,6 @@ add_task(async function() {
// Prime the blocklist service, the remote service doesn't launch on startup.
await promiseTabLoadEvent(gBrowser.selectedTab, "data:text/html,<html></html>");
let exmsg = await promiseInitContentBlocklistSvc(gBrowser.selectedBrowser);
ok(!exmsg, "exception: " + exmsg);
await asyncSetAndUpdateBlocklist(gTestRoot + "blockNoPlugins.xml", gTestBrowser);
});

View File

@ -21,8 +21,6 @@ add_task(async function() {
// Prime the blocklist service, the remote service doesn't launch on startup.
await promiseTabLoadEvent(gBrowser.selectedTab, "data:text/html,<html></html>");
let exmsg = await promiseInitContentBlocklistSvc(gBrowser.selectedBrowser);
ok(!exmsg, "exception: " + exmsg);
});
// Tests that the going back will reshow the notification for click-to-play

View File

@ -32,8 +32,6 @@ add_task(async function() {
// Prime the blocklist service, the remote service doesn't launch on startup.
await promiseTabLoadEvent(gBrowser.selectedTab, "data:text/html,<html></html>");
let exmsg = await promiseInitContentBlocklistSvc(gBrowser.selectedBrowser);
ok(!exmsg, "exception: " + exmsg);
await asyncSetAndUpdateBlocklist(gTestRoot + "blockNoPlugins.xml", gTestBrowser);
});

View File

@ -32,8 +32,6 @@ add_task(async function() {
// Prime the blocklist service, the remote service doesn't launch on startup.
await promiseTabLoadEvent(gBrowser.selectedTab, "data:text/html,<html></html>");
let exmsg = await promiseInitContentBlocklistSvc(gBrowser.selectedBrowser);
ok(!exmsg, "exception: " + exmsg);
await asyncSetAndUpdateBlocklist(gTestRoot + "blockNoPlugins.xml", gTestBrowser);
});

View File

@ -9,22 +9,6 @@ ChromeUtils.defineModuleGetter(this, "PromiseUtils",
// default browser under test in some of the functions below.
/* global gTestBrowser */
// The blocklist shim running in the content process does not initialize at
// start up, so it's not active until we load content that needs to do a
// check. This helper bypasses the delay to get the svc up and running
// immediately. Note, call this after remote content has loaded.
function promiseInitContentBlocklistSvc(aBrowser) {
return ContentTask.spawn(aBrowser, {}, async function() {
try {
// eslint-disable-next-line no-unused-expressions
Services.blocklist;
} catch (ex) {
return ex.message;
}
return null;
});
}
/**
* Waits a specified number of miliseconds.
*
@ -237,10 +221,6 @@ async function asyncSetAndUpdateBlocklist(aURL, aBrowser) {
}
Services.prefs.setCharPref("extensions.blocklist.url", aURL);
let localPromise = TestUtils.topicObserved("blocklist-updated");
let remotePromise;
if (doTestRemote) {
remotePromise = TestUtils.topicObserved("content-blocklist-updated");
}
let blocklistNotifier = Cc["@mozilla.org/extensions/blocklist;1"]
.getService(Ci.nsITimerCallback);
blocklistNotifier.notify(null);
@ -248,7 +228,8 @@ async function asyncSetAndUpdateBlocklist(aURL, aBrowser) {
await localPromise;
if (doTestRemote) {
info("*** waiting on remote load");
await remotePromise;
// Ensure content has been updated with the blocklist
await ContentTask.spawn(aBrowser, null, () => {});
}
info("*** blocklist loaded.");
}

View File

@ -22,6 +22,7 @@ add_task(async function test() {
// Sanitize now so we can test the baseline point.
await Sanitizer.sanitize(["formdata"]);
await gFindBarPromise;
ok(!gFindBar.hasTransactions, "pre-test baseline for sanitizer");
gFindBar.getElement("findbar-textbox").value = "m";

View File

@ -7,7 +7,9 @@
ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
ChromeUtils.defineModuleGetter(this, "PrivateBrowsingUtils",
"resource://gre/modules/PrivateBrowsingUtils.jsm");
ChromeUtils.defineModuleGetter(this, "RecentWindow",
"resource:///modules/RecentWindow.jsm");

View File

@ -5,8 +5,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
<?xml-stylesheet href="chrome://browser/skin/" type="text/css"?>
<?xul-overlay href="chrome://browser/content/places/placesOverlay.xul"?>
<?xml-stylesheet href="chrome://browser/skin/" type="text/css"?>
<!DOCTYPE page [
<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd">
@ -23,6 +22,23 @@
<script type="application/javascript" src="chrome://browser/content/browser.js"/>
<script type="application/javascript" src="chrome://browser/content/browser-places.js"/>
<script type="application/javascript" src="chrome://browser/content/web-panels.js"/>
<script type="application/javascript" src="chrome://global/content/globalOverlay.js"/>
<script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
<script type="application/javascript"><![CDATA[
ChromeUtils.defineModuleGetter(window,
"PlacesUtils", "resource://gre/modules/PlacesUtils.jsm");
ChromeUtils.defineModuleGetter(window,
"PlacesUIUtils", "resource:///modules/PlacesUIUtils.jsm");
ChromeUtils.defineModuleGetter(window,
"PlacesTransactions", "resource://gre/modules/PlacesTransactions.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyScriptGetter(window, "PlacesTreeView",
"chrome://browser/content/places/treeView.js");
XPCOMUtils.defineLazyScriptGetter(window,
["PlacesInsertionPoint", "PlacesController", "PlacesControllerDragHelper"],
"chrome://browser/content/places/controller.js");
]]></script>
<broadcasterset id="mainBroadcasterSet">
<broadcaster id="isFrameImage"/>

View File

@ -7,7 +7,6 @@
<?xml-stylesheet href="chrome://browser/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://browser/content/usercontext/usercontext.css" type="text/css"?>
<?xul-overlay href="chrome://browser/content/places/placesOverlay.xul"?>
<!DOCTYPE page [
<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd">
@ -23,6 +22,23 @@
<script type="application/javascript" src="chrome://browser/content/browser.js"/>
<script type="application/javascript" src="chrome://browser/content/browser-places.js"/>
<script type="application/javascript" src="chrome://browser/content/webext-panels.js"/>
<script type="application/javascript" src="chrome://global/content/globalOverlay.js"/>
<script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
<script type="application/javascript"><![CDATA[
ChromeUtils.defineModuleGetter(window,
"PlacesUtils", "resource://gre/modules/PlacesUtils.jsm");
ChromeUtils.defineModuleGetter(window,
"PlacesUIUtils", "resource:///modules/PlacesUIUtils.jsm");
ChromeUtils.defineModuleGetter(window,
"PlacesTransactions", "resource://gre/modules/PlacesTransactions.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyScriptGetter(window, "PlacesTreeView",
"chrome://browser/content/places/treeView.js");
XPCOMUtils.defineLazyScriptGetter(window,
["PlacesInsertionPoint", "PlacesController", "PlacesControllerDragHelper"],
"chrome://browser/content/places/controller.js");
]]></script>
<broadcasterset id="mainBroadcasterSet">
<broadcaster id="isFrameImage"/>

View File

@ -4,7 +4,7 @@
const CC = Components.Constructor;
ChromeUtils.import("resource://gre/modules/ForgetAboutSite.jsm");
let {ForgetAboutSite} = ChromeUtils.import("resource://gre/modules/ForgetAboutSite.jsm", {});
ChromeUtils.import("resource://gre/modules/Services.jsm");
let {HttpServer} = ChromeUtils.import("resource://testing-common/httpd.js", {});

View File

@ -181,8 +181,8 @@ const CustomizableWidgets = [
tooltiptext: "find-button.tooltiptext3",
onCommand(aEvent) {
let win = aEvent.target.ownerGlobal;
if (win.gFindBar) {
win.gFindBar.onFindCommand();
if (win.gLazyFindCommand) {
win.gLazyFindCommand("onFindCommand");
}
}
}, {

View File

@ -17,7 +17,11 @@ add_task(async function() {
let findButton = document.getElementById("find-button");
ok(findButton, "Find button exists in Panel Menu");
let findBarPromise = gBrowser.isFindBarInitialized() ?
null : BrowserTestUtils.waitForEvent(gBrowser.selectedTab, "TabFindInitialized");
findButton.click();
await findBarPromise;
ok(!gFindBar.hasAttribute("hidden"), "Findbar opened successfully");
// close find bar

View File

@ -94,12 +94,15 @@ add_task(async function testEnterKeyBehaviors() {
EventUtils.synthesizeKey("KEY_ArrowUp");
focusedElement = document.commandDispatcher.focusedElement;
}
let findBarPromise = gBrowser.isFindBarInitialized() ?
null : BrowserTestUtils.waitForEvent(gBrowser.selectedTab, "TabFindInitialized");
Assert.equal(focusedElement.id, kFindButtonId, "Find button should be selected");
promise = promisePanelHidden(window);
EventUtils.synthesizeKey("KEY_Enter");
await promise;
await findBarPromise;
Assert.ok(!gFindBar.hidden, "Findbar should have opened");
gFindBar.close();
});

View File

@ -89,6 +89,13 @@ async function handleNewTabOpened() {
description.appendChild(
BrowserUtils.getLocalizedFragment(doc, message, addonDetails));
// Add the Learn more link to the description.
let link = doc.createElement("label");
link.setAttribute("class", "learnMore text-link");
link.href = Services.urlFormatter.formatURLPref("app.support.baseURL") + "extension-home";
link.textContent = strBundle.GetStringFromName("newTabControlled.learnMore");
description.appendChild(link);
// Setup the command handler.
let handleCommand = async (event) => {
if (event.originalTarget.getAttribute("anonid") == "button") {

View File

@ -180,10 +180,14 @@ this.windows = class extends ExtensionAPI {
return new Promise(resolve => {
window.addEventListener("load", function() {
if (["maximized", "normal"].includes(createData.state)) {
window.document.documentElement.setAttribute("sizemode", createData.state);
}
resolve(promiseObserved("browser-delayed-startup-finished", win => win == window));
}, {once: true});
}).then(() => {
if (["minimized", "fullscreen", "docked", "normal", "maximized"].includes(createData.state)) {
// Some states only work after delayed-startup-finished
if (["minimized", "fullscreen", "docked"].includes(createData.state)) {
win.state = createData.state;
}
if (allowScriptsToClose) {

View File

@ -103,7 +103,7 @@ add_task(async function testWindowCreate() {
windowState = latestWindow.STATE_FULLSCREEN;
}
if (expected.state == "STATE_NORMAL") {
if (expected.state == "STATE_NORMAL" && AppConstants.platform == "macosx") {
ok(windowState == window.STATE_NORMAL || windowState == window.STATE_MAXIMIZED,
`Expected windowState (currently ${windowState}) to be STATE_NORMAL but will accept STATE_MAXIMIZED`);
} else {

View File

@ -21,7 +21,7 @@ const TOPIC_LOCALES_CHANGE = "intl:app-locales-changed";
// Automated tests ensure packaged locales are in this list. Copied output of:
// https://github.com/mozilla/activity-stream/blob/master/bin/render-activity-stream-html.js
const ACTIVITY_STREAM_LOCALES = "en-US ach an ar ast az be bg bn-BD bn-IN br bs ca cak cs cy da de dsb el en-GB eo es-AR es-CL es-ES es-MX et eu fa ff fi fr fy-NL ga-IE gd gl gn gu-IN he hi-IN hr hsb hu hy-AM ia id it ja ka kab kk km kn ko lij lo lt ltg lv mk ml mr ms my nb-NO ne-NP nl nn-NO pa-IN pl pt-BR pt-PT rm ro ru si sk sl sq sr sv-SE ta te th tl tr uk ur uz vi zh-CN zh-TW".split(" ");
const ACTIVITY_STREAM_LOCALES = "en-US ach an ar ast az be bg bn-BD bn-IN br bs ca cak crh cs cy da de dsb el en-GB eo es-AR es-CL es-ES es-MX et eu fa ff fi fr fy-NL ga-IE gd gl gn gu-IN he hi-IN hr hsb hu hy-AM ia id it ja ka kab kk km kn ko lij lo lt ltg lv mk ml mr ms my nb-NO ne-NP nl nn-NO pa-IN pl pt-BR pt-PT rm ro ru si sk sl sq sr sv-SE ta te th tl tr uk ur uz vi zh-CN zh-TW".split(" ");
const ABOUT_URL = "about:newtab";

View File

@ -925,7 +925,7 @@ BrowserGlue.prototype = {
_onFirstWindowLoaded: function BG__onFirstWindowLoaded(aWindow) {
// Set up listeners and, if PdfJs is enabled, register the PDF stream converter.
// We delay all of the parent's initialization other than stream converter
// registration, because it requires file IO from nsHandlerService-json.js
// registration, because it requires file IO from HandlerService.js
Services.ppmm.loadProcessScript("resource://pdf.js/pdfjschildbootstrap.js", true);
if (PdfJs.enabled) {
PdfJs.ensureRegistered();

View File

@ -1,12 +0,0 @@
"use strict";
module.exports = {
"env": {
// Everything in this directory is loaded alongside the places overlay.
"mozilla/places-overlay": true
},
"plugins": [
"mozilla",
]
};

View File

@ -58,6 +58,7 @@
*/
/* import-globals-from editBookmarkOverlay.js */
/* import-globals-from controller.js */
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.defineModuleGetter(this, "PrivateBrowsingUtils",

View File

@ -9,7 +9,6 @@
<?xml-stylesheet href="chrome://browser/skin/places/places.css"?>
<?xml-stylesheet href="chrome://browser/content/places/places.css"?>
<?xul-overlay href="chrome://browser/content/places/placesOverlay.xul"?>
<?xul-overlay href="chrome://browser/content/places/editBookmarkOverlay.xul"?>
<!DOCTYPE dialog [
@ -37,6 +36,25 @@
src="chrome://browser/content/places/editBookmarkOverlay.js"/>
<script type="application/javascript"
src="chrome://browser/content/places/bookmarkProperties.js"/>
<script type="application/javascript"
src="chrome://global/content/globalOverlay.js"/>
<script type="application/javascript"
src="chrome://browser/content/utilityOverlay.js"/>
<script type="application/javascript"><![CDATA[
ChromeUtils.defineModuleGetter(window,
"PlacesUtils", "resource://gre/modules/PlacesUtils.jsm");
ChromeUtils.defineModuleGetter(window,
"PlacesUIUtils", "resource:///modules/PlacesUIUtils.jsm");
ChromeUtils.defineModuleGetter(window,
"PlacesTransactions", "resource://gre/modules/PlacesTransactions.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyScriptGetter(window, "PlacesTreeView",
"chrome://browser/content/places/treeView.js");
XPCOMUtils.defineLazyScriptGetter(window,
["PlacesInsertionPoint", "PlacesController", "PlacesControllerDragHelper"],
"chrome://browser/content/places/controller.js");
]]></script>
<vbox id="editBookmarkPanelContent"/>

View File

@ -0,0 +1,8 @@
<!-- Bookmarks and history tooltip -->
<tooltip id="bhTooltip" noautohide="true"
onpopupshowing="return window.top.BookmarksEventHandler.fillInBHTooltip(document, event)">
<vbox id="bhTooltipTextBox" flex="1">
<label id="bhtTitleText" class="tooltip-label" />
<label id="bhtUrlText" crop="center" class="tooltip-label uri-element" />
</vbox>
</tooltip>

View File

@ -3,6 +3,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* import-globals-from ../../../../toolkit/components/places/PlacesUtils.jsm */
function init() {
document.getElementById("bookmarks-view").place =
"place:type=" + Ci.nsINavHistoryQueryOptions.RESULTS_AS_ROOTS_QUERY;

View File

@ -6,9 +6,13 @@
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://browser/content/places/places.css"?>
<?xml-stylesheet href="chrome://browser/skin/places/places.css"?>
<?xul-overlay href="chrome://browser/content/places/placesOverlay.xul"?>
<!DOCTYPE page SYSTEM "chrome://browser/locale/places/places.dtd">
<!DOCTYPE page [
<!ENTITY % placesDTD SYSTEM "chrome://browser/locale/places/places.dtd">
%placesDTD;
<!ENTITY % editMenuOverlayDTD SYSTEM "chrome://global/locale/editMenuOverlay.dtd">
%editMenuOverlayDTD;
]>
<page id="bookmarksPanel"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
@ -20,13 +24,30 @@
src="chrome://browser/content/bookmarks/sidebarUtils.js"/>
<script type="application/javascript"
src="chrome://browser/content/bookmarks/bookmarksPanel.js"/>
<script type="application/javascript"
src="chrome://global/content/globalOverlay.js"/>
<script type="application/javascript"
src="chrome://browser/content/utilityOverlay.js"/>
<script type="application/javascript"><![CDATA[
ChromeUtils.defineModuleGetter(window,
"PlacesUtils", "resource://gre/modules/PlacesUtils.jsm");
ChromeUtils.defineModuleGetter(window,
"PlacesUIUtils", "resource:///modules/PlacesUIUtils.jsm");
ChromeUtils.defineModuleGetter(window,
"PlacesTransactions", "resource://gre/modules/PlacesTransactions.jsm");
<commandset id="placesCommands"/>
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyScriptGetter(window, "PlacesTreeView",
"chrome://browser/content/places/treeView.js");
XPCOMUtils.defineLazyScriptGetter(window,
["PlacesInsertionPoint", "PlacesController", "PlacesControllerDragHelper"],
"chrome://browser/content/places/controller.js");
]]></script>
#include placesCommands.inc.xul
#include ../../../../toolkit/content/editMenuCommands.inc.xul
<menupopup id="placesContext"/>
<!-- Bookmarks and history tooltip -->
<tooltip id="bhTooltip"/>
#include placesContextMenu.inc.xul
#include bookmarksHistoryTooltip.inc.xul
<hbox id="sidebar-search-container" align="center">
<textbox id="search-box" flex="1" type="search"

View File

@ -3,6 +3,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* import-globals-from ../PlacesUIUtils.jsm */
/* import-globals-from ../../../../toolkit/content/globalOverlay.js */
/* import-globals-from ../../../../toolkit/components/places/PlacesUtils.jsm */
/* import-globals-from ../../../../toolkit/components/places/PlacesTransactions.jsm */
/**
* Represents an insertion point within a container where we can insert
* items.
@ -224,6 +229,7 @@ PlacesController.prototype = {
host = queries[0].domain;
} else
host = Services.io.newURI(this._view.selectedNode.uri).host;
let {ForgetAboutSite} = ChromeUtils.import("resource://gre/modules/ForgetAboutSite.jsm", {});
ForgetAboutSite.removeDataFromDomain(host)
.catch(Cu.reportError);
break;

View File

@ -3,6 +3,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* import-globals-from ../../../../toolkit/components/places/PlacesUtils.jsm */
ChromeUtils.import("resource://gre/modules/TelemetryStopwatch.jsm");
var gHistoryTree;

View File

@ -8,8 +8,6 @@
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://browser/skin/places/places.css"?>
<?xul-overlay href="chrome://browser/content/places/placesOverlay.xul"?>
<!DOCTYPE page [
<!ENTITY % placesDTD SYSTEM "chrome://browser/locale/places/places.dtd">
%placesDTD;
@ -29,10 +27,29 @@
src="chrome://browser/content/bookmarks/sidebarUtils.js"/>
<script type="application/javascript"
src="chrome://browser/content/places/history-panel.js"/>
<script type="application/javascript"
src="chrome://global/content/globalOverlay.js"/>
<script type="application/javascript"
src="chrome://browser/content/utilityOverlay.js"/>
<script type="application/javascript"><![CDATA[
ChromeUtils.defineModuleGetter(window,
"PlacesUtils", "resource://gre/modules/PlacesUtils.jsm");
ChromeUtils.defineModuleGetter(window,
"PlacesUIUtils", "resource:///modules/PlacesUIUtils.jsm");
ChromeUtils.defineModuleGetter(window,
"PlacesTransactions", "resource://gre/modules/PlacesTransactions.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyScriptGetter(window, "PlacesTreeView",
"chrome://browser/content/places/treeView.js");
XPCOMUtils.defineLazyScriptGetter(window,
["PlacesInsertionPoint", "PlacesController", "PlacesControllerDragHelper"],
"chrome://browser/content/places/controller.js");
]]></script>
#include ../../../../toolkit/content/editMenuCommands.inc.xul
<commandset id="placesCommands"/>
#include placesCommands.inc.xul
#include ../../../../toolkit/content/editMenuKeys.inc.xul
#ifdef XP_MACOSX
@ -41,11 +58,8 @@
</keyset>
#endif
<!-- required to overlay the context menu -->
<menupopup id="placesContext"/>
<!-- Bookmarks and history tooltip -->
<tooltip id="bhTooltip"/>
#include placesContextMenu.inc.xul
#include bookmarksHistoryTooltip.inc.xul
<hbox id="sidebar-search-container">
<textbox id="search-box" flex="1" type="search"

View File

@ -4,6 +4,8 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!-- import-globals-from controller.js -->
<bindings id="placesMenuBindings"
xmlns="http://www.mozilla.org/xbl"
xmlns:xbl="http://www.mozilla.org/xbl"

View File

@ -6,6 +6,8 @@
/* import-globals-from editBookmarkOverlay.js */
// Via downloadsViewOverlay.xul -> allDownloadsViewOverlay.xul
/* import-globals-from ../../../../toolkit/content/contentAreaUtils.js */
/* import-globals-from ../PlacesUIUtils.jsm */
/* import-globals-from ../../../../toolkit/components/places/PlacesUtils.jsm */
ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");

View File

@ -15,8 +15,6 @@
#ifdef XP_MACOSX
<?xul-overlay href="chrome://browser/content/macBrowserOverlay.xul"?>
#else
<?xul-overlay href="chrome://browser/content/places/placesOverlay.xul"?>
#endif
<!DOCTYPE window [
@ -50,6 +48,25 @@
<!-- On Mac, these are included via macBrowserOverlay.xul -> browser.js -> defineLazyScriptGetter -->
<script type="application/javascript"
src="chrome://browser/content/places/editBookmarkOverlay.js"/>
<script type="application/javascript"
src="chrome://global/content/globalOverlay.js"/>
<script type="application/javascript"
src="chrome://browser/content/utilityOverlay.js"/>
<script type="application/javascript"><![CDATA[
ChromeUtils.defineModuleGetter(window,
"PlacesUtils", "resource://gre/modules/PlacesUtils.jsm");
ChromeUtils.defineModuleGetter(window,
"PlacesUIUtils", "resource:///modules/PlacesUIUtils.jsm");
ChromeUtils.defineModuleGetter(window,
"PlacesTransactions", "resource://gre/modules/PlacesTransactions.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyScriptGetter(window, "PlacesTreeView",
"chrome://browser/content/places/treeView.js");
XPCOMUtils.defineLazyScriptGetter(window,
["PlacesInsertionPoint", "PlacesController", "PlacesControllerDragHelper"],
"chrome://browser/content/places/controller.js");
]]></script>
#endif
<stringbundleset id="placesStringSet">
@ -61,7 +78,7 @@
#include ../../../base/content/browserMountPoints.inc
#else
#include ../../../../toolkit/content/editMenuCommands.inc.xul
<commandset id="placesCommands"/>
#include placesCommands.inc.xul
#endif
<commandset id="organizerCommandSet">
@ -139,7 +156,7 @@
#endif
<popupset id="placesPopupset">
<menupopup id="placesContext"/>
#include placesContextMenu.inc.xul
<menupopup id="placesColumnsContext"
onpopupshowing="ViewMenu.fillWithColumns(event, null, null, 'checkbox', null);"
oncommand="ViewMenu.showHideColumn(event.target); event.stopPropagation();"/>

View File

@ -0,0 +1,48 @@
<commandset id="placesCommands"
commandupdater="true"
events="focus,sort,places"
oncommandupdate="PlacesUIUtils.updateCommands(window);">
<command id="Browser:ShowAllBookmarks"
oncommand="PlacesCommandHook.showPlacesOrganizer('UnfiledBookmarks');"/>
<command id="Browser:ShowAllHistory"
oncommand="PlacesCommandHook.showPlacesOrganizer('History');"/>
<command id="placesCmd_open"
oncommand="PlacesUIUtils.doCommand(window, 'placesCmd_open');"/>
<command id="placesCmd_open:window"
oncommand="PlacesUIUtils.doCommand(window, 'placesCmd_open:window');"/>
<command id="placesCmd_open:privatewindow"
oncommand="PlacesUIUtils.doCommand(window, 'placesCmd_open:privatewindow');"/>
<command id="placesCmd_open:tab"
oncommand="PlacesUIUtils.doCommand(window, 'placesCmd_open:tab');"/>
<command id="placesCmd_new:bookmark"
oncommand="PlacesUIUtils.doCommand(window, 'placesCmd_new:bookmark');"/>
<command id="placesCmd_new:folder"
oncommand="PlacesUIUtils.doCommand(window, 'placesCmd_new:folder');"/>
<command id="placesCmd_new:separator"
oncommand="PlacesUIUtils.doCommand(window, 'placesCmd_new:separator');"/>
<command id="placesCmd_show:info"
oncommand="PlacesUIUtils.doCommand(window, 'placesCmd_show:info');"/>
<command id="placesCmd_rename"
oncommand="PlacesUIUtils.doCommand(window, 'placesCmd_show:info');"
observes="placesCmd_show:info"/>
<command id="placesCmd_reload"
oncommand="PlacesUIUtils.doCommand(window, 'placesCmd_reload');"/>
<command id="placesCmd_sortBy:name"
oncommand="PlacesUIUtils.doCommand(window, 'placesCmd_sortBy:name');"/>
<command id="placesCmd_deleteDataHost"
oncommand="PlacesUIUtils.doCommand(window, 'placesCmd_deleteDataHost');"/>
<command id="placesCmd_createBookmark"
oncommand="PlacesUIUtils.doCommand(window, 'placesCmd_createBookmark');"/>
<!-- Special versions of cut/copy/paste/delete which check for an open context menu. -->
<command id="placesCmd_cut"
oncommand="PlacesUIUtils.doCommand(window, 'placesCmd_cut');"/>
<command id="placesCmd_copy"
oncommand="PlacesUIUtils.doCommand(window, 'placesCmd_copy');"/>
<command id="placesCmd_paste"
oncommand="PlacesUIUtils.doCommand(window, 'placesCmd_paste');"/>
<command id="placesCmd_delete"
oncommand="PlacesUIUtils.doCommand(window, 'placesCmd_delete');"/>
</commandset>

View File

@ -0,0 +1,136 @@
<menupopup id="placesContext"
onpopupshowing="this._view = PlacesUIUtils.getViewForNode(document.popupNode);
if (!PlacesUIUtils.openInTabClosesMenu) {
document.getElementById ('placesContext_open:newtab')
.setAttribute('closemenu', 'single');
}
return this._view.buildContextMenu(this);"
onpopuphiding="this._view.destroyContextMenu();">
<menuitem id="placesContext_open"
command="placesCmd_open"
label="&cmd.open.label;"
accesskey="&cmd.open.accesskey;"
default="true"
selectiontype="single"
selection="link"/>
<menuitem id="placesContext_open:newtab"
command="placesCmd_open:tab"
label="&cmd.open_tab.label;"
accesskey="&cmd.open_tab.accesskey;"
selectiontype="single"
selection="link"/>
<menuitem id="placesContext_openContainer:tabs"
oncommand="var view = PlacesUIUtils.getViewForNode(document.popupNode);
view.controller.openSelectionInTabs(event);"
onclick="checkForMiddleClick(this, event);"
label="&cmd.open_all_in_tabs.label;"
accesskey="&cmd.open_all_in_tabs.accesskey;"
selectiontype="single|none"
selection="folder|host|query"/>
<menuitem id="placesContext_openLinks:tabs"
oncommand="var view = PlacesUIUtils.getViewForNode(document.popupNode);
view.controller.openSelectionInTabs(event);"
onclick="checkForMiddleClick(this, event);"
label="&cmd.open_all_in_tabs.label;"
accesskey="&cmd.open_all_in_tabs.accesskey;"
selectiontype="multiple"
selection="link"/>
<menuitem id="placesContext_open:newwindow"
command="placesCmd_open:window"
label="&cmd.open_window.label;"
accesskey="&cmd.open_window.accesskey;"
selectiontype="single"
selection="link"/>
<menuitem id="placesContext_open:newprivatewindow"
command="placesCmd_open:privatewindow"
label="&cmd.open_private_window.label;"
accesskey="&cmd.open_private_window.accesskey;"
selectiontype="single"
selection="link"
hideifprivatebrowsing="true"/>
<menuseparator id="placesContext_openSeparator"/>
<menuitem id="placesContext_new:bookmark"
command="placesCmd_new:bookmark"
label="&cmd.new_bookmark.label;"
accesskey="&cmd.new_bookmark.accesskey;"
selectiontype="any"
hideifnoinsertionpoint="true"/>
<menuitem id="placesContext_new:folder"
command="placesCmd_new:folder"
label="&cmd.new_folder.label;"
accesskey="&cmd.context_new_folder.accesskey;"
selectiontype="any"
hideifnoinsertionpoint="true"/>
<menuitem id="placesContext_new:separator"
command="placesCmd_new:separator"
label="&cmd.new_separator.label;"
accesskey="&cmd.new_separator.accesskey;"
closemenu="single"
selectiontype="any"
hideifnoinsertionpoint="true"/>
<menuseparator id="placesContext_newSeparator"/>
<menuitem id="placesContext_createBookmark"
command="placesCmd_createBookmark"
selection="link"
forcehideselection="bookmark|tagChild"/>
<menuitem id="placesContext_cut"
command="placesCmd_cut"
label="&cutCmd.label;"
accesskey="&cutCmd.accesskey;"
closemenu="single"
selection="bookmark|folder|separator|query"
forcehideselection="tagChild|livemarkChild"/>
<menuitem id="placesContext_copy"
command="placesCmd_copy"
label="&copyCmd.label;"
closemenu="single"
accesskey="&copyCmd.accesskey;"
selection="any"/>
<menuitem id="placesContext_paste"
command="placesCmd_paste"
label="&pasteCmd.label;"
closemenu="single"
accesskey="&pasteCmd.accesskey;"
selectiontype="any"
hideifnoinsertionpoint="true"/>
<menuseparator id="placesContext_editSeparator"/>
<menuitem id="placesContext_delete"
command="placesCmd_delete"
label="&deleteCmd.label;"
accesskey="&deleteCmd.accesskey;"
closemenu="single"
selection="bookmark|tagChild|folder|query|dynamiccontainer|separator|host"/>
<menuitem id="placesContext_delete_history"
command="placesCmd_delete"
closemenu="single"
selection="link"
forcehideselection="bookmark"/>
<menuitem id="placesContext_deleteHost"
command="placesCmd_deleteDataHost"
label="&cmd.deleteDomainData.label;"
accesskey="&cmd.deleteDomainData.accesskey;"
closemenu="single"
selection="link|host"
selectiontype="single"
forcehideselection="bookmark"/>
<menuseparator id="placesContext_deleteSeparator"/>
<menuitem id="placesContext_sortBy:name"
command="placesCmd_sortBy:name"
label="&cmd.sortby_name.label;"
accesskey="&cmd.context_sortby_name.accesskey;"
closemenu="single"
selection="folder"/>
<menuitem id="placesContext_reload"
command="placesCmd_reload"
label="&cmd.reloadLivebookmark.label;"
accesskey="&cmd.reloadLivebookmark.accesskey;"
closemenu="single"
selection="livemark/feedURI"/>
<menuseparator id="placesContext_sortSeparator"/>
<menuitem id="placesContext_show:info"
command="placesCmd_show:info"
label="&cmd.properties.label;"
accesskey="&cmd.properties.accesskey;"
selection="bookmark|folder|query"
forcehideselection="livemarkChild"/>
</menupopup>

View File

@ -1,228 +0,0 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE overlay [
<!ENTITY % placesDTD SYSTEM "chrome://browser/locale/places/places.dtd">
%placesDTD;
<!ENTITY % editMenuOverlayDTD SYSTEM "chrome://global/locale/editMenuOverlay.dtd">
%editMenuOverlayDTD;
]>
<overlay id="placesOverlay"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript"
src="chrome://global/content/globalOverlay.js"/>
<script type="application/javascript"
src="chrome://browser/content/utilityOverlay.js"/>
<script type="application/javascript"><![CDATA[
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.defineModuleGetter(window,
"PlacesUtils", "resource://gre/modules/PlacesUtils.jsm");
ChromeUtils.defineModuleGetter(window,
"PlacesUIUtils", "resource:///modules/PlacesUIUtils.jsm");
ChromeUtils.defineModuleGetter(window,
"PlacesTransactions", "resource://gre/modules/PlacesTransactions.jsm");
ChromeUtils.defineModuleGetter(window,
"ForgetAboutSite", "resource://gre/modules/ForgetAboutSite.jsm");
XPCOMUtils.defineLazyScriptGetter(window, "PlacesTreeView",
"chrome://browser/content/places/treeView.js");
XPCOMUtils.defineLazyScriptGetter(window,
["PlacesInsertionPoint", "PlacesController", "PlacesControllerDragHelper"],
"chrome://browser/content/places/controller.js");
]]></script>
<!-- Bookmarks and history tooltip -->
<tooltip id="bhTooltip" noautohide="true"
onpopupshowing="return window.top.BookmarksEventHandler.fillInBHTooltip(document, event)">
<vbox id="bhTooltipTextBox" flex="1">
<label id="bhtTitleText" class="tooltip-label" />
<label id="bhtUrlText" crop="center" class="tooltip-label uri-element" />
</vbox>
</tooltip>
<commandset id="placesCommands"
commandupdater="true"
events="focus,sort,places"
oncommandupdate="PlacesUIUtils.updateCommands(window);">
<command id="placesCmd_open"
oncommand="PlacesUIUtils.doCommand(window, 'placesCmd_open');"/>
<command id="placesCmd_open:window"
oncommand="PlacesUIUtils.doCommand(window, 'placesCmd_open:window');"/>
<command id="placesCmd_open:privatewindow"
oncommand="PlacesUIUtils.doCommand(window, 'placesCmd_open:privatewindow');"/>
<command id="placesCmd_open:tab"
oncommand="PlacesUIUtils.doCommand(window, 'placesCmd_open:tab');"/>
<command id="placesCmd_new:bookmark"
oncommand="PlacesUIUtils.doCommand(window, 'placesCmd_new:bookmark');"/>
<command id="placesCmd_new:folder"
oncommand="PlacesUIUtils.doCommand(window, 'placesCmd_new:folder');"/>
<command id="placesCmd_new:separator"
oncommand="PlacesUIUtils.doCommand(window, 'placesCmd_new:separator');"/>
<command id="placesCmd_show:info"
oncommand="PlacesUIUtils.doCommand(window, 'placesCmd_show:info');"/>
<command id="placesCmd_rename"
oncommand="PlacesUIUtils.doCommand(window, 'placesCmd_show:info');"
observes="placesCmd_show:info"/>
<command id="placesCmd_reload"
oncommand="PlacesUIUtils.doCommand(window, 'placesCmd_reload');"/>
<command id="placesCmd_sortBy:name"
oncommand="PlacesUIUtils.doCommand(window, 'placesCmd_sortBy:name');"/>
<command id="placesCmd_deleteDataHost"
oncommand="PlacesUIUtils.doCommand(window, 'placesCmd_deleteDataHost');"/>
<command id="placesCmd_createBookmark"
oncommand="PlacesUIUtils.doCommand(window, 'placesCmd_createBookmark');"/>
<!-- Special versions of cut/copy/paste/delete which check for an open context menu. -->
<command id="placesCmd_cut"
oncommand="PlacesUIUtils.doCommand(window, 'placesCmd_cut');"/>
<command id="placesCmd_copy"
oncommand="PlacesUIUtils.doCommand(window, 'placesCmd_copy');"/>
<command id="placesCmd_paste"
oncommand="PlacesUIUtils.doCommand(window, 'placesCmd_paste');"/>
<command id="placesCmd_delete"
oncommand="PlacesUIUtils.doCommand(window, 'placesCmd_delete');"/>
</commandset>
<menupopup id="placesContext"
onpopupshowing="this._view = PlacesUIUtils.getViewForNode(document.popupNode);
if (!PlacesUIUtils.openInTabClosesMenu) {
document.getElementById ('placesContext_open:newtab')
.setAttribute('closemenu', 'single');
}
return this._view.buildContextMenu(this);"
onpopuphiding="this._view.destroyContextMenu();">
<menuitem id="placesContext_open"
command="placesCmd_open"
label="&cmd.open.label;"
accesskey="&cmd.open.accesskey;"
default="true"
selectiontype="single"
selection="link"/>
<menuitem id="placesContext_open:newtab"
command="placesCmd_open:tab"
label="&cmd.open_tab.label;"
accesskey="&cmd.open_tab.accesskey;"
selectiontype="single"
selection="link"/>
<menuitem id="placesContext_openContainer:tabs"
oncommand="var view = PlacesUIUtils.getViewForNode(document.popupNode);
view.controller.openSelectionInTabs(event);"
onclick="checkForMiddleClick(this, event);"
label="&cmd.open_all_in_tabs.label;"
accesskey="&cmd.open_all_in_tabs.accesskey;"
selectiontype="single|none"
selection="folder|host|query"/>
<menuitem id="placesContext_openLinks:tabs"
oncommand="var view = PlacesUIUtils.getViewForNode(document.popupNode);
view.controller.openSelectionInTabs(event);"
onclick="checkForMiddleClick(this, event);"
label="&cmd.open_all_in_tabs.label;"
accesskey="&cmd.open_all_in_tabs.accesskey;"
selectiontype="multiple"
selection="link"/>
<menuitem id="placesContext_open:newwindow"
command="placesCmd_open:window"
label="&cmd.open_window.label;"
accesskey="&cmd.open_window.accesskey;"
selectiontype="single"
selection="link"/>
<menuitem id="placesContext_open:newprivatewindow"
command="placesCmd_open:privatewindow"
label="&cmd.open_private_window.label;"
accesskey="&cmd.open_private_window.accesskey;"
selectiontype="single"
selection="link"
hideifprivatebrowsing="true"/>
<menuseparator id="placesContext_openSeparator"/>
<menuitem id="placesContext_new:bookmark"
command="placesCmd_new:bookmark"
label="&cmd.new_bookmark.label;"
accesskey="&cmd.new_bookmark.accesskey;"
selectiontype="any"
hideifnoinsertionpoint="true"/>
<menuitem id="placesContext_new:folder"
command="placesCmd_new:folder"
label="&cmd.new_folder.label;"
accesskey="&cmd.context_new_folder.accesskey;"
selectiontype="any"
hideifnoinsertionpoint="true"/>
<menuitem id="placesContext_new:separator"
command="placesCmd_new:separator"
label="&cmd.new_separator.label;"
accesskey="&cmd.new_separator.accesskey;"
closemenu="single"
selectiontype="any"
hideifnoinsertionpoint="true"/>
<menuseparator id="placesContext_newSeparator"/>
<menuitem id="placesContext_createBookmark"
command="placesCmd_createBookmark"
selection="link"
forcehideselection="bookmark|tagChild"/>
<menuitem id="placesContext_cut"
command="placesCmd_cut"
label="&cutCmd.label;"
accesskey="&cutCmd.accesskey;"
closemenu="single"
selection="bookmark|folder|separator|query"
forcehideselection="tagChild|livemarkChild"/>
<menuitem id="placesContext_copy"
command="placesCmd_copy"
label="&copyCmd.label;"
closemenu="single"
accesskey="&copyCmd.accesskey;"
selection="any"/>
<menuitem id="placesContext_paste"
command="placesCmd_paste"
label="&pasteCmd.label;"
closemenu="single"
accesskey="&pasteCmd.accesskey;"
selectiontype="any"
hideifnoinsertionpoint="true"/>
<menuseparator id="placesContext_editSeparator"/>
<menuitem id="placesContext_delete"
command="placesCmd_delete"
label="&deleteCmd.label;"
accesskey="&deleteCmd.accesskey;"
closemenu="single"
selection="bookmark|tagChild|folder|query|dynamiccontainer|separator|host"/>
<menuitem id="placesContext_delete_history"
command="placesCmd_delete"
closemenu="single"
selection="link"
forcehideselection="bookmark"/>
<menuitem id="placesContext_deleteHost"
command="placesCmd_deleteDataHost"
label="&cmd.deleteDomainData.label;"
accesskey="&cmd.deleteDomainData.accesskey;"
closemenu="single"
selection="link|host"
selectiontype="single"
forcehideselection="bookmark"/>
<menuseparator id="placesContext_deleteSeparator"/>
<menuitem id="placesContext_sortBy:name"
command="placesCmd_sortBy:name"
label="&cmd.sortby_name.label;"
accesskey="&cmd.context_sortby_name.accesskey;"
closemenu="single"
selection="folder"/>
<menuitem id="placesContext_reload"
command="placesCmd_reload"
label="&cmd.reloadLivebookmark.label;"
accesskey="&cmd.reloadLivebookmark.accesskey;"
closemenu="single"
selection="livemark/feedURI"/>
<menuseparator id="placesContext_sortSeparator"/>
<menuitem id="placesContext_show:info"
command="placesCmd_show:info"
label="&cmd.properties.label;"
accesskey="&cmd.properties.accesskey;"
selection="bookmark|folder|query"
forcehideselection="livemarkChild"/>
</menupopup>
</overlay>

View File

@ -2,6 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* import-globals-from ../PlacesUIUtils.jsm */
/* import-globals-from ../../../../toolkit/components/places/PlacesUtils.jsm */
ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
let uidensity = window.top.document.documentElement.getAttribute("uidensity");

View File

@ -4,6 +4,9 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!-- import-globals-from controller.js -->
<!-- import-globals-from treeView.js -->
<bindings id="placesTreeBindings"
xmlns="http://www.mozilla.org/xbl"
xmlns:xbl="http://www.mozilla.org/xbl"

View File

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
/* import-globals-from controller.js */
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm");

View File

@ -13,7 +13,6 @@ browser.jar:
content/browser/places/organizer.css (content/organizer.css)
content/browser/places/bookmarkProperties.xul (content/bookmarkProperties.xul)
content/browser/places/bookmarkProperties.js (content/bookmarkProperties.js)
content/browser/places/placesOverlay.xul (content/placesOverlay.xul)
content/browser/places/menu.xml (content/menu.xml)
content/browser/places/tree.xml (content/tree.xml)
content/browser/places/controller.js (content/controller.js)

View File

@ -1,9 +1,25 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm");
Services.scriptloader.loadSubScript("chrome://global/content/globalOverlay.js", this);
Services.scriptloader.loadSubScript("chrome://browser/content/utilityOverlay.js", this);
ChromeUtils.defineModuleGetter(this, "PlacesTestUtils",
"resource://testing-common/PlacesTestUtils.jsm");
ChromeUtils.defineModuleGetter(this, "BrowserTestUtils",
"resource://testing-common/BrowserTestUtils.jsm");
ChromeUtils.defineModuleGetter(window,
"PlacesUtils", "resource://gre/modules/PlacesUtils.jsm");
ChromeUtils.defineModuleGetter(window,
"PlacesUIUtils", "resource:///modules/PlacesUIUtils.jsm");
ChromeUtils.defineModuleGetter(window,
"PlacesTransactions", "resource://gre/modules/PlacesTransactions.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyScriptGetter(window, ["PlacesTreeView"],
"chrome://browser/content/places/treeView.js");
XPCOMUtils.defineLazyScriptGetter(window,
["PlacesInsertionPoint", "PlacesController", "PlacesControllerDragHelper"],
"chrome://browser/content/places/controller.js");

View File

@ -10,7 +10,6 @@
<?xml-stylesheet href="chrome://browser/content/places/places.css"?>
<?xml-stylesheet href="chrome://browser/skin/places/places.css"?>
<?xul-overlay href="chrome://browser/content/places/placesOverlay.xul"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="510634: Wrong icons on bookmarks sidebar"
@ -18,6 +17,7 @@
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
<script type="application/javascript" src="head.js" />
<body xmlns="http://www.w3.org/1999/xhtml" />

View File

@ -11,7 +11,6 @@
<?xml-stylesheet href="chrome://browser/content/places/places.css"?>
<?xml-stylesheet href="chrome://browser/skin/places/places.css"?>
<?xul-overlay href="chrome://browser/content/places/placesOverlay.xul"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="1163447: selectItems in Places no longer selects items within Toolbar or Sidebar folders"

View File

@ -12,7 +12,6 @@
<?xml-stylesheet href="chrome://browser/content/places/places.css"?>
<?xml-stylesheet href="chrome://browser/skin/places/places.css"?>
<?xul-overlay href="chrome://browser/content/places/placesOverlay.xul"?>
<?xul-overlay href="chrome://browser/content/places/editBookmarkOverlay.xul"?>
<!DOCTYPE window [
@ -28,6 +27,8 @@
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
<script type="application/javascript"
src="chrome://browser/content/places/editBookmarkOverlay.js"/>
<script type="application/javascript" src="head.js" />
<body xmlns="http://www.w3.org/1999/xhtml" />

View File

@ -12,7 +12,6 @@
<?xml-stylesheet href="chrome://browser/content/places/places.css"?>
<?xml-stylesheet href="chrome://browser/skin/places/places.css"?>
<?xul-overlay href="chrome://browser/content/places/placesOverlay.xul"?>
<?xul-overlay href="chrome://browser/content/places/editBookmarkOverlay.xul"?>
<!DOCTYPE window [

View File

@ -11,7 +11,6 @@
<?xml-stylesheet href="chrome://browser/content/places/places.css"?>
<?xml-stylesheet href="chrome://browser/skin/places/places.css"?>
<?xul-overlay href="chrome://browser/content/places/placesOverlay.xul"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="549192: History view not updated after deleting entry"

View File

@ -11,7 +11,6 @@
<?xml-stylesheet href="chrome://browser/content/places/places.css"?>
<?xml-stylesheet href="chrome://browser/skin/places/places.css"?>
<?xul-overlay href="chrome://browser/content/places/placesOverlay.xul"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="549491: 'The root node is never visible' exception when details of the root node are modified "

View File

@ -11,7 +11,6 @@
<?xml-stylesheet href="chrome://browser/content/places/places.css"?>
<?xml-stylesheet href="chrome://browser/skin/places/places.css"?>
<?xul-overlay href="chrome://browser/content/places/placesOverlay.xul"?>
<?xul-overlay href="chrome://browser/content/places/editBookmarkOverlay.xul"?>
<!DOCTYPE window [

View File

@ -11,7 +11,6 @@
<?xml-stylesheet href="chrome://browser/content/places/places.css"?>
<?xml-stylesheet href="chrome://browser/skin/places/places.css"?>
<?xul-overlay href="chrome://browser/content/places/placesOverlay.xul"?>
<?xul-overlay href="chrome://browser/content/places/editBookmarkOverlay.xul"?>
<!DOCTYPE window [
@ -29,6 +28,8 @@
src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
<script type="application/javascript"
src="chrome://browser/content/places/editBookmarkOverlay.js"/>
<script type="application/javascript" src="head.js" />
<body xmlns="http://www.w3.org/1999/xhtml" />

View File

@ -11,7 +11,6 @@
<?xml-stylesheet href="chrome://browser/content/places/places.css"?>
<?xml-stylesheet href="chrome://browser/skin/places/places.css"?>
<?xul-overlay href="chrome://browser/content/places/placesOverlay.xul"?>
<?xul-overlay href="chrome://browser/content/places/editBookmarkOverlay.xul"?>
<!DOCTYPE window [

View File

@ -11,7 +11,6 @@
<?xml-stylesheet href="chrome://browser/content/places/places.css"?>
<?xml-stylesheet href="chrome://browser/skin/places/places.css"?>
<?xul-overlay href="chrome://browser/content/places/placesOverlay.xul"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="549192: History view not updated after deleting entry"

View File

@ -10,7 +10,6 @@
<?xml-stylesheet href="chrome://browser/content/places/places.css"?>
<?xml-stylesheet href="chrome://browser/skin/places/places.css"?>
<?xul-overlay href="chrome://browser/content/places/placesOverlay.xul"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="435322: Places tree view's formatting"

View File

@ -27,10 +27,9 @@ var gSearchResultsPane = {
// Initialize other panes in an idle callback.
window.requestIdleCallback(() => this.initializeCategories());
}
let strings = this.strings;
this.searchInput.placeholder = AppConstants.platform == "win" ?
strings.getString("searchInput.labelWin") :
strings.getString("searchInput.labelUnix");
let helpUrl = Services.urlFormatter.formatURLPref("app.support.baseURL") + "preferences";
let helpContainer = document.getElementById("need-help");
helpContainer.querySelector("a").href = helpUrl;
},
handleEvent(event) {
@ -197,11 +196,6 @@ var gSearchResultsPane = {
return selection;
},
get strings() {
delete this.strings;
return this.strings = document.getElementById("searchResultBundle");
},
/**
* Shows or hides content according to search input
*
@ -294,25 +288,21 @@ var gSearchResultsPane = {
if (!resultsFound) {
let noResultsEl = document.querySelector(".no-results-message");
noResultsEl.setAttribute("query", this.query);
noResultsEl.hidden = false;
let strings = this.strings;
let msgElem = document.getElementById("sorry-message");
document.l10n.setAttributes(msgElem, "search-results-sorry-message", {
query: this.query
});
document.getElementById("sorry-message").textContent = AppConstants.platform == "win" ?
strings.getFormattedString("searchResults.sorryMessageWin", [this.query]) :
strings.getFormattedString("searchResults.sorryMessageUnix", [this.query]);
let helpUrl = Services.urlFormatter.formatURLPref("app.support.baseURL") + "preferences";
let brandName = document.getElementById("bundleBrand").getString("brandShortName");
let helpString = strings.getString("searchResults.needHelp3");
let helpContainer = document.getElementById("need-help");
let link = document.createElement("label");
link.className = "text-link";
link.setAttribute("href", helpUrl);
link.textContent = strings.getFormattedString("searchResults.needHelpSupportLink", [brandName]);
helpContainer.innerHTML = "";
let fragment = BrowserUtils.getLocalizedFragment(document, helpString, link);
helpContainer.appendChild(fragment);
// We want to unhide this section only when the translation for the
// `sorry-message` is displayed. Since that's going to happen
// in the next animation frame, we will unhide it then.
window.requestAnimationFrame(() => {
// Making sure that the query didn't change in the meantime.
if (query === this.query) {
noResultsEl.hidden = false;
}
});
} else {
// Creating tooltips for all the instances found
for (let anchorNode of this.listSearchTooltips) {

View File

@ -575,6 +575,7 @@ var gMainPane = {
setEventListener("typeColumn", "click", gMainPane.sort);
setEventListener("actionColumn", "click", gMainPane.sort);
setEventListener("chooseFolder", "command", gMainPane.chooseFolder);
setEventListener("saveWhere", "command", gMainPane.handleSaveToCommand);
Preferences.get("browser.download.dir").on("change",
gMainPane.displayDownloadDirPref.bind(gMainPane));

View File

@ -37,7 +37,6 @@
<!ENTITY % clearSiteDataDTD SYSTEM
"chrome://browser/locale/preferences/clearSiteData.dtd" >
<!ENTITY % privacyDTD SYSTEM "chrome://browser/locale/preferences/privacy.dtd">
<!ENTITY % searchDTD SYSTEM "chrome://browser/locale/preferences/search.dtd">
<!ENTITY % syncBrandDTD SYSTEM "chrome://browser/locale/syncBrand.dtd">
<!ENTITY % syncDTD SYSTEM "chrome://browser/locale/preferences/sync.dtd">
<!ENTITY % securityDTD SYSTEM
@ -68,7 +67,6 @@
%siteDataSettingsDTD;
%clearSiteDataDTD;
%privacyDTD;
%searchDTD;
%syncBrandDTD;
%syncDTD;
%securityDTD;
@ -210,7 +208,7 @@
</hbox>
<textbox
type="search" id="searchInput"
data-l10n-id="search-input"
data-l10n-id="search-input-box"
data-l10n-attrs="style"
hidden="true" clickSelectsAll="true"/>
</hbox>

View File

@ -356,12 +356,16 @@ var gSearchPane = {
// Notify the user if they have chosen an existing engine/bookmark keyword
if (eduplicate || bduplicate) {
let strings = document.getElementById("engineManagerBundle");
let dtitle = strings.getString("duplicateTitle");
let bmsg = strings.getString("duplicateBookmarkMsg");
let emsg = strings.getFormattedString("duplicateEngineMsg", [dupName]);
let msgids = [["search-keyword-warning-title"]];
if (eduplicate) {
msgids.push(["search-keyword-warning-engine", { name: dupName }]);
} else {
msgids.push(["search-keyword-warning-bookmark"]);
}
Services.prompt.alert(window, dtitle, eduplicate ? emsg : bmsg);
let [dtitle, msg] = await document.l10n.formatValues(msgids);
Services.prompt.alert(window, dtitle, msg);
return false;
}
}

View File

@ -1,29 +1,27 @@
<script type="application/javascript"
src="chrome://browser/content/preferences/in-content/search.js"/>
<stringbundle id="engineManagerBundle" src="chrome://browser/locale/engineManager.properties"/>
<hbox id="searchCategory"
class="subcategory"
hidden="true"
data-category="paneSearch">
<label class="header-name" flex="1">&paneSearch.title;</label>
<label class="header-name" flex="1" data-l10n-id="pane-search-title" />
</hbox>
<groupbox id="searchbarGroup" data-category="paneSearch">
<caption><label id="searchbarLabel">&searchBar.label;</label></caption>
<caption><label id="searchbarLabel" data-l10n-id="search-bar-header" /></caption>
<radiogroup id="searchBarVisibleGroup" aria-labelledby="searchbarLabel" preference="browser.search.widget.inNavBar">
<radio id="searchBarHiddenRadio" value="false" label="&searchBar.hidden.label;"/>
<radio id="searchBarHiddenRadio" value="false" data-l10n-id="search-bar-hidden"/>
<image class="searchBarImage searchBarHiddenImage" role="presentation"/>
<radio id="searchBarShownRadio" value="true" label="&searchBar.shown.label;"/>
<radio id="searchBarShownRadio" value="true" data-l10n-id="search-bar-shown"/>
<image class="searchBarImage searchBarShownImage" role="presentation"/>
</radiogroup>
</groupbox>
<!-- Default Search Engine -->
<groupbox id="defaultEngineGroup" data-category="paneSearch">
<caption><label>&defaultSearchEngine.label;</label></caption>
<description>&chooseYourDefaultSearchEngine2.label;</description>
<caption><label data-l10n-id="search-engine-default-header" /></caption>
<description data-l10n-id="search-engine-default-desc" />
<hbox id="browserDefaultSearchExtensionContent" align="center" hidden="true">
<description control="disableDefaultSearchExtension" flex="1"/>
@ -39,50 +37,46 @@
</hbox>
<checkbox id="suggestionsInSearchFieldsCheckbox"
label="&provideSearchSuggestions.label;"
accesskey="&provideSearchSuggestions.accesskey;"
data-l10n-id="search-suggestions-option"
preference="browser.search.suggest.enabled"/>
<vbox class="indent">
<checkbox id="urlBarSuggestion" label="&showURLBarSuggestions2.label;"
accesskey="&showURLBarSuggestions2.accesskey;"/>
<checkbox id="urlBarSuggestion" data-l10n-id="search-show-suggestions-url-bar-option" />
<checkbox id="showSearchSuggestionsFirstCheckbox"
label="&showSearchSuggestionsAboveHistory.label;"/>
data-l10n-id="search-show-suggestions-above-history-option"/>
<hbox id="urlBarSuggestionPermanentPBLabel"
align="center" class="indent">
<label flex="1">&urlBarSuggestionsPermanentPB.label;</label>
<label flex="1" data-l10n-id="search-suggestions-cant-show" />
</hbox>
</vbox>
</groupbox>
<groupbox id="oneClickSearchProvidersGroup" data-category="paneSearch">
<caption><label>&oneClickSearchEngines.label;</label></caption>
<description>&chooseWhichOneToDisplay2.label;</description>
<caption><label data-l10n-id="search-one-click-header" /></caption>
<description data-l10n-id="search-one-click-desc" />
<tree id="engineList" flex="1" rows="8" hidecolumnpicker="true" editable="true"
seltype="single" allowunderflowscroll="true">
<treechildren id="engineChildren" flex="1"/>
<treecols>
<treecol id="engineShown" type="checkbox" editable="true" sortable="false"/>
<treecol id="engineName" flex="4" label="&engineNameColumn.label;" sortable="false"/>
<treecol id="engineKeyword" flex="1" label="&engineKeywordColumn.label;" editable="true"
<treecol id="engineName" flex="4" data-l10n-id="search-choose-engine-column" sortable="false"/>
<treecol id="engineKeyword" flex="1" data-l10n-id="search-choose-keyword-column" editable="true"
sortable="false"/>
</treecols>
</tree>
<hbox>
<button id="restoreDefaultSearchEngines"
label="&restoreDefaultSearchEngines.label;"
accesskey="&restoreDefaultSearchEngines.accesskey;"
data-l10n-id="search-restore-default"
/>
<spacer flex="1"/>
<button id="removeEngineButton"
class="searchEngineAction"
label="&removeEngine.label;"
accesskey="&removeEngine.accesskey;"
data-l10n-id="search-remove-engine"
disabled="true"
/>
</hbox>
<hbox id="addEnginesBox" pack="start">
<label id="addEngines" class="text-link">&findMoreSearchEngines.label;</label>
<label id="addEngines" class="text-link" data-l10n-id="search-find-more-link"></label>
</hbox>
</groupbox>

View File

@ -2,19 +2,19 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this file,
- You can obtain one at http://mozilla.org/MPL/2.0/. -->
<stringbundle id="searchResultBundle" src="chrome://browser/locale/preferences/preferences.properties"/>
<hbox id="header-searchResults"
class="subcategory"
hidden="true"
data-category="paneSearchResults">
<label class="header-name" flex="1">&paneSearchResults.title;</label>
<label class="header-name" flex="1" data-l10n-id="search-results-header" />
</hbox>
<groupbox class="no-results-message" data-category="paneSearchResults" hidden="true">
<vbox class="no-results-container">
<label id="sorry-message"></label>
<label id="need-help"></label>
<label id="need-help" data-l10n-id="search-results-need-help">
<a class="text-link" target="_blank"></a>
</label>
</vbox>
<vbox class="no-results-container" align="center">
<image></image>

View File

@ -113,6 +113,7 @@ add_task(async function() {
if (child.id == "paneGeneral"
|| child.id == "startupGroup"
|| child.id == "homepageGroup"
|| child.id == "homeContentsGroup"
|| child.id == "languagesGroup"
|| child.id == "fontsGroup"
|| child.id == "downloadsGroup"
@ -131,7 +132,7 @@ add_task(async function() {
|| child.id == "networkProxyCategory") {
is_element_visible(child, "Should be in general tab");
} else if (child.id) {
is_element_hidden(child, "Should not be in general tab");
is_element_hidden(child, `Should not be in general tab: ${child.id}`);
}
}

View File

@ -3,7 +3,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* eslint-env mozilla/places-overlay */
/* import-globals-from ../../../toolkit/components/places/PlacesUtils.jsm */
/* import-globals-from ../../../toolkit/content/globalOverlay.js */
/**
* SelectBookmarkDialog controls the user interface for the "Use Bookmark for

View File

@ -9,8 +9,6 @@
<?xml-stylesheet href="chrome://global/skin/"?>
<?xml-stylesheet href="chrome://browser/skin/places/places.css"?>
<?xul-overlay href="chrome://browser/content/places/placesOverlay.xul"?>
<!DOCTYPE dialog SYSTEM "chrome://browser/locale/preferences/selectBookmark.dtd">
<dialog id="selectBookmarkDialog"
@ -22,7 +20,25 @@
<script type="application/javascript"
src="chrome://browser/content/preferences/selectBookmark.js"/>
<script type="application/javascript"
src="chrome://global/content/globalOverlay.js"/>
<script type="application/javascript"
src="chrome://browser/content/utilityOverlay.js"/>
<script type="application/javascript"><![CDATA[
ChromeUtils.defineModuleGetter(window,
"PlacesUtils", "resource://gre/modules/PlacesUtils.jsm");
ChromeUtils.defineModuleGetter(window,
"PlacesUIUtils", "resource:///modules/PlacesUIUtils.jsm");
ChromeUtils.defineModuleGetter(window,
"PlacesTransactions", "resource://gre/modules/PlacesTransactions.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyScriptGetter(window, "PlacesTreeView",
"chrome://browser/content/places/treeView.js");
XPCOMUtils.defineLazyScriptGetter(window,
["PlacesInsertionPoint", "PlacesController", "PlacesControllerDragHelper"],
"chrome://browser/content/places/controller.js");
]]></script>
<description>&selectBookmark.label;</description>
<separator class="thin"/>

View File

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
ChromeUtils.import("resource://gre/modules/ForgetAboutSite.jsm");
let {ForgetAboutSite} = ChromeUtils.import("resource://gre/modules/ForgetAboutSite.jsm", {});
function promiseClearHistory() {
return new Promise(resolve => {

View File

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
ChromeUtils.import("resource://gre/modules/ForgetAboutSite.jsm");
let {ForgetAboutSite} = ChromeUtils.import("resource://gre/modules/ForgetAboutSite.jsm", {});
function promiseClearHistory() {
return new Promise(resolve => {

View File

@ -16,7 +16,10 @@ var tooltip = document.getElementById("UITourTooltip");
function test() {
registerCleanupFunction(() => {
// Close the find bar in case it's open in the remaining tab
gBrowser.getFindBar(gBrowser.selectedTab).close();
let findBar = gBrowser.getCachedFindBar(gBrowser.selectedTab);
if (findBar) {
findBar.close();
}
});
UITourTest();
}

View File

@ -35,8 +35,7 @@ const INITIAL_STATE = {
visible: false,
data: {}
},
Sections: [],
PreferencesPane: {visible: false}
Sections: []
};
function App(prevState = INITIAL_STATE.App, action) {
@ -328,21 +327,10 @@ function Snippets(prevState = INITIAL_STATE.Snippets, action) {
}
}
function PreferencesPane(prevState = INITIAL_STATE.PreferencesPane, action) {
switch (action.type) {
case at.SETTINGS_OPEN:
return Object.assign({}, prevState, {visible: true});
case at.SETTINGS_CLOSE:
return Object.assign({}, prevState, {visible: false});
default:
return prevState;
}
}
this.INITIAL_STATE = INITIAL_STATE;
this.TOP_SITES_DEFAULT_ROWS = TOP_SITES_DEFAULT_ROWS;
this.TOP_SITES_MAX_SITES_PER_ROW = TOP_SITES_MAX_SITES_PER_ROW;
this.reducers = {TopSites, App, Snippets, Prefs, Dialog, Sections, PreferencesPane};
this.reducers = {TopSites, App, Snippets, Prefs, Dialog, Sections};
const EXPORTED_SYMBOLS = ["reducers", "INITIAL_STATE", "insertPinned", "TOP_SITES_DEFAULT_ROWS", "TOP_SITES_MAX_SITES_PER_ROW"];

View File

@ -78,9 +78,6 @@ input {
background-image: url("../data/content/assets/glyph-edit-16.svg"); }
.icon.icon-pocket {
background-image: url("../data/content/assets/glyph-pocket-16.svg"); }
.icon.icon-pocket-small {
background-image: url("../data/content/assets/glyph-pocket-16.svg");
background-size: 12px; }
.icon.icon-historyItem {
background-image: url("../data/content/assets/glyph-historyItem-16.svg"); }
.icon.icon-trending {
@ -277,6 +274,21 @@ main {
.non-collapsible-section {
padding: 0 25px; }
.prefs-button button {
background-color: transparent;
border: 0;
cursor: pointer;
fill: rgba(12, 12, 13, 0.6);
offset-inline-end: 15px;
padding: 15px;
position: fixed;
top: 15px;
z-index: 12001; }
.prefs-button button:hover {
background-color: #EDEDF0; }
.prefs-button button:active {
background-color: #F9F9FA; }
.as-error-fallback {
align-items: center;
border-radius: 3px;
@ -810,146 +822,6 @@ main {
opacity: 0.4;
pointer-events: none; }
.prefs-pane {
color: #4A4A4F;
font-size: 14px;
line-height: 21px; }
.prefs-pane .sidebar {
background: #FFF;
border-left: 1px solid #D7D7DB;
box-shadow: 0 1px 4px 0 rgba(12, 12, 13, 0.1);
height: 100%;
offset-inline-end: 0;
overflow-y: auto;
padding: 40px;
position: fixed;
top: 0;
transition: 0.1s cubic-bezier(0, 0, 0, 1);
transition-property: transform;
width: 400px;
z-index: 12000; }
.prefs-pane .sidebar.hidden {
transform: translateX(100%); }
.prefs-pane .sidebar.hidden:dir(rtl) {
transform: translateX(-100%); }
.prefs-pane .sidebar h1 {
font-size: 21px;
margin: 0;
padding-top: 20px; }
.prefs-pane hr {
border: 0;
border-bottom: 1px solid #D7D7DB;
margin: 20px 0; }
.prefs-pane .prefs-modal-inner-wrapper {
padding-bottom: 100px; }
.prefs-pane .prefs-modal-inner-wrapper section {
margin: 20px 0; }
.prefs-pane .prefs-modal-inner-wrapper section p {
margin: 5px 0 20px 30px; }
.prefs-pane .prefs-modal-inner-wrapper section label {
display: inline-block;
position: relative;
width: 100%; }
.prefs-pane .prefs-modal-inner-wrapper section label input {
offset-inline-start: -30px;
position: absolute;
top: 0; }
.prefs-pane .prefs-modal-inner-wrapper section > label {
font-size: 16px;
font-weight: bold;
line-height: 19px; }
.prefs-pane .prefs-modal-inner-wrapper .options {
background: #F9F9FA;
border: 1px solid #D7D7DB;
border-radius: 2px;
margin: -10px 0 20px;
margin-inline-start: 30px;
padding: 10px; }
.prefs-pane .prefs-modal-inner-wrapper .options.disabled {
opacity: 0.5; }
.prefs-pane .prefs-modal-inner-wrapper .options label {
background-position-x: 35px;
background-position-y: 2.5px;
background-repeat: no-repeat;
display: inline-block;
font-size: 14px;
font-weight: normal;
height: auto;
line-height: 21px;
width: 100%; }
.prefs-pane .prefs-modal-inner-wrapper .options label:dir(rtl) {
background-position-x: right 35px; }
.prefs-pane .prefs-modal-inner-wrapper .options [type='checkbox']:not(:checked) + label,
.prefs-pane .prefs-modal-inner-wrapper .options [type='checkbox']:checked + label {
padding-inline-start: 63px; }
.prefs-pane .prefs-modal-inner-wrapper .options section {
margin: 0; }
.prefs-pane .actions {
background-color: #F9F9FA;
border-left: 1px solid #D7D7DB;
bottom: 0;
offset-inline-end: 0;
position: fixed;
width: 400px; }
.prefs-pane .actions button {
margin-inline-end: 20px; }
.prefs-pane [type='checkbox']:not(:checked),
.prefs-pane [type='checkbox']:checked {
offset-inline-start: -9999px;
position: absolute; }
.prefs-pane [type='checkbox']:not(:disabled):not(:checked) + label,
.prefs-pane [type='checkbox']:not(:disabled):checked + label {
cursor: pointer;
padding: 0 30px;
position: relative; }
.prefs-pane [type='checkbox']:not(:checked) + label::before,
.prefs-pane [type='checkbox']:checked + label::before {
background: #FFF;
border: 1px solid #B1B1B3;
border-radius: 3px;
content: '';
height: 21px;
offset-inline-start: 0;
position: absolute;
top: 0;
width: 21px; }
.prefs-pane [type='checkbox']:not(:checked) + label::after,
.prefs-pane [type='checkbox']:checked + label::after {
background: url("chrome://global/skin/in-content/check.svg") no-repeat center center;
content: '';
-moz-context-properties: fill, stroke;
fill: #0060DF;
height: 21px;
offset-inline-start: 0;
position: absolute;
stroke: none;
top: 0;
width: 21px; }
.prefs-pane [type='checkbox']:not(:checked) + label::after {
opacity: 0; }
.prefs-pane [type='checkbox']:checked + label::after {
opacity: 1; }
.prefs-pane [type='checkbox']:not(:disabled) + label:hover::before {
border: 1px solid #0060DF; }
.prefs-pane [type='checkbox']:not(:disabled):checked:focus + label::before,
.prefs-pane [type='checkbox']:not(:disabled):not(:checked):focus + label::before {
border: 1px dotted #0060DF; }
.prefs-pane-button button {
background-color: transparent;
border: 0;
cursor: pointer;
fill: rgba(12, 12, 13, 0.6);
offset-inline-end: 15px;
padding: 15px;
position: fixed;
top: 15px;
z-index: 12001; }
.prefs-pane-button button:hover {
background-color: #EDEDF0; }
.prefs-pane-button button:active {
background-color: #F9F9FA; }
.confirmation-dialog .modal {
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.1);
left: 50%;

File diff suppressed because one or more lines are too long

View File

@ -78,9 +78,6 @@ input {
background-image: url("../data/content/assets/glyph-edit-16.svg"); }
.icon.icon-pocket {
background-image: url("../data/content/assets/glyph-pocket-16.svg"); }
.icon.icon-pocket-small {
background-image: url("../data/content/assets/glyph-pocket-16.svg");
background-size: 12px; }
.icon.icon-historyItem {
background-image: url("../data/content/assets/glyph-historyItem-16.svg"); }
.icon.icon-trending {
@ -277,6 +274,21 @@ main {
.non-collapsible-section {
padding: 0 25px; }
.prefs-button button {
background-color: transparent;
border: 0;
cursor: pointer;
fill: rgba(12, 12, 13, 0.6);
offset-inline-end: 15px;
padding: 15px;
position: fixed;
top: 15px;
z-index: 12001; }
.prefs-button button:hover {
background-color: #EDEDF0; }
.prefs-button button:active {
background-color: #F9F9FA; }
.as-error-fallback {
align-items: center;
border-radius: 3px;
@ -810,146 +822,6 @@ main {
opacity: 0.4;
pointer-events: none; }
.prefs-pane {
color: #4A4A4F;
font-size: 14px;
line-height: 21px; }
.prefs-pane .sidebar {
background: #FFF;
border-left: 1px solid #D7D7DB;
box-shadow: 0 1px 4px 0 rgba(12, 12, 13, 0.1);
height: 100%;
offset-inline-end: 0;
overflow-y: auto;
padding: 40px;
position: fixed;
top: 0;
transition: 0.1s cubic-bezier(0, 0, 0, 1);
transition-property: transform;
width: 400px;
z-index: 12000; }
.prefs-pane .sidebar.hidden {
transform: translateX(100%); }
.prefs-pane .sidebar.hidden:dir(rtl) {
transform: translateX(-100%); }
.prefs-pane .sidebar h1 {
font-size: 21px;
margin: 0;
padding-top: 20px; }
.prefs-pane hr {
border: 0;
border-bottom: 1px solid #D7D7DB;
margin: 20px 0; }
.prefs-pane .prefs-modal-inner-wrapper {
padding-bottom: 100px; }
.prefs-pane .prefs-modal-inner-wrapper section {
margin: 20px 0; }
.prefs-pane .prefs-modal-inner-wrapper section p {
margin: 5px 0 20px 30px; }
.prefs-pane .prefs-modal-inner-wrapper section label {
display: inline-block;
position: relative;
width: 100%; }
.prefs-pane .prefs-modal-inner-wrapper section label input {
offset-inline-start: -30px;
position: absolute;
top: 0; }
.prefs-pane .prefs-modal-inner-wrapper section > label {
font-size: 16px;
font-weight: bold;
line-height: 19px; }
.prefs-pane .prefs-modal-inner-wrapper .options {
background: #F9F9FA;
border: 1px solid #D7D7DB;
border-radius: 2px;
margin: -10px 0 20px;
margin-inline-start: 30px;
padding: 10px; }
.prefs-pane .prefs-modal-inner-wrapper .options.disabled {
opacity: 0.5; }
.prefs-pane .prefs-modal-inner-wrapper .options label {
background-position-x: 35px;
background-position-y: 2.5px;
background-repeat: no-repeat;
display: inline-block;
font-size: 14px;
font-weight: normal;
height: auto;
line-height: 21px;
width: 100%; }
.prefs-pane .prefs-modal-inner-wrapper .options label:dir(rtl) {
background-position-x: right 35px; }
.prefs-pane .prefs-modal-inner-wrapper .options [type='checkbox']:not(:checked) + label,
.prefs-pane .prefs-modal-inner-wrapper .options [type='checkbox']:checked + label {
padding-inline-start: 63px; }
.prefs-pane .prefs-modal-inner-wrapper .options section {
margin: 0; }
.prefs-pane .actions {
background-color: #F9F9FA;
border-left: 1px solid #D7D7DB;
bottom: 0;
offset-inline-end: 0;
position: fixed;
width: 400px; }
.prefs-pane .actions button {
margin-inline-end: 20px; }
.prefs-pane [type='checkbox']:not(:checked),
.prefs-pane [type='checkbox']:checked {
offset-inline-start: -9999px;
position: absolute; }
.prefs-pane [type='checkbox']:not(:disabled):not(:checked) + label,
.prefs-pane [type='checkbox']:not(:disabled):checked + label {
cursor: pointer;
padding: 0 30px;
position: relative; }
.prefs-pane [type='checkbox']:not(:checked) + label::before,
.prefs-pane [type='checkbox']:checked + label::before {
background: #FFF;
border: 1px solid #B1B1B3;
border-radius: 3px;
content: '';
height: 21px;
offset-inline-start: 0;
position: absolute;
top: 0;
width: 21px; }
.prefs-pane [type='checkbox']:not(:checked) + label::after,
.prefs-pane [type='checkbox']:checked + label::after {
background: url("chrome://global/skin/in-content/check.svg") no-repeat center center;
content: '';
-moz-context-properties: fill, stroke;
fill: #0060DF;
height: 21px;
offset-inline-start: 0;
position: absolute;
stroke: none;
top: 0;
width: 21px; }
.prefs-pane [type='checkbox']:not(:checked) + label::after {
opacity: 0; }
.prefs-pane [type='checkbox']:checked + label::after {
opacity: 1; }
.prefs-pane [type='checkbox']:not(:disabled) + label:hover::before {
border: 1px solid #0060DF; }
.prefs-pane [type='checkbox']:not(:disabled):checked:focus + label::before,
.prefs-pane [type='checkbox']:not(:disabled):not(:checked):focus + label::before {
border: 1px dotted #0060DF; }
.prefs-pane-button button {
background-color: transparent;
border: 0;
cursor: pointer;
fill: rgba(12, 12, 13, 0.6);
offset-inline-end: 15px;
padding: 15px;
position: fixed;
top: 15px;
z-index: 12001; }
.prefs-pane-button button:hover {
background-color: #EDEDF0; }
.prefs-pane-button button:active {
background-color: #F9F9FA; }
.confirmation-dialog .modal {
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.1);
left: 50%;

File diff suppressed because one or more lines are too long

View File

@ -78,9 +78,6 @@ input {
background-image: url("../data/content/assets/glyph-edit-16.svg"); }
.icon.icon-pocket {
background-image: url("../data/content/assets/glyph-pocket-16.svg"); }
.icon.icon-pocket-small {
background-image: url("../data/content/assets/glyph-pocket-16.svg");
background-size: 12px; }
.icon.icon-historyItem {
background-image: url("../data/content/assets/glyph-historyItem-16.svg"); }
.icon.icon-trending {
@ -277,6 +274,21 @@ main {
.non-collapsible-section {
padding: 0 25px; }
.prefs-button button {
background-color: transparent;
border: 0;
cursor: pointer;
fill: rgba(12, 12, 13, 0.6);
offset-inline-end: 15px;
padding: 15px;
position: fixed;
top: 15px;
z-index: 12001; }
.prefs-button button:hover {
background-color: #EDEDF0; }
.prefs-button button:active {
background-color: #F9F9FA; }
.as-error-fallback {
align-items: center;
border-radius: 3px;
@ -810,146 +822,6 @@ main {
opacity: 0.4;
pointer-events: none; }
.prefs-pane {
color: #4A4A4F;
font-size: 14px;
line-height: 21px; }
.prefs-pane .sidebar {
background: #FFF;
border-left: 1px solid #D7D7DB;
box-shadow: 0 1px 4px 0 rgba(12, 12, 13, 0.1);
height: 100%;
offset-inline-end: 0;
overflow-y: auto;
padding: 40px;
position: fixed;
top: 0;
transition: 0.1s cubic-bezier(0, 0, 0, 1);
transition-property: transform;
width: 400px;
z-index: 12000; }
.prefs-pane .sidebar.hidden {
transform: translateX(100%); }
.prefs-pane .sidebar.hidden:dir(rtl) {
transform: translateX(-100%); }
.prefs-pane .sidebar h1 {
font-size: 21px;
margin: 0;
padding-top: 20px; }
.prefs-pane hr {
border: 0;
border-bottom: 1px solid #D7D7DB;
margin: 20px 0; }
.prefs-pane .prefs-modal-inner-wrapper {
padding-bottom: 100px; }
.prefs-pane .prefs-modal-inner-wrapper section {
margin: 20px 0; }
.prefs-pane .prefs-modal-inner-wrapper section p {
margin: 5px 0 20px 30px; }
.prefs-pane .prefs-modal-inner-wrapper section label {
display: inline-block;
position: relative;
width: 100%; }
.prefs-pane .prefs-modal-inner-wrapper section label input {
offset-inline-start: -30px;
position: absolute;
top: 0; }
.prefs-pane .prefs-modal-inner-wrapper section > label {
font-size: 16px;
font-weight: bold;
line-height: 19px; }
.prefs-pane .prefs-modal-inner-wrapper .options {
background: #F9F9FA;
border: 1px solid #D7D7DB;
border-radius: 2px;
margin: -10px 0 20px;
margin-inline-start: 30px;
padding: 10px; }
.prefs-pane .prefs-modal-inner-wrapper .options.disabled {
opacity: 0.5; }
.prefs-pane .prefs-modal-inner-wrapper .options label {
background-position-x: 35px;
background-position-y: 2.5px;
background-repeat: no-repeat;
display: inline-block;
font-size: 14px;
font-weight: normal;
height: auto;
line-height: 21px;
width: 100%; }
.prefs-pane .prefs-modal-inner-wrapper .options label:dir(rtl) {
background-position-x: right 35px; }
.prefs-pane .prefs-modal-inner-wrapper .options [type='checkbox']:not(:checked) + label,
.prefs-pane .prefs-modal-inner-wrapper .options [type='checkbox']:checked + label {
padding-inline-start: 63px; }
.prefs-pane .prefs-modal-inner-wrapper .options section {
margin: 0; }
.prefs-pane .actions {
background-color: #F9F9FA;
border-left: 1px solid #D7D7DB;
bottom: 0;
offset-inline-end: 0;
position: fixed;
width: 400px; }
.prefs-pane .actions button {
margin-inline-end: 20px; }
.prefs-pane [type='checkbox']:not(:checked),
.prefs-pane [type='checkbox']:checked {
offset-inline-start: -9999px;
position: absolute; }
.prefs-pane [type='checkbox']:not(:disabled):not(:checked) + label,
.prefs-pane [type='checkbox']:not(:disabled):checked + label {
cursor: pointer;
padding: 0 30px;
position: relative; }
.prefs-pane [type='checkbox']:not(:checked) + label::before,
.prefs-pane [type='checkbox']:checked + label::before {
background: #FFF;
border: 1px solid #B1B1B3;
border-radius: 3px;
content: '';
height: 21px;
offset-inline-start: 0;
position: absolute;
top: 0;
width: 21px; }
.prefs-pane [type='checkbox']:not(:checked) + label::after,
.prefs-pane [type='checkbox']:checked + label::after {
background: url("chrome://global/skin/in-content/check.svg") no-repeat center center;
content: '';
-moz-context-properties: fill, stroke;
fill: #0060DF;
height: 21px;
offset-inline-start: 0;
position: absolute;
stroke: none;
top: 0;
width: 21px; }
.prefs-pane [type='checkbox']:not(:checked) + label::after {
opacity: 0; }
.prefs-pane [type='checkbox']:checked + label::after {
opacity: 1; }
.prefs-pane [type='checkbox']:not(:disabled) + label:hover::before {
border: 1px solid #0060DF; }
.prefs-pane [type='checkbox']:not(:disabled):checked:focus + label::before,
.prefs-pane [type='checkbox']:not(:disabled):not(:checked):focus + label::before {
border: 1px dotted #0060DF; }
.prefs-pane-button button {
background-color: transparent;
border: 0;
cursor: pointer;
fill: rgba(12, 12, 13, 0.6);
offset-inline-end: 15px;
padding: 15px;
position: fixed;
top: 15px;
z-index: 12001; }
.prefs-pane-button button:hover {
background-color: #EDEDF0; }
.prefs-pane-button button:active {
background-color: #F9F9FA; }
.confirmation-dialog .modal {
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.1);
left: 50%;

File diff suppressed because one or more lines are too long

View File

@ -501,8 +501,7 @@ const INITIAL_STATE = {
visible: false,
data: {}
},
Sections: [],
PreferencesPane: { visible: false }
Sections: []
};
/* unused harmony export INITIAL_STATE */
@ -797,18 +796,7 @@ function Snippets(prevState = INITIAL_STATE.Snippets, action) {
}
}
function PreferencesPane(prevState = INITIAL_STATE.PreferencesPane, action) {
switch (action.type) {
case Actions["b" /* actionTypes */].SETTINGS_OPEN:
return Object.assign({}, prevState, { visible: true });
case Actions["b" /* actionTypes */].SETTINGS_CLOSE:
return Object.assign({}, prevState, { visible: false });
default:
return prevState;
}
}
var reducers = { TopSites, App, Snippets, Prefs, Dialog, Sections, PreferencesPane };
var reducers = { TopSites, App, Snippets, Prefs, Dialog, Sections };
/***/ }),
/* 7 */
@ -2868,205 +2856,6 @@ class ManualMigration__ManualMigration extends external__React__default.a.PureCo
}
const ManualMigration = Object(external__ReactRedux_["connect"])()(ManualMigration__ManualMigration);
// CONCATENATED MODULE: ./system-addon/content-src/components/PreferencesPane/PreferencesPane.jsx
const getFormattedMessage = message => typeof message === "string" ? external__React__default.a.createElement(
"span",
null,
message
) : external__React__default.a.createElement(external__ReactIntl_["FormattedMessage"], message);
const PreferencesInput = props => external__React__default.a.createElement(
"section",
null,
external__React__default.a.createElement("input", { type: "checkbox", id: props.prefName, name: props.prefName, checked: props.value, disabled: props.disabled, onChange: props.onChange, className: props.className }),
external__React__default.a.createElement(
"label",
{ htmlFor: props.prefName, className: props.labelClassName },
getFormattedMessage(props.titleString)
),
props.descString && external__React__default.a.createElement(
"p",
{ className: "prefs-input-description" },
getFormattedMessage(props.descString)
),
external__React__default.a.Children.map(props.children, child => external__React__default.a.createElement(
"div",
{ className: `options${child.props.disabled ? " disabled" : ""}` },
child
))
);
class PreferencesPane__PreferencesPane extends external__React__default.a.PureComponent {
constructor(props) {
super(props);
this.handleClickOutside = this.handleClickOutside.bind(this);
this.handlePrefChange = this.handlePrefChange.bind(this);
this.handleSectionChange = this.handleSectionChange.bind(this);
this.togglePane = this.togglePane.bind(this);
this.onWrapperMount = this.onWrapperMount.bind(this);
}
componentDidUpdate(prevProps, prevState) {
if (prevProps.PreferencesPane.visible !== this.props.PreferencesPane.visible) {
// While the sidebar is open, listen for all document clicks.
if (this.isSidebarOpen()) {
document.addEventListener("click", this.handleClickOutside);
} else {
document.removeEventListener("click", this.handleClickOutside);
}
}
}
isSidebarOpen() {
return this.props.PreferencesPane.visible;
}
handleClickOutside(event) {
// if we are showing the sidebar and there is a click outside, close it.
if (this.isSidebarOpen() && !this.wrapper.contains(event.target)) {
this.togglePane();
}
}
handlePrefChange({ target: { name, checked } }) {
let value = checked;
if (name === "topSitesRows") {
value = checked ? 2 : 1;
}
this.props.dispatch(Actions["a" /* actionCreators */].SetPref(name, value));
}
handleSectionChange({ target }) {
const id = target.name;
const type = target.checked ? Actions["b" /* actionTypes */].SECTION_ENABLE : Actions["b" /* actionTypes */].SECTION_DISABLE;
this.props.dispatch(Actions["a" /* actionCreators */].AlsoToMain({ type, data: id }));
}
togglePane() {
if (this.isSidebarOpen()) {
this.props.dispatch({ type: Actions["b" /* actionTypes */].SETTINGS_CLOSE });
this.props.dispatch(Actions["a" /* actionCreators */].UserEvent({ event: "CLOSE_NEWTAB_PREFS" }));
} else {
this.props.dispatch({ type: Actions["b" /* actionTypes */].SETTINGS_OPEN });
this.props.dispatch(Actions["a" /* actionCreators */].UserEvent({ event: "OPEN_NEWTAB_PREFS" }));
}
}
onWrapperMount(wrapper) {
this.wrapper = wrapper;
}
render() {
const { props } = this;
const prefs = props.Prefs.values;
const sections = props.Sections;
const isVisible = this.isSidebarOpen();
return external__React__default.a.createElement(
"div",
{ className: "prefs-pane-wrapper", ref: this.onWrapperMount },
external__React__default.a.createElement(
"div",
{ className: "prefs-pane-button" },
external__React__default.a.createElement("button", {
className: `prefs-button icon ${isVisible ? "icon-dismiss" : "icon-settings"}`,
title: props.intl.formatMessage({ id: isVisible ? "settings_pane_done_button" : "settings_pane_button_label" }),
onClick: this.togglePane })
),
external__React__default.a.createElement(
"div",
{ className: "prefs-pane" },
external__React__default.a.createElement(
"div",
{ className: `sidebar ${isVisible ? "" : "hidden"}` },
external__React__default.a.createElement(
"div",
{ className: "prefs-modal-inner-wrapper" },
external__React__default.a.createElement(
"h1",
null,
external__React__default.a.createElement(external__ReactIntl_["FormattedMessage"], { id: "settings_pane_header" })
),
external__React__default.a.createElement(
"p",
null,
external__React__default.a.createElement(external__ReactIntl_["FormattedMessage"], { id: "settings_pane_body2" })
),
external__React__default.a.createElement(PreferencesInput, {
className: "showSearch",
prefName: "showSearch",
value: prefs.showSearch,
onChange: this.handlePrefChange,
titleString: { id: "settings_pane_search_header" },
descString: { id: "settings_pane_search_body" } }),
external__React__default.a.createElement("hr", null),
external__React__default.a.createElement(
PreferencesInput,
{
className: "showTopSites",
prefName: "showTopSites",
value: prefs.showTopSites,
onChange: this.handlePrefChange,
titleString: { id: "settings_pane_topsites_header" },
descString: { id: "settings_pane_topsites_body" } },
external__React__default.a.createElement(PreferencesInput, {
className: "showMoreTopSites",
prefName: "topSitesRows",
disabled: !prefs.showTopSites,
value: prefs.topSitesRows === 2,
onChange: this.handlePrefChange,
titleString: { id: "settings_pane_topsites_options_showmore" },
labelClassName: "icon icon-topsites" })
),
sections.filter(section => !section.shouldHidePref).map(({ id, title, enabled, pref }) => external__React__default.a.createElement(
PreferencesInput,
{
key: id,
className: "showSection",
prefName: pref && pref.feed || id,
value: enabled,
onChange: pref && pref.feed ? this.handlePrefChange : this.handleSectionChange,
titleString: pref && pref.titleString || title,
descString: pref && pref.descString },
pref && pref.nestedPrefs && pref.nestedPrefs.map(nestedPref => external__React__default.a.createElement(PreferencesInput, {
key: nestedPref.name,
prefName: nestedPref.name,
disabled: !enabled,
value: prefs[nestedPref.name],
onChange: this.handlePrefChange,
titleString: nestedPref.titleString,
labelClassName: `icon ${nestedPref.icon}` }))
)),
!prefs.disableSnippets && external__React__default.a.createElement("hr", null),
!prefs.disableSnippets && external__React__default.a.createElement(PreferencesInput, { className: "showSnippets", prefName: "feeds.snippets",
value: prefs["feeds.snippets"], onChange: this.handlePrefChange,
titleString: { id: "settings_pane_snippets_header" },
descString: { id: "settings_pane_snippets_body" } })
),
external__React__default.a.createElement(
"section",
{ className: "actions" },
external__React__default.a.createElement(
"button",
{ className: "done", onClick: this.togglePane },
external__React__default.a.createElement(external__ReactIntl_["FormattedMessage"], { id: "settings_pane_done_button" })
)
)
)
)
);
}
}
const PreferencesPane = Object(external__ReactRedux_["connect"])(state => ({
Prefs: state.Prefs,
PreferencesPane: state.PreferencesPane,
Sections: state.Sections
}))(Object(external__ReactIntl_["injectIntl"])(PreferencesPane__PreferencesPane));
// CONCATENATED MODULE: ./system-addon/common/PrerenderData.jsm
class _PrerenderData {
constructor(options) {
@ -3273,6 +3062,11 @@ var Sections = __webpack_require__(18);
const PrefsButton = Object(external__ReactIntl_["injectIntl"])(props => external__React__default.a.createElement(
"div",
{ className: "prefs-button" },
external__React__default.a.createElement("button", { className: "icon icon-settings", onClick: props.onClick, title: props.intl.formatMessage({ id: "settings_pane_button_label" }) })
));
// Add the locale data for pluralization and relative-time formatting for now,
// this just uses english locale data. We can make this more sophisticated if
@ -3336,6 +3130,16 @@ class Base__Base extends external__React__default.a.PureComponent {
class Base_BaseContent extends external__React__default.a.PureComponent {
constructor(props) {
super(props);
this.openPreferences = this.openPreferences.bind(this);
}
openPreferences() {
this.props.dispatch(Actions["a" /* actionCreators */].OnlyToMain({ type: Actions["b" /* actionTypes */].SETTINGS_OPEN }));
this.props.dispatch(Actions["a" /* actionCreators */].UserEvent({ event: "OPEN_NEWTAB_PREFS" }));
}
render() {
const { props } = this;
const { App } = props;
@ -3369,20 +3173,10 @@ class Base_BaseContent extends external__React__default.a.PureComponent {
{ className: "non-collapsible-section" },
external__React__default.a.createElement(ManualMigration, null)
),
external__React__default.a.createElement(Sections["a" /* Sections */], null)
external__React__default.a.createElement(Sections["a" /* Sections */], null),
external__React__default.a.createElement(PrefsButton, { onClick: this.openPreferences })
),
external__React__default.a.createElement(ConfirmDialog, null)
),
initialized && external__React__default.a.createElement(
"div",
{ className: "prefs-pane" },
external__React__default.a.createElement(
ErrorBoundary["a" /* ErrorBoundary */],
{ className: "sidebar" },
" ",
external__React__default.a.createElement(PreferencesPane, null),
" "
)
)
);
}
@ -3701,7 +3495,7 @@ const cardContextTypes = {
},
pocket: {
intlID: "type_label_pocket",
icon: "pocket-small"
icon: "pocket"
}
};
// EXTERNAL MODULE: external "ReactIntl"
@ -4012,7 +3806,7 @@ const SectionMenuOptions = {
ManageSection: section => ({
id: "section_menu_action_manage_section",
icon: "settings",
action: { type: Actions["b" /* actionTypes */].SETTINGS_OPEN },
action: Actions["a" /* actionCreators */].OnlyToMain({ type: Actions["b" /* actionTypes */].SETTINGS_OPEN }),
userEvent: "SECTION_MENU_MANAGE"
}),
AddTopSite: section => ({

File diff suppressed because one or more lines are too long

View File

@ -8,7 +8,7 @@
<em:type>2</em:type>
<em:bootstrap>true</em:bootstrap>
<em:unpack>false</em:unpack>
<em:version>2018.03.09.1399-ca5b7528</em:version>
<em:version>2018.03.15.1099-dc6b52e3</em:version>
<em:name>Activity Stream</em:name>
<em:description>A rich visual history feed and a reimagined home page make it easier than ever to find exactly what you're looking for in Firefox.</em:description>
<em:multiprocessCompatible>true</em:multiprocessCompatible>

View File

@ -0,0 +1,244 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
Cu.importGlobalProperties(["fetch"]);
ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.defineModuleGetter(this, "PluralForm", "resource://gre/modules/PluralForm.jsm");
const {actionTypes: at} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm", {});
const PREFERENCES_LOADED_EVENT = "sync-pane-loaded";
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
// These "section" objects are formatted in a way to be similar to the ones from
// SectionsManager to construct the preferences view.
const PREFS_BEFORE_SECTIONS = [
{
id: "search",
pref: {
feed: "showSearch",
titleString: "prefs_search_header"
},
icon: "chrome://browser/skin/search-glass.svg"
},
{
id: "topsites",
pref: {
feed: "showTopSites",
titleString: "settings_pane_topsites_header",
descString: "prefs_topsites_description"
},
icon: "topsites",
maxRows: 2,
rowsPref: "topSitesRows"
}
];
const PREFS_AFTER_SECTIONS = [
{
id: "snippets",
pref: {
feed: "feeds.snippets",
titleString: "settings_pane_snippets_header",
descString: "prefs_snippets_description"
},
icon: "info"
}
];
// This CSS is added to the whole about:preferences page
const CUSTOM_CSS = `
#homeContentsGroup checkbox[src] .checkbox-icon {
margin-inline-end: 8px;
margin-inline-start: 4px;
width: 16px;
}
`;
this.AboutPreferences = class AboutPreferences {
init() {
Services.obs.addObserver(this, PREFERENCES_LOADED_EVENT);
}
uninit() {
Services.obs.removeObserver(this, PREFERENCES_LOADED_EVENT);
}
onAction(action) {
switch (action.type) {
case at.INIT:
this.init();
break;
case at.UNINIT:
this.uninit();
break;
case at.SETTINGS_OPEN:
action._target.browser.ownerGlobal.openPreferences("paneHome", {origin: "aboutHome"});
break;
}
}
async observe(window) {
this.renderPreferences(window, await this.strings, [...PREFS_BEFORE_SECTIONS,
...this.store.getState().Sections, ...PREFS_AFTER_SECTIONS]);
}
/**
* Get strings from a js file that the content page would have loaded. The
* file should be a single variable assignment of a JSON/JS object of strings.
*/
get strings() {
return this._strings || (this._strings = new Promise(async resolve => {
let data = {};
try {
const locale = Cc["@mozilla.org/browser/aboutnewtab-service;1"]
.getService(Ci.nsIAboutNewTabService).activityStreamLocale;
const request = await fetch(`resource://activity-stream/prerendered/${locale}/activity-stream-strings.js`);
const text = await request.text();
const [json] = text.match(/{[^]*}/);
data = JSON.parse(json);
} catch (ex) {
Cu.reportError("Failed to load strings for Activity Stream about:preferences");
}
resolve(data);
}));
}
/**
* Render preferences to an about:preferences content window with the provided
* strings and preferences structure.
*/
renderPreferences({document, Preferences}, strings, prefStructure) {
// Helper to create a new element and append it
const createAppend = (tag, parent) => parent.appendChild(
document.createElementNS(XUL_NS, tag));
// Helper to get strings and format with values if necessary
const formatString = id => {
if (typeof id !== "object") {
return strings[id] || id;
}
let string = strings[id.id] || JSON.stringify(id);
if (id.values) {
Object.entries(id.values).forEach(([key, val]) => {
string = string.replace(new RegExp(`{${key}}`, "g"), val);
});
}
return string;
};
// Helper to link a UI element to a preference for updating
const linkPref = (element, name, type) => {
const fullPref = `browser.newtabpage.activity-stream.${name}`;
element.setAttribute("preference", fullPref);
Preferences.add({id: fullPref, type});
// Prevent changing the UI if the preference can't be changed
element.disabled = Preferences.get(fullPref).locked;
};
// Add in custom styling
document.insertBefore(document.createProcessingInstruction("xml-stylesheet",
`href="data:text/css,${encodeURIComponent(CUSTOM_CSS)}" type="text/css"`),
document.documentElement);
// Insert a new group immediately after the homepage one
const homeGroup = document.getElementById("homepageGroup");
const contentsGroup = homeGroup.insertAdjacentElement("afterend", homeGroup.cloneNode());
contentsGroup.id = "homeContentsGroup";
contentsGroup.setAttribute("data-subcategory", "contents");
const caption = createAppend("caption", contentsGroup);
caption.setAttribute("label", formatString("prefs_home_header"));
const description = createAppend("description", contentsGroup);
description.textContent = formatString("prefs_home_description");
// Add preferences for each section
prefStructure.forEach(sectionData => {
const {
id,
pref: prefData,
icon = "webextension",
maxRows,
rowsPref,
shouldHidePref
} = sectionData;
const {
feed: name,
titleString,
descString,
nestedPrefs = []
} = prefData || {};
// Don't show any sections that we don't want to expose in preferences UI
if (shouldHidePref) {
return;
}
// Use full icon spec for certain protocols or fall back to packaged icon
const iconUrl = !icon.search(/^(chrome|moz-extension|resource):/) ? icon :
`resource://activity-stream/data/content/assets/glyph-${icon}-16.svg`;
// Add the main preference for turning on/off a section
const sectionVbox = createAppend("vbox", contentsGroup);
sectionVbox.setAttribute("data-subcategory", id);
const checkbox = createAppend("checkbox", sectionVbox);
checkbox.setAttribute("label", formatString(titleString));
checkbox.setAttribute("src", iconUrl);
linkPref(checkbox, name, "bool");
// Add more details for the section (e.g., description, more prefs)
const detailVbox = createAppend("vbox", sectionVbox);
detailVbox.classList.add("indent");
detailVbox.classList.add("tip-caption");
if (descString) {
const label = createAppend("label", detailVbox);
label.classList.add("indent");
label.textContent = formatString(descString);
// Add a rows dropdown if we have a pref to control and a maximum
if (rowsPref && maxRows) {
const detailHbox = createAppend("hbox", detailVbox);
detailHbox.setAttribute("align", "center");
label.setAttribute("flex", 1);
detailHbox.appendChild(label);
// Add appropriate number of localized entries to the dropdown
const menulist = createAppend("menulist", detailHbox);
const menupopup = createAppend("menupopup", menulist);
for (let num = 1; num <= maxRows; num++) {
const plurals = formatString({id: "prefs_section_rows_option", values: {num}});
const item = createAppend("menuitem", menupopup);
item.setAttribute("label", PluralForm.get(num, plurals));
item.setAttribute("value", num);
}
linkPref(menulist, rowsPref, "int");
}
}
// Add a checkbox pref for any nested preferences
nestedPrefs.forEach(nested => {
const subcheck = createAppend("checkbox", detailVbox);
subcheck.classList.add("indent");
subcheck.setAttribute("label", formatString(nested.titleString));
linkPref(subcheck, nested.name, "bool");
// Specially add a link for sponsored content
if (nested.name === "showSponsored") {
const sponsoredHbox = createAppend("hbox", detailVbox);
sponsoredHbox.setAttribute("align", "center");
sponsoredHbox.appendChild(subcheck);
subcheck.classList.add("tail-with-learn-more");
const link = createAppend("label", sponsoredHbox);
link.classList.add("learn-sponsored");
link.classList.add("text-link");
link.setAttribute("href", sectionData.disclaimer.link.href);
link.textContent = formatString("prefs_topstories_sponsored_learn_more");
}
});
});
}
};
this.PREFERENCES_LOADED_EVENT = PREFERENCES_LOADED_EVENT;
const EXPORTED_SYMBOLS = ["AboutPreferences", "PREFERENCES_LOADED_EVENT"];

View File

@ -11,6 +11,7 @@ ChromeUtils.defineModuleGetter(this, "AppConstants",
// NB: Eagerly load modules that will be loaded/constructed/initialized in the
// common case to avoid the overhead of wrapping and detecting lazy loading.
const {actionCreators: ac, actionTypes: at} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm", {});
const {AboutPreferences} = ChromeUtils.import("resource://activity-stream/lib/AboutPreferences.jsm", {});
const {DefaultPrefs} = ChromeUtils.import("resource://activity-stream/lib/ActivityStreamPrefs.jsm", {});
const {ManualMigration} = ChromeUtils.import("resource://activity-stream/lib/ManualMigration.jsm", {});
const {NewTabInit} = ChromeUtils.import("resource://activity-stream/lib/NewTabInit.jsm", {});
@ -54,13 +55,11 @@ const PREFS_CONFIG = new Map([
api_key_pref: "extensions.pocket.oAuthConsumerKey",
// Use the opposite value as what default value the feed would have used
hidden: !PREFS_CONFIG.get("feeds.section.topstories").getValue(args),
provider_description: "pocket_description",
provider_icon: "pocket",
provider_name: "Pocket",
read_more_endpoint: "https://getpocket.com/explore/trending?src=fx_new_tab",
stories_endpoint: `https://getpocket.cdn.mozilla.net/v3/firefox/global-recs?version=3&consumer_key=$apiKey&locale_lang=${args.locale}`,
stories_referrer: "https://getpocket.com/recommendations",
privacy_notice_link: "https://www.mozilla.org/privacy/firefox/#suggest-relevant-content",
disclaimer_link: "https://getpocket.com/firefox/new_tab_learn_more",
topics_endpoint: `https://getpocket.cdn.mozilla.net/v3/firefox/trending-topics?version=2&consumer_key=$apiKey&locale_lang=${args.locale}`,
show_spocs: false,
@ -157,6 +156,12 @@ const PREFS_CONFIG = new Map([
// Array of each feed's FEEDS_CONFIG factory and values to add to PREFS_CONFIG
const FEEDS_DATA = [
{
name: "aboutpreferences",
factory: () => new AboutPreferences(),
title: "about:preferences rendering",
value: true
},
{
name: "migration",
factory: () => new ManualMigration(),

View File

@ -20,10 +20,10 @@ const BUILT_IN_SECTIONS = {
id: "topstories",
pref: {
titleString: {id: "header_recommended_by", values: {provider: options.provider_name}},
descString: {id: options.provider_description || "pocket_description"},
descString: {id: options.provider_description || "prefs_topstories_description"},
nestedPrefs: options.show_spocs ? [{
name: "showSponsored",
titleString: {id: "settings_pane_topstories_options_sponsored"},
titleString: {id: "prefs_topstories_show_sponsored_label", values: {provider: options.provider_name}},
icon: "icon-info"
}] : []
},
@ -54,7 +54,7 @@ const BUILT_IN_SECTIONS = {
id: "highlights",
pref: {
titleString: {id: "settings_pane_highlights_header"},
descString: {id: "settings_pane_highlights_body2"}
descString: {id: "prefs_highlights_description"}
},
shouldHidePref: false,
eventSource: "HIGHLIGHTS",

View File

@ -16,6 +16,8 @@ const EXTRAS_FIELD_NAMES = ["addon_version", "session_id", "page", "user_prefs",
this.UTEventReporting = class UTEventReporting {
constructor() {
Services.telemetry.setEventRecordingEnabled("activity_stream", true);
this.sendUserEvent = this.sendUserEvent.bind(this);
this.sendSessionEndEvent = this.sendSessionEndEvent.bind(this);
}
_createExtras(data) {

Some files were not shown because too many files have changed in this diff Show More