From 0c2977255589d3005070e9b7f8fff6a508f8d543 Mon Sep 17 00:00:00 2001 From: ronreg-ribdev Date: Sun, 3 Jan 2021 01:49:48 -0800 Subject: [PATCH] Get credentials in background page js --- extension/background/main.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/extension/background/main.js b/extension/background/main.js index 249f91c..76d12f8 100644 --- a/extension/background/main.js +++ b/extension/background/main.js @@ -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"); + } + });