【问题标题】:Can a chrome extension be opened when requesting specific external protocol?请求特定外部协议时可以打开 chrome 扩展程序吗?
【发布时间】:2015-02-02 00:08:50
【问题描述】:

我想写一个chrome扩展,当浏览器重定向到特定的外部协议时触发:myApp://...

我用谷歌搜索了一下,没有找到一种简单的元数据方法。

有没有办法在清单中定义它?

然后我希望扩展程序打开一个弹出窗口,我会在我的自动化测试中等待它。

【问题讨论】:

    标签: javascript google-chrome google-chrome-extension network-protocols


    【解决方案1】:

    理论上,您可以将protocol handlernavigator.registerProtocolHandler 一起使用,但有一些限制:

    • 自定义协议必须在 Chrome 中以 web+ 开头,例如web+myApp:
    • 无法在清单中声明它;根据this feature request 添加这种可能性,目前它会为用户弹出一个允许/拒绝信息栏。

    无论如何,opening a popup programmatically is impossible。最多可以在标签页中打开扩展页面。

    【讨论】:

    • FF怎么样? Custom protocols must start with web+?和There is no way to declare this in a manifest ?怎么写这样的插件?
    • 这将是一个我无法回答的不同问题,这超出了我的专业范围。
    猜你喜欢
    • 2016-09-09
    • 2023-03-19
    • 2013-10-02
    • 1970-01-01
    • 2013-05-11
    • 1970-01-01
    • 1970-01-01
    • 2011-10-11
    相关资源
    最近更新 更多