I have the following code in an extension which listens when extensions get Installed and Enabled :
chrome.management.onInstalled.addListener(function (e0) {
console.log("installed", e0.name, "enabled=" + e0.enabled);
});
chrome.management.onEnabled.addListener(function (e2) {
console.log("enabled", e2.name, "enabled=" + e2.enabled);
});
The onEnabled event gets fired always after the onInstalled event is fired, which makes sense. But the enabled property of the extension in the onInstalled event is always set to true. I think this is not right. This property should not be set to true until the onEnabled event is fired. Or maybe I’m misunderstanding something here ?
Thanks for any clue on this.
Please understand chrome.management.onEnabled.addListener() is an Event Listener not a Method.
Why do you want to look for an additional Method\Overhead for enabling an extension\app, where enabling and disabling extensions is always possible after installation? Default value of enabled to true is a good approach and please do not rely on execution flow because event.addListener(function callback) is an asynchronous event.