diff --git a/apps/extension/src/core/page.ts b/apps/extension/src/core/page.ts index 8023de625d..13aa096fc9 100644 --- a/apps/extension/src/core/page.ts +++ b/apps/extension/src/core/page.ts @@ -39,19 +39,10 @@ const enable = async (origin: string): Promise => { return new TalismanInjected(messageService.sendMessage) as Injected } -export const isTalismanHostname = (url: string | undefined) => { - if (!url) return false - try { - const hostname = new URL(url).hostname - return ( - hostname === TALISMAN_WEB_APP_DOMAIN || - (DEBUG && hostname?.endsWith(".talisman.pages.dev")) || - (DEBUG && ["localhost", "127.0.0.1"].includes(hostname)) - ) - } catch (e) { - return false - } -} +export const isTalismanHostname = (hostname: string | undefined) => + hostname === TALISMAN_WEB_APP_DOMAIN || + (DEBUG && hostname?.endsWith(".talisman.pages.dev")) || + (DEBUG && ["localhost", "127.0.0.1"].includes(hostname ?? "")) function inject() { // inject substrate wallet provider diff --git a/apps/extension/src/ui/apps/popup/pages/Connect.tsx b/apps/extension/src/ui/apps/popup/pages/Connect.tsx index ffbb30e118..69ec1df87a 100644 --- a/apps/extension/src/ui/apps/popup/pages/Connect.tsx +++ b/apps/extension/src/ui/apps/popup/pages/Connect.tsx @@ -158,6 +158,7 @@ export const Connect: FC<{ className?: string }> = ({ className }) => {