summaryrefslogtreecommitdiffstats
path: root/browser
diff options
context:
space:
mode:
Diffstat (limited to 'browser')
-rw-r--r--browser/LICENSE2
-rw-r--r--browser/base/content/browser-sets.inc2
-rw-r--r--browser/base/content/tab-content.js2
-rw-r--r--browser/branding/official/LICENSE16
-rw-r--r--browser/branding/shared/uaoverrides.inc3
-rw-r--r--browser/branding/unofficial/LICENSE9
-rw-r--r--browser/components/sessionstore/content/aboutSessionRestore.js7
-rw-r--r--browser/modules/ReaderParent.jsm116
8 files changed, 45 insertions, 112 deletions
diff --git a/browser/LICENSE b/browser/LICENSE
index f1b2067a7..4f643a5c8 100644
--- a/browser/LICENSE
+++ b/browser/LICENSE
@@ -9,3 +9,5 @@ Basilisk name or logo.
The Serpent logo in branding/unofficial is derived from "Sea Serpent"
by Lorc, licensed under the Creative Commons license CC-BY 3.0
+For individual licensing restrictions on branding, see the LICENSE
+files in the appropriate branding directories.
diff --git a/browser/base/content/browser-sets.inc b/browser/base/content/browser-sets.inc
index 0c753520f..d0c3d11cd 100644
--- a/browser/base/content/browser-sets.inc
+++ b/browser/base/content/browser-sets.inc
@@ -285,7 +285,7 @@
<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 id="key_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"/>
diff --git a/browser/base/content/tab-content.js b/browser/base/content/tab-content.js
index 7e803796a..a57dc6607 100644
--- a/browser/base/content/tab-content.js
+++ b/browser/base/content/tab-content.js
@@ -307,7 +307,7 @@ var AboutReaderListener = {
if (content.document.body) {
// Update the toolbar icon to show the "reader active" icon.
sendAsyncMessage("Reader:UpdateReaderButton");
- new AboutReader(global, content, this._articlePromise);
+ new AboutReader(content, this._articlePromise);
this._articlePromise = null;
}
break;
diff --git a/browser/branding/official/LICENSE b/browser/branding/official/LICENSE
index 32d55b9c7..8833fe212 100644
--- a/browser/branding/official/LICENSE
+++ b/browser/branding/official/LICENSE
@@ -1,10 +1,10 @@
-These files are under the MPL 2, as below. However, please note that you
-are not granted any trademark rights or licenses to the trademarks of the
-Mozilla Foundation or any party, including without limitation the
-Firefox name or logo.
+This location contains official branding for the Basilisk browser.
-For more information, see: http://www.mozilla.org/foundation/licensing.html
+Please note that you are not granted any trademark rights or licenses
+to the trademarks of Moonchild Productions or any other party,
+including without limitation the Basilisk name or logo.
-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/.
+These branding materials are Copyrighted (c) M. Straver. All rights reserved.
+
+Official branding using these files is only allowed by the copyright holder
+or by third parties with express permission from the copyright holder. \ No newline at end of file
diff --git a/browser/branding/shared/uaoverrides.inc b/browser/branding/shared/uaoverrides.inc
index 59e413728..f7f7fafa3 100644
--- a/browser/branding/shared/uaoverrides.inc
+++ b/browser/branding/shared/uaoverrides.inc
@@ -19,8 +19,9 @@
#define OS_SLICE Windows NT 6.1; WOW64;
#endif
-// FxA override
+// Mozilla overrides
pref("@GUAO_PREF@.accounts.firefox.com", "Mozilla/5.0 (@OS_SLICE@ rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@");
+pref("@GUAO_PREF@.addons.mozilla.org", "Mozilla/5.0 (@OS_SLICE@ rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@");
// Required for domains that have proven unresponsive to requests from users
diff --git a/browser/branding/unofficial/LICENSE b/browser/branding/unofficial/LICENSE
new file mode 100644
index 000000000..35dec1819
--- /dev/null
+++ b/browser/branding/unofficial/LICENSE
@@ -0,0 +1,9 @@
+The Serpent application name and Serpent logo are licensed under a
+Creative Commons Attribution license.
+
+The Serpent logo is derived from "Sea Serpent"
+ by Lorc,
+licensed under the Creative Commons license CC-BY 3.0
+
+Branding files are created by M. Straver and similarly released
+under the Creative Commons license CC-BY 3.0 \ No newline at end of file
diff --git a/browser/components/sessionstore/content/aboutSessionRestore.js b/browser/components/sessionstore/content/aboutSessionRestore.js
index 8a9410aa8..8f265235d 100644
--- a/browser/components/sessionstore/content/aboutSessionRestore.js
+++ b/browser/components/sessionstore/content/aboutSessionRestore.js
@@ -188,6 +188,9 @@ function onListClick(aEvent) {
if (aEvent.button == 2)
return;
+ if (!treeView.treeBox) {
+ return;
+ }
var cell = treeView.treeBox.getCellAt(aEvent.clientX, aEvent.clientY);
if (cell.col) {
// Restore this specific tab in the same window for middle/double/accel clicking
@@ -286,7 +289,9 @@ var treeView = {
get rowCount() { return gTreeData.length; },
setTree: function(treeBox) { this.treeBox = treeBox; },
getCellText: function(idx, column) { return gTreeData[idx].label; },
- isContainer: function(idx) { return "open" in gTreeData[idx]; },
+ isContainer: function(idx) {
+ return gTreeData[idx] ? "open" in gTreeData[idx] : false;
+ },
getCellValue: function(idx, column){ return gTreeData[idx].checked; },
isContainerOpen: function(idx) { return gTreeData[idx].open; },
isContainerEmpty: function(idx) { return false; },
diff --git a/browser/modules/ReaderParent.jsm b/browser/modules/ReaderParent.jsm
index 6fcaada42..c81aa9905 100644
--- a/browser/modules/ReaderParent.jsm
+++ b/browser/modules/ReaderParent.jsm
@@ -11,64 +11,26 @@ this.EXPORTED_SYMBOLS = [ "ReaderParent" ];
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils", "resource://gre/modules/PlacesUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "ReaderMode", "resource://gre/modules/ReaderMode.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "UITour", "resource:///modules/UITour.jsm");
const gStringBundle = Services.strings.createBundle("chrome://global/locale/aboutReader.properties");
var ReaderParent = {
- _readerModeInfoPanelOpen: false,
-
MESSAGES: [
- "Reader:ArticleGet",
- "Reader:FaviconRequest",
"Reader:UpdateReaderButton",
],
- init: function() {
+ init() {
let mm = Cc["@mozilla.org/globalmessagemanager;1"].getService(Ci.nsIMessageListenerManager);
for (let msg of this.MESSAGES) {
mm.addMessageListener(msg, this);
}
},
- receiveMessage: function(message) {
+ receiveMessage(message) {
switch (message.name) {
- case "Reader:ArticleGet":
- this._getArticle(message.data.url, message.target).then((article) => {
- // Make sure the target browser is still alive before trying to send data back.
- if (message.target.messageManager) {
- message.target.messageManager.sendAsyncMessage("Reader:ArticleData", { article: article });
- }
- }, e => {
- if (e && e.newURL) {
- // Make sure the target browser is still alive before trying to send data back.
- if (message.target.messageManager) {
- message.target.messageManager.sendAsyncMessage("Reader:ArticleData", { newURL: e.newURL });
- }
- }
- });
- break;
-
- case "Reader:FaviconRequest": {
- if (message.target.messageManager) {
- let faviconUrl = PlacesUtils.promiseFaviconLinkUrl(message.data.url);
- faviconUrl.then(function onResolution(favicon) {
- message.target.messageManager.sendAsyncMessage("Reader:FaviconReturn", {
- url: message.data.url,
- faviconUrl: favicon.path.replace(/^favicon:/, "")
- })
- },
- function onRejection(reason) {
- Cu.reportError("Error requesting favicon URL for about:reader content: " + reason);
- }).catch(Cu.reportError);
- }
- break;
- }
-
case "Reader:UpdateReaderButton": {
let browser = message.target;
if (message.data && message.data.isArticle !== undefined) {
@@ -80,7 +42,7 @@ var ReaderParent = {
}
},
- updateReaderButton: function(browser) {
+ updateReaderButton(browser) {
let win = browser.ownerGlobal;
if (browser != win.gBrowser.selectedBrowser) {
return;
@@ -88,7 +50,11 @@ var ReaderParent = {
let button = win.document.getElementById("reader-mode-button");
let command = win.document.getElementById("View:ReaderView");
- let key = win.document.getElementById("toggleReaderMode");
+ let key = win.document.getElementById("key_toggleReaderMode");
+ // aria-reader is not a real ARIA attribute. However, this will cause
+ // Gecko accessibility to expose the "reader" object attribute. We do this
+ // so that the reader state is easy for accessibility clients to access
+ // programmatically.
if (browser.currentURI.spec.startsWith("about:reader")) {
button.setAttribute("readeractive", true);
button.hidden = false;
@@ -98,6 +64,7 @@ var ReaderParent = {
command.setAttribute("hidden", false);
command.setAttribute("accesskey", gStringBundle.GetStringFromName("readerView.close.accesskey"));
key.setAttribute("disabled", false);
+ browser.setAttribute("aria-reader", "active");
} else {
button.removeAttribute("readeractive");
button.hidden = !browser.isArticle;
@@ -107,24 +74,15 @@ var ReaderParent = {
command.setAttribute("hidden", !browser.isArticle);
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);
+ if (browser.isArticle) {
+ browser.setAttribute("aria-reader", "available");
+ } else {
+ browser.removeAttribute("aria-reader");
}
- this._readerModeInfoPanelOpen = false;
}
},
- forceShowReaderIcon: function(browser) {
+ forceShowReaderIcon(browser) {
browser.isArticle = true;
this.updateReaderButton(browser);
},
@@ -136,51 +94,9 @@ var ReaderParent = {
this.toggleReaderMode(event);
},
- toggleReaderMode: function(event) {
+ toggleReaderMode(event) {
let win = event.target.ownerGlobal;
let browser = win.gBrowser.selectedBrowser;
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.
- *
- * @param url The article URL.
- * @param browser The browser where the article is currently loaded.
- * @return {Promise}
- * @resolves JS object representing the article, or null if no article is found.
- */
- _getArticle: Task.async(function* (url, browser) {
- return yield ReaderMode.downloadAndParseDocument(url).catch(e => {
- if (e && e.newURL) {
- // Pass up the error so we can navigate the browser in question to the new URL:
- throw e;
- }
- Cu.reportError("Error downloading and parsing document: " + e);
- return null;
- });
- })
+ }
};