Add browser extension context

This commit is contained in:
Idrees Hassan
2025-11-02 14:45:18 -05:00
parent 18749acff6
commit 8a6b1a584e
5 changed files with 283 additions and 61 deletions

View File

@@ -271,13 +271,13 @@ Promise.all([
/** @type {StickyNote[]} */
let stickyNotes = [];
function load() {
/** @type {Record<string, any>} */
let saveData = getContext().getSaveData();
async function load() {
/** @type {BirbSaveData|Object} */
let saveData = await getContext().getSaveData();
debug("Loaded data: " + JSON.stringify(saveData));
if (!saveData.settings) {
if (!('settings' in saveData)) {
log("No user settings found in save data, starting fresh");
}
@@ -373,8 +373,10 @@ Promise.all([
error("Failed to load font: " + e);
}
load();
load().then(onLoad);
}
function onLoad() {
styleElement.textContent = STYLESHEET;
document.head.appendChild(styleElement);