Reputation: 9134
Is it possible to find out when a user installed a Chrome extension?
I know it's possible to save the date as local data when the user first uses the extension. I'm wondering if it's possible to get the date when the extension didn't store this data.
Upvotes: 2
Views: 5252
Reputation: 3838
You can try different approach instead of requesting "management" permission from the users (they may reject the app only because this permission if it's not connection with application purpose). You can use chrome.storage (https://developer.chrome.com/extensions/storage) API in you background / event page. Both will run just after installation complete. Then you can read some flag using chrome.storage API and if it isn't set it means that the app has been installed a moment ago (the script will run just after installation finish). User can't delete this data so it is reliable. After installation just set the flag so it will not recognize installation again.
If you use background page you just need to call it anywhere in the file. If you use Event page you need to register an event chrome.runtime.onInstalled (https://developer.chrome.com/extensions/runtime#event-onInstalled). Note that the onInstalled event is fired after app update or chrome update so you can't treat it as a one time registration event.
Upvotes: -1
Reputation: 77523
This is closest possible API: management
, ExtensionInfo
object.
Since it does not provide this information - no, this is not possible.
Upvotes: 3