I'd like to write an extension that handles specific URLs that have custom scheme (myscheme://). How do I declare my extension so it is invoked on such a request and intercepts it? (The URL can be clicked, typed directly in the address bar, passed in the command line, etc.). This is probably a beginner question, but I'm a beginner!
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
There is a JavaScript API that you can use for this.
navigator.registerProtocolHandler("mailto",
"https://www.example.com/?uri=%s",
"Example Mail");