diff --git a/src/entries/Background/db.ts b/src/entries/Background/db.ts index 4677e03..1b2b760 100644 --- a/src/entries/Background/db.ts +++ b/src/entries/Background/db.ts @@ -234,10 +234,16 @@ export async function getPlugins(): Promise< ret.push({ ...config, hash, - metadata: metadata || { - filePath: '', - origin: '', - }, + metadata: metadata + ? { + ...metadata, + hash, + } + : { + filePath: '', + origin: '', + hash, + }, }); } } diff --git a/src/pages/GetPluginsApproval/index.tsx b/src/pages/GetPluginsApproval/index.tsx index f6e4509..8ed2e0d 100644 --- a/src/pages/GetPluginsApproval/index.tsx +++ b/src/pages/GetPluginsApproval/index.tsx @@ -58,7 +58,7 @@ export function GetPluginsApproval(): ReactElement { }); setResult(res); })(); - }, [url, filterMetadata]); + }, [url, JSON.stringify(filterMetadata)]); return ( { + if (request.type === SidePanelActionTypes.panel_opened) { + browser.runtime.onMessage.removeListener(listener); + resolve(); + } + }; + + browser.runtime.onMessage.addListener(listener); + // @ts-ignore if (chrome.sidePanel) await chrome.sidePanel.open({ tabId: tab.id }); + await promise; + + browser.runtime.sendMessage({ + type: SidePanelActionTypes.execute_plugin_request, + data: { + pluginHash: hash, + }, + }); + browser.runtime.sendMessage({ type: BackgroundActiontype.run_plugin_response, data: true,