firefox-patches/disable-reader.patch
2018-04-04 11:13:32 +02:00

216 lines
8.8 KiB
Diff

--- a/browser/base/content/browser-sets.inc
+++ b/browser/base/content/browser-sets.inc
@@ -43,7 +43,6 @@
<command id="View:PageSource" oncommand="BrowserViewSource(window.gBrowser.selectedBrowser);" observes="canViewSource"/>
<command id="View:PageInfo" oncommand="BrowserPageInfo();"/>
<command id="View:FullScreen" oncommand="BrowserFullScreen();"/>
- <command id="View:ReaderView" oncommand="ReaderParent.toggleReaderMode(event);"/>
<command id="cmd_find"
oncommand="gFindBar.onFindCommand();"
observes="isImage"/>
@@ -283,7 +282,6 @@
<key id="key_fullScreen_old" key="&fullScreenCmd.macCommandKey;" command="View:FullScreen" modifiers="accel,shift"/>
<key keycode="VK_F11" command="View:FullScreen"/>
#endif
- <key id="toggleReaderMode" key="&toggleReaderMode.key;" command="View:ReaderView" modifiers="accel,alt" disabled="true"/>
<key key="&reloadCmd.commandkey;" command="Browser:Reload" modifiers="accel" id="key_reload"/>
<key key="&reloadCmd.commandkey;" command="Browser:ReloadSkipCache" modifiers="accel,shift"/>
<key id="key_viewSource" key="&pageSourceCmd.commandkey;" command="View:PageSource" modifiers="accel"/>
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -37,8 +37,6 @@ Cu.import("resource://gre/modules/NotificationDB.jsm");
["PrivateBrowsingUtils", "resource://gre/modules/PrivateBrowsingUtils.jsm"],
["ProcessHangMonitor", "resource:///modules/ProcessHangMonitor.jsm"],
["PromiseUtils", "resource://gre/modules/PromiseUtils.jsm"],
- ["ReaderMode", "resource://gre/modules/ReaderMode.jsm"],
- ["ReaderParent", "resource:///modules/ReaderParent.jsm"],
["RecentWindow", "resource:///modules/RecentWindow.jsm"],
["SessionStore", "resource:///modules/sessionstore/SessionStore.jsm"],
["ShortcutUtils", "resource://gre/modules/ShortcutUtils.jsm"],
@@ -4579,7 +4577,6 @@ var XULBrowserWindow = {
}
}
UpdateBackForwardCommands(gBrowser.webNavigation);
- ReaderParent.updateReaderButton(gBrowser.selectedBrowser);
gGestureSupport.restoreRotationState();
@@ -4880,9 +4877,6 @@ var TabsProgressListener = {
// Filter out location changes caused by anchor navigation
// or history.push/pop/replaceState.
if (aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT) {
- // Reader mode actually cares about these:
- let mm = gBrowser.selectedBrowser.messageManager;
- mm.sendAsyncMessage("Reader:PushState", {isArticle: gBrowser.selectedBrowser.isArticle});
return;
}
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -759,10 +759,6 @@
hidden="true"
tooltiptext="&pageReportIcon.tooltip;"
onmousedown="gPopupBlockerObserver.onReportButtonMousedown(event);"/>
- <image id="reader-mode-button"
- class="urlbar-icon"
- hidden="true"
- onclick="ReaderParent.buttonClick(event);"/>
<toolbarbutton id="urlbar-zoom-button"
onclick="FullZoom.reset();"
tooltiptext="&urlbar.zoomReset.tooltip;"
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -184,11 +184,6 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
break;
}
}
- } else {
- let originalUrl = ReaderMode.getOriginalUrl(aValue);
- if (originalUrl) {
- returnValue = originalUrl;
- }
}
// Set the actiontype only if the user is not overriding actions.
@@ -773,12 +768,6 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
return selectedVal;
}
- // Avoid copying 'about:reader?url=', and always provide the original URI:
- let readerOriginalURL = ReaderMode.getOriginalUrl(uri.spec);
- if (readerOriginalURL) {
- uri = uriFixup.createFixupURI(readerOriginalURL, Ci.nsIURIFixup.FIXUP_FLAG_NONE);
- }
-
// Only copy exposable URIs
try {
uri = uriFixup.createExposableURI(uri);
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -53,7 +53,6 @@ XPCOMUtils.defineLazyServiceGetter(this, "AlertsService", "@mozilla.org/alerts-s
["PluralForm", "resource://gre/modules/PluralForm.jsm"],
["PrivateBrowsingUtils", "resource://gre/modules/PrivateBrowsingUtils.jsm"],
["ProcessHangMonitor", "resource:///modules/ProcessHangMonitor.jsm"],
- ["ReaderParent", "resource:///modules/ReaderParent.jsm"],
["RecentWindow", "resource:///modules/RecentWindow.jsm"],
["RemotePrompt", "resource:///modules/RemotePrompt.jsm"],
["SelfSupportBackend", "resource:///modules/SelfSupportBackend.jsm"],
@@ -685,7 +684,6 @@ BrowserGlue.prototype = {
ContentPrefServiceParent.init();
LoginManagerParent.init();
- ReaderParent.init();
URLBarZoom.init();
SelfSupportBackend.init();
--- a/browser/components/uitour/UITour-lib.js
+++ b/browser/components/uitour/UITour-lib.js
@@ -297,14 +297,6 @@ if (typeof Mozilla == 'undefined') {
});
};
- Mozilla.UITour.forceShowReaderIcon = function() {
- _sendEvent('forceShowReaderIcon');
- };
-
- Mozilla.UITour.toggleReaderMode = function() {
- _sendEvent('toggleReaderMode');
- };
-
Mozilla.UITour.openPreferences = function(pane) {
_sendEvent('openPreferences', {
pane: pane
--- a/browser/components/uitour/UITour.jsm
+++ b/browser/components/uitour/UITour.jsm
@@ -32,19 +32,13 @@ XPCOMUtils.defineLazyModuleGetter(this, "BrowserUITelemetry",
"resource:///modules/BrowserUITelemetry.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
"resource://gre/modules/PrivateBrowsingUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "ReaderMode",
- "resource://gre/modules/ReaderMode.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "ReaderParent",
- "resource:///modules/ReaderParent.jsm");
// See LOG_LEVELS in Console.jsm. Common examples: "All", "Info", "Warn", & "Error".
const PREF_LOG_LEVEL = "browser.uitour.loglevel";
const PREF_SEENPAGEIDS = "browser.uitour.seenPageIDs";
-const PREF_READERVIEW_TRIGGER = "browser.uitour.readerViewTrigger";
const PREF_SURVEY_DURATION = "browser.uitour.surveyDuration";
const BACKGROUND_PAGE_ACTIONS_ALLOWED = new Set([
- "forceShowReaderIcon",
"getConfiguration",
"getTreatmentTag",
"hideHighlight",
@@ -161,7 +155,6 @@ this.UITour = {
}],
["privateWindow", {query: "#privatebrowsing-button"}],
["quit", {query: "#PanelUI-quit"}],
- ["readerMode-urlBar", {query: "#reader-mode-button"}],
["search", {
infoPanelOffsetX: 18,
infoPanelPosition: "after_start",
@@ -297,21 +290,7 @@ this.UITour = {
JSON.stringify([...this.seenPageIDs]));
},
- get _readerViewTriggerRegEx() {
- delete this._readerViewTriggerRegEx;
- let readerViewUITourTrigger = Services.prefs.getCharPref(PREF_READERVIEW_TRIGGER);
- return this._readerViewTriggerRegEx = new RegExp(readerViewUITourTrigger, "i");
- },
-
onLocationChange: function(aLocation) {
- // The ReaderView tour page is expected to run in Reader View,
- // which disables JavaScript on the page. To get around that, we
- // automatically start a pre-defined tour on page load (for hysterical
- // raisins the ReaderView tour is known as "readinglist")
- let originalUrl = ReaderMode.getOriginalUrl(aLocation);
- if (this._readerViewTriggerRegEx.test(originalUrl)) {
- this.startSubTour("readinglist");
- }
},
onPageEvent: function(aMessage, aEvent) {
@@ -661,15 +640,10 @@ this.UITour = {
}
case "forceShowReaderIcon": {
- ReaderParent.forceShowReaderIcon(browser);
break;
}
case "toggleReaderMode": {
- let targetPromise = this.getTarget(window, "readerMode-urlBar");
- targetPromise.then(target => {
- ReaderParent.toggleReaderMode({target: target.node});
- });
break;
}
@@ -1947,12 +1921,8 @@ this.UITour = {
return;
}
- if (aFeature == "readinglist") {
- ReaderParent.showReaderModeInfoPanel(browser);
- } else {
- log.error("startSubTour: Unknown feature option specified");
- return;
- }
+ log.error("startSubTour: Unknown feature option specified");
+ return;
},
addNavBarWidget: function (aTarget, aMessageManager, aCallbackID) {
--- a/browser/modules/moz.build
+++ b/browser/modules/moz.build
@@ -35,7 +35,6 @@ EXTRA_JS_MODULES += [
'PermissionUI.jsm',
'PluginContent.jsm',
'ProcessHangMonitor.jsm',
- 'ReaderParent.jsm',
'RecentWindow.jsm',
'RemotePrompt.jsm',
'Sanitizer.jsm',