Skip to content

v1.4.0: Support PAC Script URL#61

Merged
SYM01 merged 2 commits intomainfrom
develop
Apr 16, 2026
Merged

v1.4.0: Support PAC Script URL#61
SYM01 merged 2 commits intomainfrom
develop

Conversation

@SYM01
Copy link
Copy Markdown
Collaborator

@SYM01 SYM01 commented Apr 16, 2026

No description provided.

SYM01 and others added 2 commits April 16, 2026 23:02
Closes #41. PAC profiles can now be populated from a remote URL instead
of pasting the script inline. Each URL-backed profile has its own
refresh interval (5m to 24h, or disabled) and its own alarm; the active
profile is also refreshed on service-worker wake if it's been stale for
more than 5 minutes.

- `PacScriptConfig` carries `data`, `sourceURL`, `refreshIntervalMinutes`,
  `lastFetched`, `lastError`; the chrome-native PacScript type only
  crosses the adapter boundary, so the new fields never leak into
  `chrome.proxy.settings`.
- `pacFetcher.ts` handles one-shot fetches (with 15s timeout + 1MB cap),
  change-detection, per-profile alarm reconciliation, and wake-time
  refresh of the active profile.
- Added `alarms` permission + `createPeriodicAlarm` / `clearAlarm` /
  `getAllAlarmNames` / `onAlarm` to the adapter layer.
- `ProfileConfig.vue` adds a URL input, Fetch Now button, interval
  select (defaults to every hour), and last-fetched / last-error
  indicators using `a-typography-text`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
`onProfileUpdate` was an in-memory callback list, so saves made from the
popup/config page never reached the background. Alarm reconciliation
therefore missed interval changes until the next service-worker wake.

Route `onProfileUpdate` through `chrome.storage.local.onChanged` instead
— the browser dispatches storage events in every extension context, so
subscribers fire regardless of which context wrote. `overwriteProfiles`
no longer fans out in-memory; the storage event does it.

Added `onLocalStorageChanged` to the adapter layer (Chrome/Firefox wrap
the native event; the WebBrowser dev adapter simulates it so local dev
reactivity still works).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@SYM01 SYM01 merged commit 50a4933 into main Apr 16, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant