diff --git a/src/ZenKeyboardShortcuts.mjs b/src/ZenKeyboardShortcuts.mjs index 7eb494b..94be6c8 100644 --- a/src/ZenKeyboardShortcuts.mjs +++ b/src/ZenKeyboardShortcuts.mjs @@ -136,7 +136,9 @@ var gZenKeyboardShortcuts = { }, _initShortcuts() { - this._initSavedShortcuts(); + if (window.location.href == "chrome://browser/content/browser.xhtml") { + this._initSavedShortcuts(); + } }, _createShortcutElement(action) { diff --git a/src/ZenWorkspaces.mjs b/src/ZenWorkspaces.mjs index 4a5b6cd..fd9888d 100644 --- a/src/ZenWorkspaces.mjs +++ b/src/ZenWorkspaces.mjs @@ -71,7 +71,7 @@ var ZenWorkspaces = { activeWorkspace.used = true; await this.saveWorkspaces(); } - await this.changeWorkspace(activeWorkspace); + await this.changeWorkspace(activeWorkspace, true); } this._initializeWorkspaceIcons(); } @@ -328,7 +328,7 @@ var ZenWorkspaces = { button.removeAttribute("disabled"); }, - async changeWorkspace(window) { + async changeWorkspace(window, onInit = false) { if (!this.workspaceEnabled) { return; } @@ -348,7 +348,7 @@ var ZenWorkspaces = { gBrowser.showTab(tab); } } - if (typeof firstTab === "undefined") { + if (typeof firstTab === "undefined" && !onInit) { this._createNewTabForWorkspace(window); } for (let tab of gBrowser.tabs) { @@ -389,7 +389,7 @@ var ZenWorkspaces = { if (!workspaceID) { let workspaces = await this._workspaces(); let activeWorkspace = workspaces.workspaces.find(workspace => workspace.used); - if (!activeWorkspace) { + if (!activeWorkspace || tab.hasAttribute("hidden")) { return; } tab.setAttribute("zen-workspace-id", activeWorkspace.uuid);