зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1352501 - Remove Reader Mode promotion panel. r=jaws,MattN
Note that the UITour library can still show a panel in the event that we want to promote the feature that way. MozReview-Commit-ID: FzKSzO987h7 --HG-- extra : rebase_source : 8c129106478559f011a3a4e311331851939ab408
This commit is contained in:
Родитель
f6018187db
Коммит
365f4e988a
|
@ -1530,7 +1530,6 @@ pref("dom.ipc.reportProcessHangs", false);
|
|||
pref("dom.ipc.reportProcessHangs", true);
|
||||
#endif
|
||||
|
||||
pref("browser.reader.detectedFirstArticle", false);
|
||||
// Don't limit how many nodes we care about on desktop:
|
||||
pref("reader.parse-node-limit", 0);
|
||||
|
||||
|
|
|
@ -36,10 +36,6 @@ var whitelist = new Set([
|
|||
// security/manager/pki/resources/content/device_manager.js
|
||||
{file: "chrome://pippki/content/load_device.xul"},
|
||||
|
||||
// browser/modules/ReaderParent.jsm
|
||||
{file: "chrome://browser/skin/reader-tour.png"},
|
||||
{file: "chrome://browser/skin/reader-tour@2x.png"},
|
||||
|
||||
// Used by setting this url as a pref in about:config
|
||||
{file: "chrome://browser/content/newtab/alternativeDefaultSites.json"},
|
||||
|
||||
|
|
|
@ -763,11 +763,6 @@ customizeTips.tip0.learnMore = Learn more
|
|||
# LOCALIZATION NOTE (customizeMode.tabTitle): %S is brandShortName
|
||||
customizeMode.tabTitle = Customize %S
|
||||
|
||||
# LOCALIZATION NOTE : FILE Reader View is a feature name and therefore typically used as a proper noun.
|
||||
|
||||
readingList.promo.firstUse.readerView.title = Reader View
|
||||
readingList.promo.firstUse.readerView.body = Remove clutter so you can focus exactly on what you want to read.
|
||||
|
||||
# LOCALIZATION NOTE (appMenuRemoteTabs.mobilePromo.text2):
|
||||
# %1$S will be replaced with a link, the text of which is
|
||||
# appMenuRemoteTabs.mobilePromo.android and the link will be to
|
||||
|
|
|
@ -20,8 +20,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "UITour", "resource:///modules/UITour.js
|
|||
const gStringBundle = Services.strings.createBundle("chrome://global/locale/aboutReader.properties");
|
||||
|
||||
var ReaderParent = {
|
||||
_readerModeInfoPanelOpen: false,
|
||||
|
||||
MESSAGES: [
|
||||
"Reader:ArticleGet",
|
||||
"Reader:FaviconRequest",
|
||||
|
@ -108,20 +106,6 @@ var ReaderParent = {
|
|||
command.setAttribute("accesskey", gStringBundle.GetStringFromName("readerView.enter.accesskey"));
|
||||
key.setAttribute("disabled", !browser.isArticle);
|
||||
}
|
||||
|
||||
let currentUriHost = browser.currentURI && browser.currentURI.asciiHost;
|
||||
if (browser.isArticle &&
|
||||
!Services.prefs.getBoolPref("browser.reader.detectedFirstArticle") &&
|
||||
currentUriHost && !currentUriHost.endsWith("mozilla.org")) {
|
||||
this.showReaderModeInfoPanel(browser);
|
||||
Services.prefs.setBoolPref("browser.reader.detectedFirstArticle", true);
|
||||
this._readerModeInfoPanelOpen = true;
|
||||
} else if (this._readerModeInfoPanelOpen) {
|
||||
if (UITour.isInfoOnTarget(win, "readerMode-urlBar")) {
|
||||
UITour.hideInfo(win);
|
||||
}
|
||||
this._readerModeInfoPanelOpen = false;
|
||||
}
|
||||
},
|
||||
|
||||
forceShowReaderIcon(browser) {
|
||||
|
@ -142,29 +126,6 @@ var ReaderParent = {
|
|||
browser.messageManager.sendAsyncMessage("Reader:ToggleReaderMode");
|
||||
},
|
||||
|
||||
/**
|
||||
* Shows an info panel from the UITour for Reader Mode.
|
||||
*
|
||||
* @param browser The <browser> that the tour should be started for.
|
||||
*/
|
||||
showReaderModeInfoPanel(browser) {
|
||||
let win = browser.ownerGlobal;
|
||||
let targetPromise = UITour.getTarget(win, "readerMode-urlBar");
|
||||
targetPromise.then(target => {
|
||||
let browserBundle = Services.strings.createBundle("chrome://browser/locale/browser.properties");
|
||||
let icon = "chrome://browser/skin/";
|
||||
if (win.devicePixelRatio > 1) {
|
||||
icon += "reader-tour@2x.png";
|
||||
} else {
|
||||
icon += "reader-tour.png";
|
||||
}
|
||||
UITour.showInfo(win, target,
|
||||
browserBundle.GetStringFromName("readingList.promo.firstUse.readerView.title"),
|
||||
browserBundle.GetStringFromName("readingList.promo.firstUse.readerView.body"),
|
||||
icon);
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Gets an article for a given URL. This method will download and parse a document.
|
||||
*
|
||||
|
|
|
@ -125,8 +125,6 @@
|
|||
skin/classic/browser/favicon-search-16.svg (../shared/favicon-search-16.svg)
|
||||
skin/classic/browser/icon-search-64.svg (../shared/incontent-icons/icon-search-64.svg)
|
||||
skin/classic/browser/welcome-back.svg (../shared/incontent-icons/welcome-back.svg)
|
||||
skin/classic/browser/reader-tour.png (../shared/reader/reader-tour.png)
|
||||
skin/classic/browser/reader-tour@2x.png (../shared/reader/reader-tour@2x.png)
|
||||
skin/classic/browser/readerMode.svg (../shared/reader/readerMode.svg)
|
||||
skin/classic/browser/panic-panel/header.png (../shared/panic-panel/header.png)
|
||||
skin/classic/browser/panic-panel/header@2x.png (../shared/panic-panel/header@2x.png)
|
||||
|
|
Двоичные данные
browser/themes/shared/reader/reader-tour.png
Двоичные данные
browser/themes/shared/reader/reader-tour.png
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 2.6 KiB |
Двоичные данные
browser/themes/shared/reader/reader-tour@2x.png
Двоичные данные
browser/themes/shared/reader/reader-tour@2x.png
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 6.3 KiB |
|
@ -431,9 +431,6 @@ class DesktopInstance(GeckoInstance):
|
|||
# in general can"t hurt - we re-enable them when tests need them
|
||||
"browser.pagethumbnails.capturing_disabled": True,
|
||||
|
||||
# Avoid performing Reader Mode intros during tests
|
||||
"browser.reader.detectedFirstArticle": True,
|
||||
|
||||
# Disable safebrowsing components
|
||||
"browser.safebrowsing.blockedURIs.enabled": False,
|
||||
"browser.safebrowsing.downloads.enabled": False,
|
||||
|
|
|
@ -94,9 +94,6 @@ const RECOMMENDED_PREFS = new Map([
|
|||
// thumbnails in general cannot hurt
|
||||
["browser.pagethumbnails.capturing_disabled", true],
|
||||
|
||||
// Avoid performing Reader Mode intros during tests
|
||||
["browser.reader.detectedFirstArticle", true],
|
||||
|
||||
// Disable safebrowsing components.
|
||||
//
|
||||
// These should also be set in the profile prior to starting Firefox,
|
||||
|
|
|
@ -323,9 +323,6 @@ user_pref("dom.ipc.tabs.shutdownTimeoutSecs", 0);
|
|||
// Don't block add-ons for e10s
|
||||
user_pref("extensions.e10sBlocksEnabling", false);
|
||||
|
||||
// Avoid performing Reader Mode intros during tests.
|
||||
user_pref("browser.reader.detectedFirstArticle", true);
|
||||
|
||||
// Make tests run consistently on DevEdition (which has a lightweight theme
|
||||
// selected by default).
|
||||
user_pref("lightweightThemes.selectedThemeID", "");
|
||||
|
|
|
@ -29,34 +29,23 @@ add_task(function* test_reader_button() {
|
|||
TEST_PREFS.forEach(([name, value]) => {
|
||||
Services.prefs.setBoolPref(name, value);
|
||||
});
|
||||
Services.prefs.setBoolPref("browser.reader.detectedFirstArticle", false);
|
||||
|
||||
let tab = gBrowser.selectedTab = gBrowser.addTab();
|
||||
is_element_hidden(readerButton, "Reader mode button is not present on a new tab");
|
||||
ok(!UITour.isInfoOnTarget(window, "readerMode-urlBar"),
|
||||
"Info panel shouldn't appear without the reader mode button");
|
||||
ok(!Services.prefs.getBoolPref("browser.reader.detectedFirstArticle"),
|
||||
"Shouldn't have detected the first article");
|
||||
|
||||
// We're going to show the reader mode intro popup, make sure we wait for it:
|
||||
let tourPopupShownPromise =
|
||||
BrowserTestUtils.waitForEvent(document.getElementById("UITourTooltip"), "popupshown");
|
||||
// Point tab to a test page that is reader-able.
|
||||
let url = TEST_PATH + "readerModeArticle.html";
|
||||
yield promiseTabLoadEvent(tab, url);
|
||||
yield promiseWaitForCondition(() => !readerButton.hidden);
|
||||
yield tourPopupShownPromise;
|
||||
|
||||
is_element_visible(readerButton, "Reader mode button is present on a reader-able page");
|
||||
ok(UITour.isInfoOnTarget(window, "readerMode-urlBar"),
|
||||
"Info panel should be anchored at the reader mode button");
|
||||
ok(Services.prefs.getBoolPref("browser.reader.detectedFirstArticle"),
|
||||
"Should have detected the first article");
|
||||
|
||||
// Switch page into reader mode.
|
||||
let promiseTabLoad = promiseTabLoadEvent(tab);
|
||||
readerButton.click();
|
||||
yield promiseTabLoad;
|
||||
ok(!UITour.isInfoOnTarget(window, "readerMode-urlBar"), "Info panel should have closed");
|
||||
|
||||
let readerUrl = gBrowser.selectedBrowser.currentURI.spec;
|
||||
ok(readerUrl.startsWith("about:reader"), "about:reader loaded after clicking reader mode button");
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
*/
|
||||
const TEST_PREFS = [
|
||||
["reader.parse-on-load.enabled", true],
|
||||
["browser.reader.detectedFirstArticle", false],
|
||||
];
|
||||
|
||||
const TEST_PATH = getRootDirectory(gTestPath).replace("chrome://mochitests/content", "http://example.com");
|
||||
|
|
Загрузка…
Ссылка в новой задаче