How can an open tab get notified that a Chrome extension has just been installed, when the installation was done through the Chrome Web Store instead of inline-installation?
Context
Since June 2018 and onwards Chrome has deprecated inline installation hence the following mechanism to get notified if extension was installed won't work from now on:
chrome.webstore.install(url, successCallback, failureCallback)
From now on extensions must be installed only via the Web Store.
We've built a screen share extension that allows prompting the user to share his screen.
When our users hit "Share Screen", we intend to redirect them to the Chrome extension within the Web Store and as soon as they install the extension to re-trigger the Share Screen functionality.
Here's how I solved it from the background script (w/o using a content script):
background.js
onInstalled
event.postMessage
notifying that installation was succesful.manifest.json
Just make sure both
externally_connectable
andpermissions
declare the URL patterns of the sites you want to notify.Web page
Just listen somewhere for the
postMessage
message fired by the extension on succesful installation.Credits