Skip to content

Commit

Permalink
Exclude extension page from proxying
Browse files Browse the repository at this point in the history
  • Loading branch information
ruihildt committed Aug 14, 2024
1 parent f625848 commit ce26c58
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/components/Proxy/HomeProxyStatus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -33,7 +33,7 @@ const currentHostExcluded = computed(() => {
</IconLabel>

<IconLabel
v-if="globalProxyEnabled && connection.isMullvad && !isAboutPage"
v-if="globalProxyEnabled && connection.isMullvad && !isBrowserPage"
type="info"
class="my-2"
>
Expand Down
7 changes: 4 additions & 3 deletions src/composables/useActiveTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
4 changes: 2 additions & 2 deletions src/popup/views/Proxy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -40,7 +40,7 @@ onMounted(loadProxies);
</IconLabel>

<div>
<ProxyHost v-if="!isAboutPage" />
<ProxyHost v-if="!isBrowserPage" />
<ProxyGlobal />
<LocationDrawer />
</div>
Expand Down

0 comments on commit ce26c58

Please sign in to comment.