Chrome extension: user protocol?

Are there methods for registering a user protocol with the google chrome extension, as you can in Firefox:

const kSIMPLEURI_CONTRACTID = "@mozilla.org/network/simple-uri;1"; 
const kIOSERVICE_CONTRACTID = "@mozilla.org/network/io-service;1"; 
const nsISupports = Components.interfaces.nsISupports; 
const nsIIOService = Components.interfaces.nsIIOService; 
const nsIProtocolHandler = Components.interfaces.nsIProtocolHandler; 
const nsIURI = Components.interfaces.nsIURI; 

I need a protocol:

Hug:

Not xyz: //

Is it possible?

+4
source share
1 answer

Chrome does not offer a way to set custom handlers for a schema xyz:.

There are several ways to emulate behavior:

  • Use content scripts to set up an event listener for clicks on links that point to xyz:....
  • API webRequest URL. , . , , - :

    Redirect http://google.com/search?q=xyz%3Awhatever
          to chrome-extension://.../whatever
    

, xyz:whatever omnibox.

navigator.registerProtocolHandler xyz:. , . web+. API.

+4

All Articles