diff --git a/packages/extension-dapp/src/index.ts b/packages/extension-dapp/src/index.ts index 57283d2c92c..bf947af9dbe 100644 --- a/packages/extension-dapp/src/index.ts +++ b/packages/extension-dapp/src/index.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { InjectedAccount, InjectedAccountWithMeta, InjectedExtension, InjectedExtensionInfo, InjectedWindow, Unsubcall } from './types'; +import { InjectedAccount, InjectedAccountWithMeta, InjectedExtension, InjectedWindow, Unsubcall } from './types'; // our extension adaptor for other kinds of extensions import compatInjector from './compat'; @@ -44,9 +44,12 @@ export function web3Enable (originName: string): Promise Promise.all( Object.entries(win.injectedWeb3).map(([name, { enable, version }]) => - Promise - .all([Promise.resolve({ name, version }), enable(originName)]) - .catch(() => [{ name, version }, null] as [InjectedExtensionInfo, null]) + Promise.all([ + Promise.resolve({ name, version }), + enable(originName).catch((error: Error) => { + console.error(`Error initializing ${name}: ${error.message}`); + }) + ]) ) ) .then((values) => diff --git a/packages/extension/manifest.json b/packages/extension/manifest.json index a77647504f4..99802966d23 100644 --- a/packages/extension/manifest.json +++ b/packages/extension/manifest.json @@ -12,10 +12,7 @@ }, "content_scripts": [{ "js": ["content.js"], - "matches": [ - "https://polkadot.js.org/apps/*", - "http://localhost:3000/*" - ], + "matches": ["http://*/*", "https://*/*"], "run_at": "document_start" }], "icons": { diff --git a/packages/extension/src/background/handlers/index.ts b/packages/extension/src/background/handlers/index.ts index 2799cae9af9..04c040a2dcb 100644 --- a/packages/extension/src/background/handlers/index.ts +++ b/packages/extension/src/background/handlers/index.ts @@ -27,7 +27,7 @@ export default function handler ({ id, message, request }: MessageRequest, port: const sender = port.sender as chrome.runtime.MessageSender; const from = isPopup ? 'popup' - : sender.tab && sender.tab.url; + : (sender.tab && sender.tab.url) || sender.url; const source = `${from || FALLBACK_URL}: ${id}: ${message}`; console.log(` [in] ${source}`); // :: ${JSON.stringify(request)}`);