I am creating a chrome extension, when you click on the extension icon you will be asked to sing in or sign up.
When click "sign in" button a window will popup (see below) and ask you to enter your credentials.
I am using Firebase, so after the user sign in I want to store their UserID in local storage.
chrome.storage.local.set({UserID: userCredential.user.uid}, function(){
chrome.storage.local.get(["UserID"], function(result) {
console.log('Value currently is ' + result.key);
});
console.log("Stored in storage")
})
console.log('Value currently is ' + result.key) prints Value currently is undefined and when I look at the localstorage using DevTools, there is nothing there. There is no issue with my firebase code, when I do console.log(userCredential.user.uid) it prints the correct info.
This is my permission in manifest.json:
"permissions": [
"tabs",
"activeTab",
"scripting",
"*://*/*",
"storage",
"identity"
]
I want to store the userID in local storage, so when the user clicks on the extension icon, the extension checks to see if userID exists in local storage, and if userID is in local storage then it will display the user info. If there is no userID it will display the "Sign In/Sign Up" buttons.