Browse Source

fix: show dashboard on FF start

also possibly in private containers that don't allow direct connection to the background script
tophf 3 years ago
parent
commit
3fa47f66f7
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/background/index.js

+ 1 - 1
src/background/index.js

@@ -81,7 +81,7 @@ const commandsForSelf = [
 ];
 
 async function handleCommandMessage({ cmd, data } = {}, src) {
-  if (src && src.origin !== extensionOrigin && commandsForSelf.includes(cmd)) {
+  if (src && !`${src.url}`.startsWith(extensionOrigin) && commandsForSelf.includes(cmd)) {
     throw `Command is only allowed in extension context: ${cmd}`;
   }
   const res = await commands[cmd]?.(data, src);