Get credentials in background page js

This commit is contained in:
ronreg-ribdev 2021-01-03 01:49:48 -08:00
parent ed58ab0c0f
commit 0c29772555

View File

@ -1 +1,13 @@
const browser = require("webextension-polyfill");
console.log("Executing Urbit extension background main script");
browser.storage.sync.get("credentials")
.then((result) => {
console.log(result);
if (result.credentials && result.credentials.urbitId && result.credentials.urbitCode) {
console.log("Creds:");
console.log(result.credentials);
} else {
console.log("Couldn't find credentials");
}
});