So I have a chrome extension that I'm implementing with IndexedDB. The extension uses a content script which stores a record to the database every time the user casts a vote on a comment. I'm wondering how frequently I should open and close the connection.
I never close the connection and never see problem.
Just make sure, you listen to onversionchange of idb (not idb open request) to close the connection. It is the only time to close the connection. Otherwise browser will close for you.