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

时间:2012-01-20 18:23:33

标签: google-chrome google-chrome-extension

我开发了Chrome扩展程序,我希望在我的网站上有inline installation。 我有以下代码,但它似乎不起作用:

   <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>

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

1 个答案:

答案 0 :(得分:4)

在与海报讨论后,结果证明是Chrome错误,其中已验证的网站端口号未正确处理(即,如果已验证的网站为example.com:1337,则来自{{1}的内联安装请求}将失败,“安装只能由Chrome网上应用店项目的已验证网站启动”。

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