DEV Community

adrianbecker013
adrianbecker013

Posted on

Load HTML pages dynamically with interact DOM in default chrome extension popup box?

We need to load HTML pages dynamically with interact HTML DOM from chrome.storage.sync.get() stored user details in default chrome extension popup box?, Can you please help me how I can do that?
chrome.storage.sync.get(["user"], function(items) {
if (!items.user)
{
window.location.href = "login.html";
}
else
{

$("#usernameId").text('Welcome '+items.user.username);

$("#totCreditId").text(items.user.tot_credit);

$("#customLeftCreditId").text(items.user.left_credit);
window.location.href = "main.html";
}
});
It working fine but user details are not reflected in HTML page, How we can do that?

Thanks in advance!

Top comments (0)