Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to check if Chrome extension has fully installed
    primarykey
    data
    text
    <p>Using Chrome Web Store inline installation ( <a href="https://developers.google.com/chrome/web-store/docs/inline_installation" rel="nofollow noreferrer">https://developers.google.com/chrome/web-store/docs/inline_installation</a> ) it is possible to specify a callback for <code>chrome.webstore.install()</code> that will be executed when the extension is successfully installed.</p> <p>Through some very tedious debugging I've learned that extensions are not neccessarily 100% installed when the callback is executed - maybe the background hasn't been loaded or content scripts aren't yet available.</p> <p>In my particular case the problem presents itself in this way:</p> <ol> <li>User clicks install button with <code>chrome.webstore.install()</code> bound to <code>onclick</code> event.</li> <li>Success callback injects an iFrame.</li> <li>Content script is defined for the iFrame and injected to do some finishing work</li> <li>Content script returns with a completed installation dialog.</li> </ol> <p>Step 3 is the problem. Some times the iFrame will be injected before content script is fully loaded and thus no script will be injected (content scripts are only injected inside newly created iFrames, not iFrames already existing when the extension is installed/enabled).</p> <p>I know there are possible workarounds such as having the extension itself inject the iFrame or a simple <code>setTimeout()</code>, but for the sake of helping others I think it's worth asking the question:</p> <p><strong>How can I be certain that the extension is 100% installed, when the <code>chrome.webstore.install()</code> callback doesn't ensure it?</strong></p> <p>Using the famous <code>&lt;img&gt;</code> load method described in <a href="https://stackoverflow.com/questions/8042548/checking-if-user-has-a-certain-extension-installed">Checking if user has a certain extension installed</a> doesn't work reliably (for those thinking that'd be a solution).</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload