How to determine if the chrome sync function is on? - Chrome extension

I want to use chrome.storage.sync, but I want to notify the user if the function is disabled or the user has not logged in. There seems to be no way to verify this. If the synchronization function is disabled or the user is not subscribed, it chrome.storage.syncsimply saves the data locally. Is there a way to determine if the synchronization feature is enabled and the user has signed up?

+5
source share
2 answers

Try the following:

if(chrome.sync.aboutInfo.type_status.length > 0) { //sync enabled
    ...
} else { // sync disabled
    ...
}
+1
source

, , , , . chrome.storage.sync , . , , .

+3

All Articles