diff --git a/chrome/content/zotero/standalone/extensionsOverlay.js b/chrome/content/zotero/standalone/extensionsOverlay.js
new file mode 100644
index 0000000000..3e7eb18e3a
--- /dev/null
+++ b/chrome/content/zotero/standalone/extensionsOverlay.js
@@ -0,0 +1,77 @@
+/*
+ ***** BEGIN LICENSE BLOCK *****
+
+ Copyright © 2011 Center for History and New Media
+ George Mason University, Fairfax, Virginia, USA
+ http://zotero.org
+
+ This file is part of Zotero.
+
+ Zotero is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Zotero is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Zotero. If not, see .
+
+ The Original Code is the Extension Manager UI.
+
+ The Initial Developer of the Original Code is the Mozilla Foundation.
+ Portions created by the Initial Developer are Copyright (C) 2010
+ the Initial Developer. All Rights Reserved.
+
+ Contributor(s):
+ Blair McBride
+ Simon Kornblith
+
+ ***** END LICENSE BLOCK *****
+*/
+
+gDiscoverView.onLocationChange = function(aWebProgress, aRequest, aLocation) {
+ // Ignore the about:blank load
+ if (aLocation.spec == "about:blank")
+ return;
+
+ // When using the real session history the inner-frame will update the
+ // session history automatically, if using the fake history though it must
+ // be manually updated
+ if (gHistory == FakeHistory) {
+ var docshell = aWebProgress.QueryInterface(Ci.nsIDocShell);
+
+ var state = {
+ view: "addons://discover/",
+ url: aLocation.spec
+ };
+
+ var replaceHistory = Ci.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY << 16;
+ if (docshell.loadType & replaceHistory)
+ gHistory.replaceState(state);
+ else
+ gHistory.pushState(state);
+ gViewController.lastHistoryIndex = gHistory.index;
+ }
+
+ gViewController.updateCommands();
+
+ // In Zotero, we override the behavior below to allow pages on other sites
+
+ /*// If the hostname is the same as the new location's host and either the
+ // default scheme is insecure or the new location is secure then continue
+ // with the load
+ if (aLocation.host == this.homepageURL.host &&
+ (!this.homepageURL.schemeIs("https") || aLocation.schemeIs("https")))
+ return;
+
+ // Canceling the request will send an error to onStateChange which will show
+ // the error page
+ aRequest.cancel(Components.results.NS_BINDING_ABORTED);*/
+}
+
+// Don't care about http/https
+gDiscoverView.onSecurityChange = function() {};
\ No newline at end of file
diff --git a/chrome/content/zotero/standalone/extensionsOverlay.xul b/chrome/content/zotero/standalone/extensionsOverlay.xul
new file mode 100644
index 0000000000..a3b912ba47
--- /dev/null
+++ b/chrome/content/zotero/standalone/extensionsOverlay.xul
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
diff --git a/chrome/content/zotero/standalone/standalone.js b/chrome/content/zotero/standalone/standalone.js
index 904efb1321..862283b476 100644
--- a/chrome/content/zotero/standalone/standalone.js
+++ b/chrome/content/zotero/standalone/standalone.js
@@ -28,8 +28,7 @@ Components.utils.import("resource://gre/modules/Services.jsm");
/**
* This object contains the various functions for the interface
*/
-var ZoteroStandalone = new function()
-{
+const ZoteroStandalone = new function() {
/**
* Run when standalone window first opens
*/
@@ -65,6 +64,12 @@ var ZoteroStandalone = new function()
handlerInfo.alwaysAskBeforeHandling = false;
hs.store(handlerInfo);
}
+
+ // Add add-on listeners (not yet hooked up)Services.obs.addObserver(gXPInstallObserver, "addon-install-disabled", false);
+ Services.obs.addObserver(gXPInstallObserver, "addon-install-started", false);
+ Services.obs.addObserver(gXPInstallObserver, "addon-install-blocked", false);
+ Services.obs.addObserver(gXPInstallObserver, "addon-install-failed", false);
+ Services.obs.addObserver(gXPInstallObserver, "addon-install-complete", false);
}
/**
@@ -171,5 +176,24 @@ function toOpenWindowByType(inType, uri, features)
}
}
+const gXPInstallObserver = {
+ observe: function (aSubject, aTopic, aData) {
+ var installInfo = aSubject.QueryInterface(Components.interfaces.amIWebInstallInfo);
+ var win = installInfo.originatingWindow;
+ switch (aTopic) {
+ case "addon-install-disabled":
+ case "addon-install-blocked":
+ case "addon-install-failed":
+ var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
+ .getService(Components.interfaces.nsIPromptService);
+ promptService.alert(win, Zotero.getString("standalone.addonInstallationFailed.title"),
+ Zotero.getString("standalone.addonInstallationFailed.body", installInfo.installs[0].name));
+ break;
+ /*case "addon-install-started":
+ case "addon-install-complete":*/
+ }
+ }
+};
+
window.addEventListener("load", function(e) { ZoteroStandalone.onLoad(e); }, false);
window.addEventListener("unload", function(e) { ZoteroStandalone.onUnload(e); }, false);
\ No newline at end of file
diff --git a/chrome/content/zotero/standalone/standalone.xul b/chrome/content/zotero/standalone/standalone.xul
index 25d9fe7893..0de3c6bca0 100644
--- a/chrome/content/zotero/standalone/standalone.xul
+++ b/chrome/content/zotero/standalone/standalone.xul
@@ -170,7 +170,7 @@
command="cmd_zotero_rtfScan"/>
+ oncommand="ZoteroStandalone.openInViewer('chrome://mozapps/content/extensions/extensions.xul')"/>
diff --git a/chrome/locale/en-US/zotero/zotero.properties b/chrome/locale/en-US/zotero/zotero.properties
index f6c31fc579..5935921511 100644
--- a/chrome/locale/en-US/zotero/zotero.properties
+++ b/chrome/locale/en-US/zotero/zotero.properties
@@ -738,6 +738,8 @@ locate.libraryLookup.tooltip = Look up this item using the selected OpenURL res
locate.manageLocateEngines = Manage Lookup Engines…
standalone.corruptInstallation = Your Zotero Standalone installation appears to be corrupted due to a failed auto-update. While Zotero may continue to function, to avoid potential bugs, please download the latest version of Zotero Standalone from http://zotero.org/support/standalone as soon as possible.
+standalone.addonInstallationFailed.title = Add-on Installation Failed
+standalone.addonInstallationFailed.body = The add-on "%S" could not be installed. It may be incompatible with this version of Zotero Standalone.
connector.error.title = Zotero Connector Error
connector.standaloneOpen = Your database cannot be accessed because Zotero Standalone is currently open. Please view your items in Zotero Standalone.
\ No newline at end of file