Chrome extension - embedded installation does not work

I developed the chrome extension and I want my site to have a built-in installation . I have the following code, but it does not work:

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

I also linked the site with the extension, but it still does not work. Chrome.app.isInstalled always returns false, even if I have the extension installed and chrome.webstore.install (); doing nothing. Any ideas?

+4
source share
1 answer

After discussing with the poster, this turns out to be a Chrome error, where verified sites with port numbers are not processed correctly (i.e. if the verified site is example.com:1337 , requests for integrated installation from http://example.com:1337/install.html " Installs can only be initiated on the Chrome Web Store website. "

I registered Chromium bug 110917 to track this.

+4
source

Source: https://habr.com/ru/post/1392102/


All Articles