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?
source share