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
-
- -
- - + + +
+
+ +
+ + +