From ce26c5830913fc924407aa9174df667b75e5f6f4 Mon Sep 17 00:00:00 2001 From: rui hildt Date: Wed, 14 Aug 2024 15:41:52 +0200 Subject: [PATCH] Exclude extension page from proxying --- src/components/Proxy/HomeProxyStatus.vue | 4 ++-- src/composables/useActiveTab.ts | 7 ++++--- src/popup/views/Proxy.vue | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/components/Proxy/HomeProxyStatus.vue b/src/components/Proxy/HomeProxyStatus.vue index 7a1506ef..17bc303f 100644 --- a/src/components/Proxy/HomeProxyStatus.vue +++ b/src/components/Proxy/HomeProxyStatus.vue @@ -7,7 +7,7 @@ import useActiveTab from '@/composables/useActiveTab'; import { ConnectionKey, defaultConnection } from '@/composables/useConnection'; import useSocksProxy from '@/composables/useSocksProxy'; -const { activeTabHost, isAboutPage } = useActiveTab(); +const { activeTabHost, isBrowserPage } = useActiveTab(); const { currentHostProxyDetails, currentHostProxyEnabled, @@ -33,7 +33,7 @@ const currentHostExcluded = computed(() => { diff --git a/src/composables/useActiveTab.ts b/src/composables/useActiveTab.ts index e3b15610..3e00a7f0 100644 --- a/src/composables/useActiveTab.ts +++ b/src/composables/useActiveTab.ts @@ -2,19 +2,20 @@ import { getActiveTabDetails } from '@/helpers/socksProxy'; import { ref } from 'vue'; const activeTabHost = ref(''); -const isAboutPage = ref(false); +const isBrowserPage = ref(false); const getActiveTab = async () => { const activeTabDetails = await getActiveTabDetails(); activeTabHost.value = activeTabDetails.host; - isAboutPage.value = activeTabDetails.protocol === 'about:'; + isBrowserPage.value = + activeTabDetails.protocol === 'about:' || activeTabDetails.protocol === 'moz-extension:'; }; const useActiveTab = () => { getActiveTab(); - return { activeTabHost, isAboutPage }; + return { activeTabHost, isBrowserPage }; }; export default useActiveTab; diff --git a/src/popup/views/Proxy.vue b/src/popup/views/Proxy.vue index 7b142bc5..9dfc78e0 100644 --- a/src/popup/views/Proxy.vue +++ b/src/popup/views/Proxy.vue @@ -14,7 +14,7 @@ import { ConnectionKey, defaultConnection } from '@/composables/useConnection'; import useListProxies from '@/composables/useListProxies'; import useProxyPermissions from '@/composables/useProxyPermissions'; -const { isAboutPage } = useActiveTab(); +const { isBrowserPage } = useActiveTab(); const { getSocksProxies } = useListProxies(); const { proxyPermissionsGranted, triggerRequestProxyPermissions } = useProxyPermissions(); @@ -40,7 +40,7 @@ onMounted(loadProxies);
- +