v3, multiple improvements, bug fixes, profiles feature, custom webpag…#42
Open
diegomarzaa wants to merge 1 commit into
Open
v3, multiple improvements, bug fixes, profiles feature, custom webpag…#42diegomarzaa wants to merge 1 commit into
diegomarzaa wants to merge 1 commit into
Conversation
…e and youtube support, improved design
There was a problem hiding this comment.
Pull request overview
This PR is a Manifest V3 rewrite of the extension with a redesigned popup UI and a new “profiles” model for per-context defaults/rules, plus expanded URL/service support (notably YouTube) and import/export.
Changes:
- Migrates MV2 background/webRequest logic to an MV3 service worker using
webNavigationinterception. - Adds profiles (inheritance/override), rules editor redesign, quick-switch UI, and import/export + behaviour settings.
- Expands supported services and URL matching (YouTube/Blogger and more Google services).
Reviewed changes
Copilot reviewed 13 out of 18 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
utils.js |
Reworked URL matching/redirect helpers; added service catalog, profile model + storage helpers, global settings defaults. |
service-worker.js |
New MV3 background worker: state loading, migration, navigation interception, messaging, profile switching redirect logic. |
app.js |
New popup “orchestrator” for profiles, quick-switch, settings overlay, import/export, and behaviour settings wiring. |
rules.js |
Replaced legacy rules UI with profile-aware rules editor (including inherited rule override UX). |
profiles.js |
New profile CRUD UI (create/edit/duplicate/delete/activate) rendered in settings overlay. |
popup.html |
Full popup layout rewrite: profile bar, quick-switch, banner + tab chooser, settings overlay & templates. |
styles.css |
Large UI redesign: variables, dark mode, new components (chips, overlays, modals, rules editor). |
manifest.json |
MV3 manifest, service worker entry, permissions/host_permissions, commands, min Chrome bump. |
manifest_firefox.json |
Updated MV2 Firefox manifest wiring to new background logic + permissions. |
README.md |
Updated documentation for fork/profiles/features/install + new architecture. |
CHANGES.md |
New detailed changelog for the rewrite and feature set. |
background.js |
Removed legacy MV2 background script. |
accounts.js |
Removed legacy accounts tab logic (moved into app.js). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+202
to
+204
| function handleNavigation(tabId, url) { | ||
| if (!isGoogleServiceUrl(url) && !isCustomServiceUrl(url)) return; | ||
|
|
| @@ -0,0 +1,289 @@ | |||
| importScripts("utils.js"); | |||
Comment on lines
3
to
+7
| function isGoogleServiceUrl(url) { | ||
| return ( | ||
| /^https?:\/\/[^?&]*(?:mail|drive|calendar|meet|docs|admin|photos|translate|keep|hangouts|chat|workspace|maps|news|ads|ediscovery|jamboard|earth|podcasts|classroom|business|myaccount|adsense|cloud|adwords|analytics|firebase|play|voice|tagmanager|duo|datastudio|optimize|merchants|finance|colab.research|contacts|script|messages|search|stadia|developers|one|chrome|books|sites|groups)\.google\.co.*/i.test( | ||
| url | ||
| ) || | ||
| // test several services that witched from the patter "https://maps.google.com" -> https://www.google.com/maps | ||
| /^https?:\/\/(www\.)?google\.co(?:m|\.[a-z]{2,3})\/(?:maps|finance|travel|flights)/i.test( | ||
| url | ||
| ) | ||
| /^https?:\/\/[^?&]*(?:mail|drive|calendar|meet|docs|admin|photos|translate|keep|hangouts|chat|workspace|maps|news|ads|ediscovery|jamboard|earth|podcasts|classroom|business|myaccount|adsense|cloud|adwords|analytics|firebase|play|voice|tagmanager|duo|datastudio|optimize|merchants|finance|colab\.research|contacts|script|messages|search|stadia|developers|one|chrome|books|sites|groups|blogger|gemini|notebooklm|looker)\.google\.co.*/i.test(url) || | ||
| /^https?:\/\/(www\.)?google\.co(?:m|\.[a-z]{2,3})\/(?:maps|finance|travel|flights|shopping|books|scholar)/i.test(url) || | ||
| /^https?:\/\/(www\.)?youtube\.com/i.test(url) || |
Comment on lines
+285
to
+287
| const escaped = name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); | ||
| if (new RegExp(`^https?:\\/\\/[^?&]*${escaped}\\.google\\.co.*`, "is").test(url)) return rule.accountId; | ||
| } |
| // ─── Global settings (independent of profiles) ─────────────────────────────── | ||
|
|
||
| const DEFAULT_SETTINGS = { | ||
| enforceOnPrecachedUrls: true, |
Comment on lines
+158
to
+161
| When disabled (default), the original behaviour is preserved: URLs that already have `/u/N` or `authuser` are passed through unchanged (fast path, avoids unnecessary redirects). | ||
|
|
||
| **Implementation:** | ||
| - `DEFAULT_SETTINGS` in `utils.js` defines `enforceOnPrecachedUrls: false` |
Comment on lines
9
to
14
| <a href="https://default.wtf/" target="_blank" class="link"> | ||
| <header> | ||
| <img src="images/logo.svg" alt="Default Account for Google™ products" /> Default Account for Google™ products | ||
| <img src="images/logo.svg" alt="Default Account for Google products" /> | ||
| Default Account for Google™ products | ||
| </header> | ||
| </a> |
Comment on lines
+189
to
+192
| <p class="settings-desc"> | ||
| Version 3.0 — Forked and improved from | ||
| <a href="https://default.wtf/" target="_blank">Uptech</a>. | ||
| BSD 3-Clause License. |
Comment on lines
+122
to
+124
| function makeProfile(name, color, overrides = {}) { | ||
| return { | ||
| id: crypto.randomUUID(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…e and youtube support, improved design