문제

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?

도움이 되었습니까?

해결책 2

Try this :

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

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top