Home > Mobile >  Failed to load URL because the scheme does not have a registered handler, using extension URL
Failed to load URL because the scheme does not have a registered handler, using extension URL

Time:11-01

I'm trying to use window.open to open an extension page, I don't care about checking if the user has the extension, I just want to open a window that starts with extension://, it's not working and says failed to load url because the scheme does not have a registered handler. My code looks like this:

const openedWindow = window.open("extension://<extension url>", "", "width=300, height=300");

openedWindow.onload = () => {
  openedWindow.close();
}

this code works with normal urls, but not with ones starting with extension://. Is there any way to open a url like this?

edit: needed to use chrome-extension:// instead of just extension. Now there's a new problem, chrome is blocking the page. How do I fix this?

CodePudding user response:

It's because the correct URL for a chrome extension is chrome-extension://1234

Also popups should be explicitly allowed by a user interaction on the popup permission that Chrome asks in the URL bar

  • Related