schoolbox web extension :)
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor: add .env to open schoolbox URL during development (#312)

authored by

willow and committed by
GitHub
dfc6fcd9 dc1353d6

+17 -3
+7
.env.example
··· 1 + # .env file is optional to automatically open an authenticated schoolbox session during development 2 + 3 + # base URL, excluding trailing slashes 4 + WXT_SCHOOLBOX_URL="https://help.schoolbox.com.au" 5 + 6 + # JSON web token, found at `base_url/user/token` 7 + WXT_SCHOOLBOX_JWT="eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6InNjaG9vbGJveCJ9..."
+2 -3
.gitignore
··· 1 - secrets.md 2 - 3 1 # Logs 4 2 logs 5 3 *.log ··· 15 13 stats-*.json 16 14 .wxt 17 15 web-ext.config.ts 18 - dist/ 16 + dist 17 + .env 19 18 20 19 # Editor directories and files 21 20 .vscode/*
+8
src/entrypoints/background.ts
··· 9 9 if (reason === "install") { 10 10 logger.info("[background] Opening wiki page after install"); 11 11 browser.tabs.create({ url: "https://schooltape.github.io/installed" }); 12 + 12 13 if (import.meta.env.DEV) { 13 14 logger.info("[background] Opening development URLs"); 14 15 browser.tabs.create({ url: "https://help.schoolbox.com.au/account/anonymous.php?" }); 15 16 browser.tabs.create({ url: browser.runtime.getURL("/popup.html") }); 17 + const schoolbox = { 18 + url: import.meta.env.WXT_SCHOOLBOX_URL, 19 + jwt: import.meta.env.WXT_SCHOOLBOX_JWT, 20 + }; 21 + if (schoolbox.url && schoolbox.jwt) { 22 + browser.tabs.create({ url: `${schoolbox.url}/api/session?jwt=${schoolbox.jwt}` }); 23 + } 16 24 } 17 25 } else if (reason === "update") { 18 26 logger.info("[background] Showing update badge");