Chrome扩展程序 - 内联安装无法正常工作

d3m*_*d3m 5 google-chrome google-chrome-extension

我开发了chrome扩展,我想在我的网站上进行内联安装.我有以下代码,但它似乎不起作用:

   <head>
        <link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/-extension_ID-">
        <script>
            function ExtInstall() {
                if (chrome.app.isInstalled) 
                    alert("already installed!");
                else 
                    chrome.webstore.install();
            }
        </script>
    </head>
    <body>
        <button onclick="ExtInstall()" id="install-button">Add to Chrome</button>
    </body>
Run Code Online (Sandbox Code Playgroud)

我还将网站与扩展程序相关联,但它仍然无效.即使我安装了扩展名chrome.webstore.install(),chrome.app.isInstalled也会返回false.什么也没做.有任何想法吗?

Mih*_*ita 3

与发帖者讨论后,发现这是一个 Chrome 错误,其中具有端口号的经过验证的站点未正确处理(即,如果经过验证的站点是example.com:1337,则来自的内联安装请求http://example.com:1337/install.html将失败,并显示“安装只能由 Chrome 启动”网上商店商品的经过验证的网站”。

我已提交Chromium bug 110917来跟踪此问题。