javascriptgoogle-chrome-extensionuri-scheme

Is there any way to invoke an external URI scheme?


Is there any way to start an application by using an (already registered) URI scheme from my extension's code?

I want to monitor something through background.js and start an app by URI scheme automatically


Solution

  • You can do so by appending an iframe to your background page.

    Again with the Steam example:

    var frame = document.createElement("iframe");
    frame.src = "steam://open/main";
    // Needs to be inserted into document to trigger load
    document.body.appendChild(frame);
    document.body.removeChild(frame);