diff --git a/chrome/content/zotero/standalone/standalone.js b/chrome/content/zotero/standalone/standalone.js
index c668d20e59..83262f0e0c 100644
--- a/chrome/content/zotero/standalone/standalone.js
+++ b/chrome/content/zotero/standalone/standalone.js
@@ -645,6 +645,29 @@ const ZoteroStandalone = new function() {
};
+ this.promptForRestartInSafeMode = async function () {
+ let ps = Services.prompt;
+ let [title, description] = await document.l10n.formatValues([
+ 'restart-in-safe-mode-dialog-title',
+ 'restart-in-safe-mode-dialog-description'
+ ]);
+ let buttonFlags = ps.BUTTON_POS_0 * ps.BUTTON_TITLE_IS_STRING
+ + ps.BUTTON_POS_1 * ps.BUTTON_TITLE_CANCEL;
+ let index = ps.confirmEx(
+ null,
+ title,
+ description,
+ buttonFlags,
+ Zotero.getString('general.restartNow'),
+ null, null, null, {}
+ );
+
+ if (index == 0) {
+ Services.startup.restartInSafeMode(Ci.nsIAppStartup.eAttemptQuit);
+ }
+ };
+
+
this.updateAddonsPane = function (doc) {
//var rootWindow = doc.ownerGlobal.windowRoot.ownerGlobal;
diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js
index b52f66a70e..fd83ed14ae 100644
--- a/chrome/content/zotero/zoteroPane.js
+++ b/chrome/content/zotero/zoteroPane.js
@@ -415,7 +415,7 @@ var ZoteroPane = new function()
Zotero.hiDPI = window.devicePixelRatio > 1;
Zotero.hiDPISuffix = Zotero.hiDPI ? "@2x" : "";
- // Show warning in toolbar for 'dev' channel builds
+ // Show warning in toolbar for 'dev' channel builds and safe mode
try {
let isDevBuild = Zotero.version.includes('-dev');
// Uncomment to test
@@ -430,6 +430,16 @@ var ZoteroPane = new function()
let syncStop = document.getElementById('zotero-tb-sync-stop');
syncStop.parentNode.insertBefore(label, syncStop);
}
+ else if (Services.appinfo.inSafeMode) {
+ let label = document.createElement('span');
+ label.setAttribute('style', 'font-weight: bold; color: darkblue; cursor: pointer; margin-right: .5em');
+ label.onclick = function () {
+ Zotero.Utilities.Internal.quit(true);
+ };
+ label.textContent = 'Safe Mode';
+ let syncStop = document.getElementById('zotero-tb-sync-stop');
+ syncStop.parentNode.insertBefore(label, syncStop);
+ }
}
catch (e) {
Zotero.logError(e);
diff --git a/chrome/content/zotero/zoteroPane.xhtml b/chrome/content/zotero/zoteroPane.xhtml
index eb272d1cab..e23e051b9f 100644
--- a/chrome/content/zotero/zoteroPane.xhtml
+++ b/chrome/content/zotero/zoteroPane.xhtml
@@ -673,6 +673,9 @@
oncommand="ZoteroStandalone.DebugOutput.restartEnabled()"/>
+