From aaaf72eceb778f23a9cb7b980e4a4f5e2f26210b Mon Sep 17 00:00:00 2001 From: diegomarzaa Date: Sat, 9 May 2026 13:52:10 +0200 Subject: [PATCH] v3, multiple improvements, bug fixes, profiles feature, custom webpage and youtube support, improved design --- CHANGES.md | 237 ++++++++++ README.md | 93 +++- accounts.js | 136 ------ app.js | 565 ++++++++++++++++++++++ background.js | 180 ------- images/128.png | Bin 2939 -> 2955 bytes images/16.png | Bin 513 -> 504 bytes images/32.png | Bin 893 -> 945 bytes images/48.png | Bin 1278 -> 1327 bytes images/logos/youtube.png | Bin 0 -> 331 bytes manifest.json | 143 ++++-- manifest_firefox.json | 89 ++-- popup.html | 265 ++++++++--- profiles.js | 310 ++++++++++++ rules.js | 455 ++++++++++++------ service-worker.js | 289 ++++++++++++ styles.css | 989 ++++++++++++++++++++++++++++++--------- utils.js | 492 ++++++++----------- 18 files changed, 3082 insertions(+), 1161 deletions(-) create mode 100644 CHANGES.md delete mode 100644 accounts.js create mode 100644 app.js delete mode 100644 background.js create mode 100644 images/logos/youtube.png create mode 100644 profiles.js create mode 100644 service-worker.js diff --git a/CHANGES.md b/CHANGES.md new file mode 100644 index 0000000..3555d20 --- /dev/null +++ b/CHANGES.md @@ -0,0 +1,237 @@ +# Changes from the original DefaultWTF extension + +This documents every change made relative to the original v1.14 extension from [Uptech](https://www.default.wtf/). + +--- + +## Manifest V3 migration + +**File:** `manifest.json` + +The original used Manifest V2, which is deprecated and being phased out by Chrome and Brave. + +- `manifest_version`: `2` → `3` +- `browser_action` → `action` +- `background.scripts` + `persistent: true` → `background.service_worker` +- `webRequest` + `webRequestBlocking` permissions removed — these are not available in MV3 +- `` permission removed — replaced with explicit `host_permissions` for Google, YouTube, and Blogger domains +- Navigation interception now uses `chrome.webNavigation.onBeforeNavigate` instead of `chrome.webRequest.onBeforeRequest` +- `update_url` removed (not needed for unpacked/sideloaded extensions) +- `minimum_chrome_version` raised from `40` to `88` + +**Why host_permissions are explicit:** MV3 disallows the `*.google.co.*` wildcard pattern (dots in the middle of hostnames are not allowed in match patterns). The manifest now enumerates all major Google country TLDs explicitly. + +--- + +## Bug fixes + +### `signIn()` referenced undefined variable +**File:** `accounts.js` (original) + +The `signIn()` function's callback referenced `info[3]` (the raw array element) instead of `user.email`. This caused a `ReferenceError` when clicking a signed-out account. + +**Fix:** Replaced with `user.email` using the correctly scoped `user` variable. + +### Account #0 never redirected +**File:** `background.js` (original) + +The redirect condition included `accountId !== 0`, meaning the first Google account was never enforced. If your default was account #0, the extension silently did nothing. + +**Fix:** Removed the `accountId !== 0` guard. Account #0 is now handled by making `isAccountLoggedIn(0)` always return `true` (since index 0 is the primary account and always logged in by definition). + +### `DOMParser` unavailable in service workers +**File:** `background.js` (original) + +The account-fetching code used `new DOMParser()` to parse Google's response, but `DOMParser` is not available in MV3 service worker contexts. + +**Fix:** Replaced with a regex-based script tag extraction: `rawText.match(/]*>([\s\S]*?)<\/script>/i)`. + +### Typo: `redirectCurrectTab` +**File:** `utils.js` (original) + +Renamed to `redirectCurrentTab` throughout. + +### Script load-order bug (introduced during rewrite, fixed here) +**File:** `popup.html` + +The earlier rewrite placed ` + + +
- Default Account for Google™ products Default Account for Google™ products + Default Account for Google products + Default Account for Google™ products
-
- -
- - + + +
+
+ +
+ + +