Is it possible to programmatically check if Chrome Sync is configured in Google Chrome?
The reason I ask is that I am coding an Extension for Chrome that depends on
I was able to get the status of sync is turned on or no along with the email ids. Here is the code :
create a manifest.json file with below content
{
"name": "Test turn on sync",
"version": "1.0",
"description": "Extension",
"permissions":[
"identity",
"identity.email"
],
"background": {
"scripts": ["background.js"],
"persistent": false
},
"manifest_version": 2
}
Create a background.js file in the same folder
chrome.identity.getProfileUserInfo(function(data) {
if (data.id) {
alert(data);
}
else
{
alert("User is not signed in to chrome.");
}
});
Add the folder as chrome extension Run the extension from chrome with the help of identity.email in permissions, you will be able to get even the email-id of the user who has turned on sync, along with status P.S : I modified the code from below answered thread