From 14b06a539542bd280127ff156c203f1397da430e Mon Sep 17 00:00:00 2001 From: skid-dev <62094231+skid-dev@users.noreply.github.com> Date: Thu, 2 Apr 2026 13:35:07 +1100 Subject: [PATCH 1/9] refactor: Move launcher functions to launcher dir. --- src/content/inject_css_tools.ts | 2 +- src/content/modules/launcher/display_results.ts | 4 ++-- src/content/{ => modules/launcher}/functions/darken.ts | 0 src/content/{ => modules/launcher}/functions/lighten.ts | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename src/content/{ => modules/launcher}/functions/darken.ts (100%) rename src/content/{ => modules/launcher}/functions/lighten.ts (100%) diff --git a/src/content/inject_css_tools.ts b/src/content/inject_css_tools.ts index 9c222cb..191bc8e 100644 --- a/src/content/inject_css_tools.ts +++ b/src/content/inject_css_tools.ts @@ -1,4 +1,4 @@ -import { darken } from "./functions/darken" +import { darken } from "./modules/launcher/functions/darken" function set_timetable_bg() { const timetable_elements = Array.from( diff --git a/src/content/modules/launcher/display_results.ts b/src/content/modules/launcher/display_results.ts index 312e1f4..49a8406 100644 --- a/src/content/modules/launcher/display_results.ts +++ b/src/content/modules/launcher/display_results.ts @@ -1,7 +1,7 @@ import type { FuseResultMatch } from "fuse.js" import { IndexedItem } from "../../../types/indexed_item" -import { lighten } from "../../functions/lighten" -import { darken } from "../../functions/darken" +import { lighten } from "./functions/lighten" +import { darken } from "./functions/darken" import { Settings } from "../../../types/settings" import { check_in_schoolbox_domain } from "../../../background/functions/utls/is_page" import { get_theme, rgb_to_hex } from "./detect_dark_theme" diff --git a/src/content/functions/darken.ts b/src/content/modules/launcher/functions/darken.ts similarity index 100% rename from src/content/functions/darken.ts rename to src/content/modules/launcher/functions/darken.ts diff --git a/src/content/functions/lighten.ts b/src/content/modules/launcher/functions/lighten.ts similarity index 100% rename from src/content/functions/lighten.ts rename to src/content/modules/launcher/functions/lighten.ts From ed79bc9843f34341584a964d621d761f44217450 Mon Sep 17 00:00:00 2001 From: willow <42willow@pm.me> Date: Thu, 2 Apr 2026 14:34:02 +1100 Subject: [PATCH 2/9] fix: capitalisation `SchoolTape` -> `Schooltape` (#11) --- README.md | 4 ++-- src/popup/popup.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d4c1a8c..a489752 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ A Chrome extension for the SchoolBox LMS with integrations for the Box of Books ## Features -### **SchoolTape users: Please enable __SchoolTape compatibility__ in the extension settings to ensure proper styling of elements created by modules in this extension!** -> This is a temporary workaround while automatic SchoolTape detection is still work in progress. +### **Schooltape users: Please enable __Schooltape compatibility__ in the extension settings to ensure proper styling of elements created by modules in this extension!** +> This is a temporary workaround while automatic Schooltape detection is still work in progress. - Launcher: A search bar for quick access to news articles and classes, as well as textbooks from Box of Books. - Search through book headings in Box of Books. diff --git a/src/popup/popup.html b/src/popup/popup.html index f2ea167..597f731 100644 --- a/src/popup/popup.html +++ b/src/popup/popup.html @@ -66,14 +66,14 @@

Settings

- +
- Enable style compatibility with SchoolTape. This disables some styles and uses SchoolTape styles instead. + Enable style compatibility with Schooltape. This disables some styles and uses Schooltape styles instead.
From 8cd0fb00c73efd15f6be06d46646efd4af6f67d0 Mon Sep 17 00:00:00 2001 From: skid-dev <62094231+skid-dev@users.noreply.github.com> Date: Thu, 2 Apr 2026 16:43:32 +1100 Subject: [PATCH 3/9] build: Bump module resolution version to Node16 --- tsconfig.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 9ae8c4d..cfc8a0c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,8 +1,8 @@ { "compilerOptions": { "target": "ESNext", - "module": "ESNext", - "moduleResolution": "node", + "module": "Node16", + "moduleResolution": "node16", "lib": ["DOM", "ESNext"], "strict": true, "esModuleInterop": true, From 97d014a92d97fb1e0e68914bacebd0f22c0b818e Mon Sep 17 00:00:00 2001 From: skid-dev <62094231+skid-dev@users.noreply.github.com> Date: Thu, 2 Apr 2026 16:46:33 +1100 Subject: [PATCH 4/9] build: Update tsconfig with updated moduleResolution --- tsconfig.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index cfc8a0c..4375266 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,8 +1,8 @@ { "compilerOptions": { "target": "ESNext", - "module": "Node16", - "moduleResolution": "node16", + "module": "ESNext", + "moduleResolution": "bundler", "lib": ["DOM", "ESNext"], "strict": true, "esModuleInterop": true, From 5d584c9ff0c8c2da290a7c67afe36dc25c689f7b Mon Sep 17 00:00:00 2001 From: skid-dev <62094231+skid-dev@users.noreply.github.com> Date: Thu, 2 Apr 2026 16:55:14 +1100 Subject: [PATCH 5/9] chore: Upgrade TypeScript version 4.5.4 -> 6.0.2 --- bun.lock | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bun.lock b/bun.lock index 8f47dcb..2ad1db3 100644 --- a/bun.lock +++ b/bun.lock @@ -34,7 +34,7 @@ "bun-types": "^0.1.0", "prettier": "3.5.3", "semantic-release": "^25.0.3", - "typescript": "^4.5.4", + "typescript": "^6.0.2", }, }, }, @@ -1029,7 +1029,7 @@ "type-fest": ["type-fest@4.41.0", "", {}, "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA=="], - "typescript": ["typescript@4.9.5", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g=="], + "typescript": ["typescript@6.0.2", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-bGdAIrZ0wiGDo5l8c++HWtbaNCWTS4UTv7RaTH/ThVIgjkveJt83m74bBHMJkuCbslY8ixgLBVZJIOiQlQTjfQ=="], "uglify-js": ["uglify-js@3.19.3", "", { "bin": { "uglifyjs": "bin/uglifyjs" } }, "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ=="], diff --git a/package.json b/package.json index 2030ea4..19322e9 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,6 @@ "bun-types": "^0.1.0", "prettier": "3.5.3", "semantic-release": "^25.0.3", - "typescript": "^4.5.4" + "typescript": "^6.0.2" } } From 154961c3399881feddbe7f9535251fff913bd01d Mon Sep 17 00:00:00 2001 From: skid-dev <62094231+skid-dev@users.noreply.github.com> Date: Thu, 2 Apr 2026 17:00:23 +1100 Subject: [PATCH 6/9] uhhh --- tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 4375266..f9f944b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,7 @@ "module": "ESNext", "moduleResolution": "bundler", "lib": ["DOM", "ESNext"], - "strict": true, + "strict": false, "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, From 247200ead1f47ee66bda766a300ba1eda42f475b Mon Sep 17 00:00:00 2001 From: skid-dev <62094231+skid-dev@users.noreply.github.com> Date: Thu, 2 Apr 2026 17:04:10 +1100 Subject: [PATCH 7/9] chore: add types for chrome + enable strict mode --- bun.lock | 4 ++-- package.json | 2 +- tsconfig.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bun.lock b/bun.lock index 2ad1db3..2b08466 100644 --- a/bun.lock +++ b/bun.lock @@ -9,7 +9,7 @@ "@babel/preset-env": "^7.27.2", "@babel/preset-react": "^7.27.1", "@babel/preset-typescript": "^7.27.1", - "@types/chrome": "^0.0.320", + "@types/chrome": "^0.1.38", "@types/html-to-text": "^9.0.4", "babel-loader": "^10.0.0", "copy-webpack-plugin": "^13.0.0", @@ -313,7 +313,7 @@ "@sindresorhus/merge-streams": ["@sindresorhus/merge-streams@4.0.0", "", {}, "sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ=="], - "@types/chrome": ["@types/chrome@0.0.320", "", { "dependencies": { "@types/filesystem": "*", "@types/har-format": "*" } }, "sha512-LD0O6hqayM4/InMUB2fOGSh7lFkUlusa40mk6iUAxs0RHfvRYjjsDoRGsDh2DEJWP4Ckccf00FVhkhDHHIqy7g=="], + "@types/chrome": ["@types/chrome@0.1.38", "", { "dependencies": { "@types/filesystem": "*", "@types/har-format": "*" } }, "sha512-5aK4m9wZqoWAoB98aElESLm/5pXpqJnFWMNoiCs/XdPsXR6wNdVkJFSdQ9Wr4PnTuUrxD0SuNuDHh3EG5QeBzA=="], "@types/eslint": ["@types/eslint@9.6.1", "", { "dependencies": { "@types/estree": "*", "@types/json-schema": "*" } }, "sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag=="], diff --git a/package.json b/package.json index 19322e9..c7debb8 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "@babel/preset-env": "^7.27.2", "@babel/preset-react": "^7.27.1", "@babel/preset-typescript": "^7.27.1", - "@types/chrome": "^0.0.320", + "@types/chrome": "^0.1.38", "@types/html-to-text": "^9.0.4", "babel-loader": "^10.0.0", "copy-webpack-plugin": "^13.0.0", diff --git a/tsconfig.json b/tsconfig.json index f9f944b..4375266 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,7 @@ "module": "ESNext", "moduleResolution": "bundler", "lib": ["DOM", "ESNext"], - "strict": false, + "strict": true, "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, From 02f647811678839db7ddf35bf667ead33483d4c7 Mon Sep 17 00:00:00 2001 From: skid-dev <62094231+skid-dev@users.noreply.github.com> Date: Thu, 2 Apr 2026 17:05:33 +1100 Subject: [PATCH 8/9] i hate typescript sm --- tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/tsconfig.json b/tsconfig.json index 4375266..e29c2b5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,6 +4,7 @@ "module": "ESNext", "moduleResolution": "bundler", "lib": ["DOM", "ESNext"], + "types": ["chrome"], "strict": true, "esModuleInterop": true, "skipLibCheck": true, From 630967392ec705a50c7cadeafd2c8b46c8748de2 Mon Sep 17 00:00:00 2001 From: skid-dev <62094231+skid-dev@users.noreply.github.com> Date: Thu, 2 Apr 2026 17:16:20 +1100 Subject: [PATCH 9/9] build: Update Node version. --- src/popup/popup.ts | 2 +- src/storage/get.ts | 2 +- src/storage/revisions/revision_get.ts | 2 +- src/storage/set.ts | 14 +++++++------- src/storage/viewed_pages.ts | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/popup/popup.ts b/src/popup/popup.ts index 27b7181..f9124de 100644 --- a/src/popup/popup.ts +++ b/src/popup/popup.ts @@ -52,7 +52,7 @@ function applyTheme(theme: string) { // Load settings chrome.storage.sync.get(["settings", "theme"], result => { - const settings: Settings = result.settings + const settings = result.settings as Settings | undefined if (!settings) return // load input settings diff --git a/src/storage/get.ts b/src/storage/get.ts index a6a1c71..560beef 100644 --- a/src/storage/get.ts +++ b/src/storage/get.ts @@ -9,7 +9,7 @@ export async function get_all_news_channels(): Promise { export async function get_news_channel(channel_name: string): Promise { const news_channel = await chrome.storage.local.get(`news_channel_${channel_name}`) - return news_channel[`news_channel_${channel_name}`] || [] + return news_channel[`news_channel_${channel_name}`] as ItemRecord[] || [] } export async function get_news_item( diff --git a/src/storage/revisions/revision_get.ts b/src/storage/revisions/revision_get.ts index fbe7dcc..3d80fd1 100644 --- a/src/storage/revisions/revision_get.ts +++ b/src/storage/revisions/revision_get.ts @@ -4,5 +4,5 @@ import { get_storage_key } from "./common" export async function get_revision(rev_id: string): Promise { const item_name = get_storage_key(rev_id) const result = await chrome.storage.local.get([item_name]) - return result[item_name] || null + return result[item_name] as RevisionHistoryEntry || null } diff --git a/src/storage/set.ts b/src/storage/set.ts index 7c0a152..67d74e1 100644 --- a/src/storage/set.ts +++ b/src/storage/set.ts @@ -30,7 +30,7 @@ export async function add_item_to_channel(channel_name: string, item: ItemRecord return false } - const channel_items: ItemRecord[] = channel_data[channel_key] || [] + const channel_items: ItemRecord[] = channel_data[channel_key] as ItemRecord[] || [] // Check if the item already exists in the channel const item_exists = channel_items.some(existing_item => existing_item.guid === item.guid) @@ -59,7 +59,7 @@ export async function update_item_properties( return } - let channel_items: ItemRecord[] = channel_data[channel_key] || [] + let channel_items: ItemRecord[] = channel_data[channel_key] as ItemRecord[] || [] // Update the item properties channel_items = channel_items.map(item => { @@ -83,7 +83,7 @@ export async function update_item_vc_and_lvt(channel_name: string, item_guid: st return null } - let channel_items: ItemRecord[] = channel_data[channel_key] || [] + let channel_items: ItemRecord[] = channel_data[channel_key] as ItemRecord[] || [] // Increment the view count for the specified item let updated_view_count: number | null = null @@ -109,7 +109,7 @@ export async function increment_item_bounce_count(channel_name: string, item_gui return } - let channel_items: ItemRecord[] = channel_data[channel_key] || [] + let channel_items: ItemRecord[] = channel_data[channel_key] as ItemRecord[] || [] // Increment the bounce count for the specified item channel_items = channel_items.map(item => { @@ -132,7 +132,7 @@ export async function add_revision_history_entry(channel_name: string, item_guid return [] } - let channel_items: ItemRecord[] = channel_data[channel_key] || [] + let channel_items: ItemRecord[] = channel_data[channel_key] as ItemRecord[] || [] // Add the revision ID to the item's revision history let updated_rev_history: string[] = [] @@ -159,7 +159,7 @@ export async function remove_item_from_channel(channel_name: string, item_guid: return } - let channel_items: ItemRecord[] = channel_data[channel_key] || [] + let channel_items: ItemRecord[] = channel_data[channel_key] as ItemRecord[] || [] // Remove the item from the channel channel_items = channel_items.filter(item => item.guid !== item_guid) @@ -180,7 +180,7 @@ export async function add_if_not_exists( return false } - let channel_items: ItemRecord[] = channel_data[channel_key] || [] + let channel_items: ItemRecord[] = channel_data[channel_key] as ItemRecord[] || [] // Check if the item already exists in the channel const item_exists = channel_items.some(existing_item => existing_item.guid === item_guid) diff --git a/src/storage/viewed_pages.ts b/src/storage/viewed_pages.ts index e19be54..8c06855 100644 --- a/src/storage/viewed_pages.ts +++ b/src/storage/viewed_pages.ts @@ -16,7 +16,7 @@ export async function add_url_to_recents(url: string, name: string): Promise entry.url === url) @@ -46,7 +46,7 @@ export async function get_recents(): Promise { await ensure_recents_exists() let data = await chrome.storage.local.get(RECENTS_KEY) - let recents: RecentsEntry[] = data[RECENTS_KEY] + let recents: RecentsEntry[] = data[RECENTS_KEY] as RecentsEntry[] || [] return recents }