From bc69662911e452d41e7be866608b59bc13a3fc37 Mon Sep 17 00:00:00 2001 From: "proxy.zeroomega" Date: Mon, 16 Sep 2024 01:58:01 +0800 Subject: [PATCH] fix the bug that firefox android cant start --- omega-target-chromium-extension/overlay/manifest-firefox.json | 2 +- omega-target-chromium-extension/src/coffee/background.coffee | 2 +- .../src/coffee/background_preload.coffee | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/omega-target-chromium-extension/overlay/manifest-firefox.json b/omega-target-chromium-extension/overlay/manifest-firefox.json index 51db3ea..b3bfc58 100644 --- a/omega-target-chromium-extension/overlay/manifest-firefox.json +++ b/omega-target-chromium-extension/overlay/manifest-firefox.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "Proxy SwitchyOmega 3 (ZeroOmega)", - "version": "3.3.12", + "version": "3.3.13", "description": "__MSG_manifest_app_description__", "icons": { "16": "img/icons/omega-action-16.png", diff --git a/omega-target-chromium-extension/src/coffee/background.coffee b/omega-target-chromium-extension/src/coffee/background.coffee index 1e37c6d..24294d5 100644 --- a/omega-target-chromium-extension/src/coffee/background.coffee +++ b/omega-target-chromium-extension/src/coffee/background.coffee @@ -16,7 +16,7 @@ chrome.runtime.onStartup.addListener -> -chrome.contextMenus.onClicked.addListener((info, tab) -> +chrome.contextMenus?.onClicked.addListener((info, tab) -> options?.ready.then( -> switch info.menuItemId when 'inspectPage', 'inspectLink', 'inspectElement', 'inspectFrame' diff --git a/omega-target-chromium-extension/src/coffee/background_preload.coffee b/omega-target-chromium-extension/src/coffee/background_preload.coffee index 0019d09..32d7996 100644 --- a/omega-target-chromium-extension/src/coffee/background_preload.coffee +++ b/omega-target-chromium-extension/src/coffee/background_preload.coffee @@ -6,6 +6,7 @@ globalThis.zeroDetectModeCB = null globalThis.startupCheck = undefined initContextMenu = -> + return unless chrome.contextMenus chrome.contextMenus.removeAll() chrome.contextMenus.create({ id: 'enableQuickSwitch' @@ -23,7 +24,7 @@ initContextMenu = -> initContextMenu() -chrome.contextMenus.onClicked.addListener((info, tab) -> +chrome.contextMenus?.onClicked.addListener((info, tab) -> switch info.menuItemId when 'reportIssue' OmegaDebug.reportIssue()