I\'m writing a very simple Chrome extension to automatically clear my history as this isn\'t a built in feature. I\'ve got it functional but just want to confirm I\'ve done
This document lists an onSuspend event:
Clean-up before app closes
The app runtime sends the onSuspend() event to the event page before unloading it. Your event page can listen out for this event and do clean-up tasks before the app closes.
Once this event is fired, the app runtime starts the process of closing the app: all events stop firing and JavaScript execution is halted. Any asynchronous operations started while handling this event are not guaranteed to complete. Keep the clean-up tasks synchronous and simple.
chrome.runtime.onSuspend.addListener(function() { // Do some simple clean-up tasks. });
This document says the onSuspend
is also available for extensions