Skip to content

Commit f8003e5

Browse files
committed
Fix the display of the browser action hover message
1 parent c72ca2b commit f8003e5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/helpers/browserAction.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ export const initBrowserAction = () => {
1212
const updateTabProxyBadge = async (tab: browser.tabs.Tab, activeProxyDetails: ProxyDetails) => {
1313
const { id: tabId, url } = tab;
1414
const { excludedHosts } = await browser.storage.local.get('excludedHosts');
15-
const tabHost = new URL(url!).host;
15+
const tabHost = new URL(url!).hostname;
1616

17-
const isExcluded = excludedHosts?.includes(tabHost);
17+
const isExcluded = tabHost.length !== 0 && excludedHosts?.includes(tabHost);
1818

1919
if (isExcluded) {
2020
browser.browserAction.setTitle({ tabId, title: `${tabHost} is set to never be proxied` });

src/helpers/socksProxy.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const getHostProxyDetails = async (): Promise<ProxyDetails> => {
2121
const proxiedHosts = Object.keys(hostProxiesDetailsParsed);
2222

2323
const activeTab = await browser.tabs.query({ active: true });
24-
const activeTabHost = new URL(activeTab[0].url!).host;
24+
const activeTabHost = new URL(activeTab[0].url!).hostname;
2525
if (
2626
proxiedHosts.includes(activeTabHost) &&
2727
hostProxiesDetailsParsed[activeTabHost].socksEnabled

0 commit comments

Comments
 (0)