Currently, the OAuth2
process is only started after DOMContentLoaded
event emitted for TabSaver's BrowserAction
dialog box, which is completely not the proper optimization (architecture) approach, taking into consideration TabSaver's infrastructure and it's Life-Cycle.
Then, next to the Google Analytics [GA] code initialization, it is asynchronously(!) trying to request the Google API access_token
for further retrieve the basic user info. Requesting the access_token
causes the user to Sign in to his Chrome Account, which has a serious impact on the data extension is working with.
Currently, there is no interaction implemented between main TabSaver's functionality and OAuth2 process activities, which must be changed in order to make both modules properly handle the authentication flow and private data.
Since now it is required to coordinate any synced extension's data updates (like modifying any saved user Session
or even storing current one) according to the authentication status, the best solution will be to move all initial OAuth2 functionality earlier by the extension's Life-Cycle, and the best place will be to put it into the BackgroundPage
See related issues:
#1 Add verification if user is currently logged in to his Google account
#2 Restructure the source code