I would like to know if there is a way to test the chrome.runtime.onInstalled handler. Basically I'm working on a chrome extension that uses the chrome storage to save certain data in memory. However in my new release version I would like to make changes to the data model of the chrome storage. For that reason I guess I need to write a migration file that fires when the old version is updated to the new chrome version und migrate the data.
chrome.runtime.onInstalled.addListener((details => {
if (details.reason === 'update') {
console.debug(`Upgrading from version ${details.previousVersion}`)
const previousVersion = parseVersion(details.previousVersion || '0.0.0')
if (compareVersions(previousVersion, [1, 1, 0]) <= 0) {
upgradeFrom1_1_0()
}
}
}))
I want to use onInstalled for this something like above, but I wonder if there is any way I can properly test this. Does anyone have an idea? Any suggestions are appreciated, thanks!
You have to create two distinct crx files. These are the steps:
Remember : Some browsers no longer allow installation from crx files. There are two ways to solve this nuisance. I tell you the fastest way. Install SRWare Iron browser which still allows this type of installation
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.