From ae10f334f12fae67458593bc4b62c1767ba23bb7 Mon Sep 17 00:00:00 2001 From: Alphons Joseph <93847055+Crazypersonalph@users.noreply.github.com> Date: Sun, 15 Sep 2024 19:45:57 +0800 Subject: [PATCH 1/5] forked theme generator and placed within betterseqta organisation --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e52491f9..e84f04e7 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ ## Creating Custom Themes -If you are looking to create custom themes, I would recommend you start at the official documentation [here](https://betterseqta.gitbook.io/betterseqta-docs). You can see some premade examples along with a compilation script that can be used to allow for CSS frameworks and libraries such as SCSS to be used [here](https://github.com/SethBurkart123/BetterSEQTA-theme-generator). +If you are looking to create custom themes, I would recommend you start at the official documentation [here](https://betterseqta.gitbook.io/betterseqta-docs). You can see some premade examples along with a compilation script that can be used to allow for CSS frameworks and libraries such as SCSS to be used [here](https://github.com/BetterSEQTA/BetterSEQTA-Theme-Generator). Don't worry- if you get stuck feel free to ask around in the discord. We're open and happy to help out! Happy creating :) From e55e4c8a067a0e1829f03bc166b0869d096846db Mon Sep 17 00:00:00 2001 From: Alphons Joseph <93847055+Crazypersonalph@users.noreply.github.com> Date: Fri, 11 Oct 2024 09:14:43 +0800 Subject: [PATCH 2/5] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e84f04e7..f9afa194 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ - Brave Supported - Opera Supported - Vivaldi Supported + - Chromium-based browsers are supported - Firefox (Experimental - available [here](https://addons.mozilla.org/en-US/firefox/addon/betterseqta-plus/) - Safari (Experimental - only available via compilation) From b45b5cb22ff756f608d0330ffba39b1b893d6afe Mon Sep 17 00:00:00 2001 From: Andrew R <25roband@cbc.sa.edu.au> Date: Mon, 14 Oct 2024 06:36:02 +1030 Subject: [PATCH 3/5] fix: complete copy of code in css --- src/css/injected.scss | 153 +----------------------------------------- 1 file changed, 1 insertion(+), 152 deletions(-) diff --git a/src/css/injected.scss b/src/css/injected.scss index 680312f9..da0b497d 100644 --- a/src/css/injected.scss +++ b/src/css/injected.scss @@ -2615,157 +2615,6 @@ li.MessageList__unread___3imtO { margin: 0; } -.upcoming-items { - background: var(--background-primary); - width: 100%; - max-height: 55em; - overflow-y: auto; - display: flex; - flex-direction: column; - color: var(--text-primary); - transition: 200ms; - border-radius: 16px; -} -.dark .upcoming-items { - box-shadow: inset 0px 40px 80px -40px rgba(0,0,0,0.6); -} -.upcoming-assessment-title { - color: var(--text-primary); - transition: 200ms; - font-size: 10px; - margin: 0; -} -.upcoming-assessment { - border: 3px solid var(--item-colour); - margin: 5px 50px; - height: 6em; - padding: 0px; - border-radius: 10px; -} -.upcoming-assessment { - display: flex; -} -.upcoming-date-container { - margin-bottom: 20px; -} -.upcoming-date-title h5 { - margin: 0; - font-weight: 500; -} -.upcoming-details { - width: 60%; - display: flex; - flex-direction: column; - justify-content: center; - padding: 0px 12px; -} -.upcoming-details h5 { - text-transform: uppercase; - color: #aaaaaa; - padding: 0px 4px; - margin: 0; -} -.upcoming-details p { - font-size: 15px; - padding: 4px; -} -.upcoming-special-day { - font-size: 20px; -} -.upcoming-blank { - display: flex; - border-bottom: 2px solid #bebebe; - margin: 5px 50px; - height: 2em; - padding: 0px; -} -.upcoming-blank p { - padding: 0; - margin: 0; -} -.upcoming-title { - display: flex; - align-content: space-between; -} -.upcoming-filters { - display: flex; - height: 26px; - width: 65%; - align-self: center; - align-items: center; - color: var(--text-color); - padding: 5px; - overflow-x: scroll; - overflow-y: hidden; -} -.upcoming-checkbox-container { - position: relative; - padding: none !important; - padding-left: 25px !important; - padding-right: 10px !important; - cursor: pointer; - font-size: 12px; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - height: 20px; - align-items: center; - display: flex; -} -/* Hide the browser's default checkbox */ -.upcoming-checkbox-container input { - position: absolute; - opacity: 0; - cursor: pointer; - height: 0; - width: 0; - padding: 0; -} -/* Create a custom checkbox */ -.upcoming-checkmark { - position: absolute; - top: 0; - left: 0; - height: 15px; - width: 15px; - border: 3px solid var(--item-colour); - border-radius: 5px; - color: var(--text-color); -} -/* On mouse-over, add a grey background color */ -.upcoming-checkbox-container:hover input ~ .upcoming-checkmark { - filter: brightness(0.8); -} -/* When the checkbox is checked, add a blue background */ -.upcoming-checkbox-container input:checked ~ .upcoming-checkmark { - background: var(--item-colour); -} -/* Create the checkmark/indicator (hidden when not checked) */ -.upcoming-checkmark:after { - content: ""; - position: absolute; - display: none; -} -/* Show the checkmark when checked */ -.upcoming-checkbox-container input:checked ~ .upcoming-checkmark:after { - display: block; -} -/* Style the checkmark/indicator */ -.upcoming-checkbox-container .upcoming-checkmark:after { - left: 3.5px; - top: 0px; - width: 5px; - height: 10px; - border: solid white; - border-width: 0 3px 3px 0; - -webkit-transform: rotate(45deg); - -ms-transform: rotate(45deg); - transform: rotate(45deg); -} -.upcoming-hiddenassessment { - color: #797979; -} .titlebar { align-items: center; transition: 200ms; @@ -2982,4 +2831,4 @@ li.MessageList__unread___3imtO { background: var(--background-primary) !important; z-index: 1; padding: 10px; -} \ No newline at end of file +} From 052c06a04d5fad72289275992eb1a8436c0e13e5 Mon Sep 17 00:00:00 2001 From: sethburkart123 Date: Sun, 20 Oct 2024 11:19:47 +1100 Subject: [PATCH 4/5] bump: version + fixes --- package.json | 2 +- src/css/injected.scss | 4 ++++ src/manifests/manifest.json | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 917d8e93..aadca2d2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "betterseqtaplus", - "version": "3.3.1", + "version": "3.3.2", "type": "module", "description": "Enhance SEQTA Learn's usability and aesthetics! A fork of BetterSEQTA to continue development, while incorporating a plethora of new and improved features!", "browserslist": "> 0.5%, last 2 versions, not dead", diff --git a/src/css/injected.scss b/src/css/injected.scss index da0b497d..6153625c 100644 --- a/src/css/injected.scss +++ b/src/css/injected.scss @@ -82,6 +82,10 @@ html { z-index: 10000; } +.modaliser-container { + backdrop-filter: none !important; +} + .connectedNotificationsWrapper > div > button > svg > g { fill: var(--theme-primary) !important; } diff --git a/src/manifests/manifest.json b/src/manifests/manifest.json index a7a04d35..857fe1a6 100644 --- a/src/manifests/manifest.json +++ b/src/manifests/manifest.json @@ -22,6 +22,9 @@ "background": { "service_worker": "background.ts" }, + "content_security_policy": { + "extension_pages": "script-src 'self' 'wasm-unsafe-eval'; object-src 'self'" + }, "content_scripts": [ { "matches": ["*://*/*"], From cdfa6723efc2edea298d38967d7e1c2f96814b2f Mon Sep 17 00:00:00 2001 From: sethburkart123 Date: Sun, 20 Oct 2024 11:24:30 +1100 Subject: [PATCH 5/5] fix: add patchPackage to fix Chrome 130+ compatability --- lib/patchPackage.ts | 65 +++++++++++++++++++++++++++++++++++++++++++++ vite.config.ts | 4 ++- 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 lib/patchPackage.ts diff --git a/lib/patchPackage.ts b/lib/patchPackage.ts new file mode 100644 index 00000000..ab59850b --- /dev/null +++ b/lib/patchPackage.ts @@ -0,0 +1,65 @@ +/* + TEMPORARY FIX FOR CHROME 130+ builds +*/ + +import path from 'node:path'; +import fs from 'fs'; +import { PluginOption } from 'vite'; +import { ManifestV3Export } from '@crxjs/vite-plugin'; + +const manifestPath = path.resolve('dist/chrome/manifest.json'); + +export function updateManifestPlugin(): PluginOption { + return { + name: 'update-manifest-plugin', + enforce: 'post', + closeBundle() { + forceDisableUseDynamicUrl(); + }, + + configureServer(server) { + server.httpServer?.once('listening', () => { + const updated = forceDisableUseDynamicUrl(); + if (updated) { + server.ws.send({ type: 'full-reload' }); + console.log('** updated **'); + } + + fs.watchFile(manifestPath, () => { + console.log('** watchFile ** '); + const manifestContents = JSON.parse(fs.readFileSync(manifestPath, 'utf8')); + if (manifestContents.web_accessible_resources.some((resource: any) => resource.use_dynamic_url)) { + const updated = forceDisableUseDynamicUrl(); + if (updated) { + server.ws.send({ type: 'full-reload' }); + console.log('** updated **'); + } + } + }); + }); + }, + + writeBundle() { + console.log('### writeBundle ##'); + forceDisableUseDynamicUrl(); + }, + }; +} + +function forceDisableUseDynamicUrl() { + if (!fs.existsSync(manifestPath)) { + return false; + } + + const manifestContents = JSON.parse(fs.readFileSync(manifestPath, 'utf8')) as Awaited; + + if (typeof manifestContents === 'function' || !manifestContents.web_accessible_resources) return false; + if (manifestContents.web_accessible_resources.every((resource) => !resource.use_dynamic_url)) return false; + + manifestContents.web_accessible_resources.forEach((resource) => { + if (resource.use_dynamic_url) resource.use_dynamic_url = false; + }); + + fs.writeFileSync(manifestPath, JSON.stringify(manifestContents, null, 2)); + return true; +} diff --git a/vite.config.ts b/vite.config.ts index d31518f5..535c56e4 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,6 +1,7 @@ import { defineConfig } from 'vite'; import { join, resolve } from 'path'; +import { updateManifestPlugin } from './lib/patchPackage'; import { base64Loader } from './lib/base64loader'; import type { BuildTarget } from './lib/types'; @@ -31,7 +32,8 @@ export default defineConfig({ crx({ manifest: targets.find(t => t.browser === mode.toLowerCase())?.manifest ?? chrome.manifest, browser: mode.toLowerCase() === "firefox" ? "firefox" : "chrome" - }) + }), + updateManifestPlugin() ], root: resolve(__dirname, './src'), resolve: {