Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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

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?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading