I want to use chrome.storage.sync
but I want to notify user if the feature is turned off or user is not signed in. Apparently, there's no way to check this. If the sync feature is turned off or user is not signed in, chrome.storage.sync
simply stores data locally.
Is there any way to detect if the sync feature is turned on and user is signed in?
Asked
Active
Viewed 852 times
5

Uzair Farooq
- 2,402
- 3
- 24
- 37
-
7Possible duplicate of http://stackoverflow.com/questions/8887770/google-chrome-sync-check-if-enabled-via-api-extension – Halim Qarroum Mar 22 '13 at 11:34
2 Answers
3
This question has the information you are looking for, it does not appear that chrome provides a way to detect if the user is logged in or not for chrome sync. You could always just use chrome.storage.sync regardless of whether they are logged in or not. Just inform your users that if they do not have chrome sync enabled their saved data will not persist to their other machines.
1
Try this :
if(chrome.sync.aboutInfo.type_status.length > 0) { //sync enabled
...
} else { // sync disabled
...
}

RodolpheChe
- 599
- 5
- 6
-
-
Yes, I made the test on the **chrome://sync** url and it worked. We just need to wait for Google to add the **sync** permission to chrome extensions. – RodolpheChe Mar 29 '13 at 16:20
-
1It worked on the **chrome://sync** page. I'm not sure if I'll be able to use it in my extension but I'd accept it. Thanks :) – Uzair Farooq Mar 29 '13 at 18:29