codex-overleaf-link 1.9.2 → 1.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  <h1>Codex Overleaf Link</h1>
4
4
  <p><strong>Empower Overleaf with Codex.</strong></p>
5
5
  <p>
6
- <img src="https://img.shields.io/badge/version-1.9.2-blue" alt="version">
6
+ <img src="https://img.shields.io/badge/version-1.9.4-blue" alt="version">
7
7
  <img src="https://img.shields.io/badge/platform-macOS%20%2F%20Windows%20%2F%20Linux-lightgrey" alt="platform">
8
8
  <img src="https://img.shields.io/badge/chrome-MV3-green" alt="chrome manifest v3">
9
9
  <img src="https://img.shields.io/badge/node-%3E%3D20-brightgreen" alt="node version">
@@ -38,14 +38,14 @@ One command installs the managed native host **and** managed extension runtime.
38
38
  macOS / Linux:
39
39
 
40
40
  ```bash
41
- CODEX_OVERLEAF_REF=v1.9.2 bash -c "$(curl -fsSL https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v1.9.2/install.sh)"
41
+ CODEX_OVERLEAF_REF=v1.9.4 bash -c "$(curl -fsSL https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v1.9.4/install.sh)"
42
42
  ```
43
43
 
44
44
  Windows PowerShell:
45
45
 
46
46
  ```powershell
47
- iwr https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v1.9.2/install.ps1 -OutFile install.ps1
48
- $env:CODEX_OVERLEAF_REF='v1.9.2'
47
+ iwr https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v1.9.4/install.ps1 -OutFile install.ps1
48
+ $env:CODEX_OVERLEAF_REF='v1.9.4'
49
49
  powershell -ExecutionPolicy Bypass -File install.ps1
50
50
  ```
51
51
 
@@ -56,7 +56,7 @@ Then, in the `chrome://extensions` tab the script opened: enable **Developer mod
56
56
  `npm exec` installs the same managed native host and extension runtime without keeping a source checkout. Use it if you prefer a pinned npm package.
57
57
 
58
58
  ```bash
59
- npm exec --yes codex-overleaf-link@1.9.2 -- install-managed
59
+ npm exec --yes codex-overleaf-link@1.9.4 -- install-managed
60
60
  ```
61
61
 
62
62
  Then, in `chrome://extensions`, enable **Developer mode**, click **Load unpacked**, and select the managed extension path printed by the command. The Release extension zip remains available for explicitly unmanaged/manual installations.
@@ -86,9 +86,9 @@ npm installs, updates, and uninstalls the coordinated managed extension/native p
86
86
 
87
87
  | Action | Command |
88
88
  |--------|---------|
89
- | Install / update | `npm exec --yes codex-overleaf-link@1.9.2 -- install-managed` |
90
- | Diagnose | `npm exec --yes codex-overleaf-link@1.9.2 -- doctor` |
91
- | Uninstall | `npm exec --yes codex-overleaf-link@1.9.2 -- uninstall-managed` |
89
+ | Install / update | `npm exec --yes codex-overleaf-link@1.9.4 -- install-managed` |
90
+ | Diagnose | `npm exec --yes codex-overleaf-link@1.9.4 -- doctor` |
91
+ | Uninstall | `npm exec --yes codex-overleaf-link@1.9.4 -- uninstall-managed` |
92
92
 
93
93
  Use `--extension-id <chrome-extension-id>` only for a custom/dev unpacked extension id that differs from the official bundled id.
94
94
 
@@ -98,13 +98,13 @@ Managed installations discover signed stable updates automatically and apply the
98
98
 
99
99
  ## GitHub Release Artifacts
100
100
 
101
- The v1.9.2 GitHub Release contains:
101
+ The v1.9.4 GitHub Release contains:
102
102
 
103
- - `codex-overleaf-link-extension-v1.9.2.zip`: loadable Chrome extension package for manual unpacked installation.
104
- - `codex-overleaf-native-host-v1.9.2.tar.gz`: native host runtime files used by the installer and release verification.
105
- - `codex-overleaf-link-1.9.2.tgz`: npm native host CLI package for pinned install, doctor, and uninstall flows.
106
- - `install.sh`: release-pinned macOS / Linux installer that defaults to `v1.9.2` when run directly from the release artifact.
107
- - `install.ps1`: release-pinned Windows PowerShell installer that defaults to `v1.9.2` when run directly from the release artifact.
103
+ - `codex-overleaf-link-extension-v1.9.4.zip`: loadable Chrome extension package for manual unpacked installation.
104
+ - `codex-overleaf-native-host-v1.9.4.tar.gz`: native host runtime files used by the installer and release verification.
105
+ - `codex-overleaf-link-1.9.4.tgz`: npm native host CLI package for pinned install, doctor, and uninstall flows.
106
+ - `install.sh`: release-pinned macOS / Linux installer that defaults to `v1.9.4` when run directly from the release artifact.
107
+ - `install.ps1`: release-pinned Windows PowerShell installer that defaults to `v1.9.4` when run directly from the release artifact.
108
108
  - `uninstall-native-host.mjs`: native host uninstaller that removes the Chrome Native Messaging manifest, bridge executable, and runtime copy.
109
109
  - `nativeHostPlatform.js`, `manifest.js`, `runtimeInstaller.js`: helper files required by the loose uninstaller asset.
110
110
  - `SHA256SUMS` and `release-manifest.json`: checksum and artifact metadata for release verification.
@@ -115,7 +115,7 @@ The v1.9.2 GitHub Release contains:
115
115
  Remove the native host (use `--browser chromium` on Linux Chromium):
116
116
 
117
117
  ```bash
118
- npm exec --yes codex-overleaf-link@1.9.2 -- uninstall-managed
118
+ npm exec --yes codex-overleaf-link@1.9.4 -- uninstall-managed
119
119
  ```
120
120
 
121
121
  The same command works on Windows PowerShell. If you installed from a manual checkout or source installer, you can also run `npm run uninstall:native` inside the repo, use `node ~/.codex-overleaf/source/scripts/uninstall-native-host.mjs` on macOS / Linux, or use `node $env:LOCALAPPDATA\CodexOverleaf\source\scripts\uninstall-native-host.mjs` on Windows PowerShell.
@@ -150,13 +150,13 @@ Then remove the extension from `chrome://extensions`. To delete local data: on m
150
150
  Linux Chromium install or update:
151
151
 
152
152
  ```bash
153
- CODEX_OVERLEAF_REF=v1.9.2 bash -c "$(curl -fsSL https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v1.9.2/install.sh)" -- --browser chromium
153
+ CODEX_OVERLEAF_REF=v1.9.4 bash -c "$(curl -fsSL https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v1.9.4/install.sh)" -- --browser chromium
154
154
  ```
155
155
 
156
156
  Linux Chromium uninstall:
157
157
 
158
158
  ```bash
159
- npm exec --yes codex-overleaf-link@1.9.2 -- uninstall-managed --browser chromium
159
+ npm exec --yes codex-overleaf-link@1.9.4 -- uninstall-managed --browser chromium
160
160
  ```
161
161
 
162
162
  ## Features
@@ -291,7 +291,7 @@ Composer attachments are turn-scoped Codex context. Limits are 8 attachments per
291
291
  Re-run any [native host installer](#install), reload the extension in `chrome://extensions`, then refresh the Overleaf tab. This also fixes extension/native version mismatch and native protocol mismatch.
292
292
 
293
293
  ```bash
294
- npm exec --yes codex-overleaf-link@1.9.2 -- install-managed
294
+ npm exec --yes codex-overleaf-link@1.9.4 -- install-managed
295
295
  ```
296
296
 
297
297
  **The Windows popup or panel shows a Bash recovery command**
@@ -340,8 +340,8 @@ Use this matrix for release-candidate signoff and compatibility reports. Record
340
340
  | Browser/channel/version | Google Chrome channel and version. | Google Chrome channel and version. | Google Chrome channel and version. | Chromium channel/package and version. |
341
341
  | Install mode | Manual unpacked extension from GitHub Release zip or checkout. | Manual unpacked extension from GitHub Release zip or checkout. | Manual unpacked extension from GitHub Release zip or checkout. | Manual unpacked extension from GitHub Release zip or checkout; native host installed with `--browser chromium`. |
342
342
  | Extension id | Bundled id `illdpneeeopfffmiepaejglgmhpmdhdc`, or actual custom id passed with `--extension-id`. | Bundled id `illdpneeeopfffmiepaejglgmhpmdhdc`, or actual custom id passed with `--extension-id`. | Bundled id `illdpneeeopfffmiepaejglgmhpmdhdc`, or actual custom id passed with `--extension-id`. | Bundled id `illdpneeeopfffmiepaejglgmhpmdhdc`, or actual custom id passed with `--extension-id`. |
343
- | Installer/update command | `npm exec --yes codex-overleaf-link@1.9.2 -- install-managed` | `npm exec --yes codex-overleaf-link@1.9.2 -- install-managed` | `npm exec --yes codex-overleaf-link@1.9.2 -- install-managed` | `npm exec --yes codex-overleaf-link@1.9.2 -- install-managed --browser chromium` |
344
- | Uninstall command | `npm exec --yes codex-overleaf-link@1.9.2 -- uninstall-managed` | `npm exec --yes codex-overleaf-link@1.9.2 -- uninstall-managed` | `npm exec --yes codex-overleaf-link@1.9.2 -- uninstall-managed` | `npm exec --yes codex-overleaf-link@1.9.2 -- uninstall-managed --browser chromium` |
343
+ | Installer/update command | `npm exec --yes codex-overleaf-link@1.9.4 -- install-managed` | `npm exec --yes codex-overleaf-link@1.9.4 -- install-managed` | `npm exec --yes codex-overleaf-link@1.9.4 -- install-managed` | `npm exec --yes codex-overleaf-link@1.9.4 -- install-managed --browser chromium` |
344
+ | Uninstall command | `npm exec --yes codex-overleaf-link@1.9.4 -- uninstall-managed` | `npm exec --yes codex-overleaf-link@1.9.4 -- uninstall-managed` | `npm exec --yes codex-overleaf-link@1.9.4 -- uninstall-managed` | `npm exec --yes codex-overleaf-link@1.9.4 -- uninstall-managed --browser chromium` |
345
345
  | Manifest/registry path | `~/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.codex.overleaf.json` | `HKCU\Software\Google\Chrome\NativeMessagingHosts\com.codex.overleaf` -> `%LOCALAPPDATA%\CodexOverleaf\native-host-runtime\com.codex.overleaf.json` | `~/.config/google-chrome/NativeMessagingHosts/com.codex.overleaf.json` | `~/.config/chromium/NativeMessagingHosts/com.codex.overleaf.json` |
346
346
  | Bridge/runtime/source path | Bridge `~/.codex-overleaf/codex-overleaf-bridge`; runtime `~/.codex-overleaf/native-host-runtime`; source `~/.codex-overleaf/source`. | Bridge `%LOCALAPPDATA%\CodexOverleaf\codex-overleaf-bridge.cmd`; runtime `%LOCALAPPDATA%\CodexOverleaf\native-host-runtime`; source `%LOCALAPPDATA%\CodexOverleaf\source`. | Bridge `~/.codex-overleaf/codex-overleaf-bridge`; runtime `~/.codex-overleaf/native-host-runtime`; source `~/.codex-overleaf/source`. | Bridge `~/.codex-overleaf/codex-overleaf-bridge`; runtime `~/.codex-overleaf/native-host-runtime`; source `~/.codex-overleaf/source`. |
347
347
  | Node/Git/Codex/TeX | Node.js >= 20; Git; Codex CLI installed and logged in; TeX optional. | Node.js >= 20; Git; Codex CLI installed and logged in; TeX optional. | Node.js >= 20; Git; Codex CLI installed and logged in; TeX optional. | Node.js >= 20; Git; Codex CLI installed and logged in; TeX optional. |
@@ -377,7 +377,7 @@ Contributions are welcome. Please open an issue before submitting large changes
377
377
  The recommended v1.9 installation owns one stable unpacked-extension directory and a versioned native-host directory:
378
378
 
379
379
  ```bash
380
- npm exec --yes codex-overleaf-link@1.9.2 -- install-managed
380
+ npm exec --yes codex-overleaf-link@1.9.4 -- install-managed
381
381
  ```
382
382
 
383
383
  Load the printed extension path once from `chrome://extensions`. Starting with the next signed stable release, Codex Overleaf Link checks GitHub Releases automatically, downloads and verifies the coordinated extension/native-host bundle, waits until every connected Overleaf tab is saved and idle, and then updates both components together. A failed health check restores the previous version automatically.
@@ -387,11 +387,11 @@ The stable updater ignores drafts and prereleases, performs no telemetry, and ca
387
387
  The legacy native-only installer remains available for source or unmanaged extension directories:
388
388
 
389
389
  ```bash
390
- npm exec --yes codex-overleaf-link@1.9.2 -- install-native
390
+ npm exec --yes codex-overleaf-link@1.9.4 -- install-native
391
391
  ```
392
392
 
393
393
  Legacy native-only installations can be removed with:
394
394
 
395
395
  ```bash
396
- npm exec --yes codex-overleaf-link@1.9.2 -- uninstall-native
396
+ npm exec --yes codex-overleaf-link@1.9.4 -- uninstall-native
397
397
  ```
@@ -16,6 +16,7 @@ let runtimeLoadError = null;
16
16
  try {
17
17
  globalThis.__CODEX_OVERLEAF_RUNTIME_BASE__ = 'runtime';
18
18
  importScripts(
19
+ chrome.runtime.getURL('bootstrap/updateStatus.js'),
19
20
  chrome.runtime.getURL('runtime/src/shared/compatibility.js'),
20
21
  chrome.runtime.getURL('runtime/src/background.js')
21
22
  );
@@ -118,10 +119,13 @@ async function checkAndStage(options = {}) {
118
119
  if (APPLYING_STATES.has(current.state)) {
119
120
  return current;
120
121
  }
122
+ if (['staged', 'waiting_for_idle'].includes(current.state) && current.transactionId) {
123
+ return tryApplyStagedUpdate();
124
+ }
121
125
  if (!options.manual && Number(current.postponeUntil || 0) > Date.now()) {
122
126
  return current;
123
127
  }
124
- await setUpdateState({ ...current, state: 'checking', code: '', message: '' });
128
+ await setUpdateState({ ...current, state: 'checking', blocker: '', blockers: [], code: '', message: '' });
125
129
  const checked = await requestInternal({
126
130
  method: 'update.check',
127
131
  params: {
@@ -170,7 +174,9 @@ async function checkAndStage(options = {}) {
170
174
  currentVersion: chrome.runtime.getManifest().version,
171
175
  latestVersion: staged.result.targetVersion,
172
176
  transactionId: staged.result.transactionId,
173
- stagedAt: Date.now()
177
+ stagedAt: Date.now(),
178
+ blocker: '',
179
+ blockers: []
174
180
  });
175
181
  await broadcastUpdateState('staged');
176
182
  chrome.alarms.create(IDLE_ALARM, { delayInMinutes: 0.1 });
@@ -187,20 +193,25 @@ async function tryApplyStagedUpdate() {
187
193
  }
188
194
  const tabs = await chrome.tabs.query({ url: OVERLEAF_MATCHES });
189
195
  const probes = await Promise.all(tabs.map(tab => probeTabIdle(tab)));
190
- const tabBlocker = probes.find(probe => probe.idle !== true);
191
- const nativeGate = await requestInternal({ method: 'update.canApply', params: {} });
192
- if (tabBlocker || !nativeGate?.ok || nativeGate.result?.idle !== true) {
196
+ const nativeGate = await requestInternal({ method: 'update.canApply', params: {} }).catch(error => ({
197
+ ok: false,
198
+ error: { code: safeCode(error), message: safeMessage(error) }
199
+ }));
200
+ const blockers = globalThis.CodexOverleafUpdateStatus?.collectBlockers(probes, nativeGate)
201
+ || ['busy'];
202
+ if (blockers.length) {
193
203
  const waiting = await setUpdateState({
194
204
  ...state,
195
205
  state: 'waiting_for_idle',
196
- blocker: tabBlocker?.blockers?.[0] || nativeGate?.result?.blockers?.[0] || 'busy'
206
+ blocker: blockers[0],
207
+ blockers
197
208
  });
198
209
  chrome.alarms.create(IDLE_ALARM, { delayInMinutes: 1 });
199
210
  return waiting;
200
211
  }
201
212
 
202
213
  await chrome.storage.local.set({ [UPDATE_RELOAD_TABS_KEY]: tabs.map(tab => tab.id).filter(Number.isInteger) });
203
- await setUpdateState({ ...state, state: 'applying', blocker: '' });
214
+ await setUpdateState({ ...state, state: 'applying', blocker: '', blockers: [] });
204
215
  await broadcastUpdateState('applying');
205
216
  const applied = await requestInternal({
206
217
  method: 'update.apply',
@@ -353,6 +364,9 @@ async function getUpdateState() {
353
364
  }
354
365
 
355
366
  async function setUpdateState(next) {
367
+ const blockers = globalThis.CodexOverleafUpdateStatus?.normalizeBlockers(
368
+ Array.isArray(next.blockers) ? next.blockers : (next.blocker ? [next.blocker] : [])
369
+ ) || [];
356
370
  const value = {
357
371
  state: next.state || 'idle',
358
372
  managed: next.managed !== false,
@@ -363,7 +377,8 @@ async function setUpdateState(next) {
363
377
  stagedAt: Number(next.stagedAt || 0),
364
378
  postponeUntil: Number(next.postponeUntil || 0),
365
379
  transactionId: next.transactionId || '',
366
- blocker: next.blocker || '',
380
+ blocker: blockers[0] || '',
381
+ blockers,
367
382
  code: next.code || '',
368
383
  message: String(next.message || '').slice(0, 300)
369
384
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "Codex Overleaf Link",
4
- "version": "1.9.2",
4
+ "version": "1.9.4",
5
5
  "description": "Connect the active Overleaf project to a local Codex bridge.",
6
6
  "icons": {
7
7
  "16": "assets/icons/icon16.png",
@@ -33,6 +33,7 @@
33
33
  </div>
34
34
  <script src="../runtime/src/shared/compatibility.js"></script>
35
35
  <script src="../runtime/src/popup.js"></script>
36
+ <script src="updateStatus.js"></script>
36
37
  <script src="popup.js"></script>
37
38
  </body>
38
39
  </html>
@@ -5,6 +5,7 @@ const updateVersions = document.getElementById('update-versions');
5
5
  const updateDetail = document.getElementById('update-detail');
6
6
  const checkButton = document.getElementById('check-update');
7
7
  const postponeButton = document.getElementById('postpone-update');
8
+ const UpdateStatus = globalThis.CodexOverleafUpdateStatus;
8
9
 
9
10
  checkButton.addEventListener('click', async () => {
10
11
  checkButton.disabled = true;
@@ -33,7 +34,10 @@ async function refreshUpdateState() {
33
34
  if (state.managed === false) {
34
35
  updateDetail.textContent = 'Run install-managed once to enable automatic extension and native-host updates.';
35
36
  } else if (state.state === 'waiting_for_idle') {
36
- updateDetail.textContent = 'Downloaded and verified. Waiting until every Overleaf tab is saved and idle.';
37
+ const blockerDetail = UpdateStatus?.formatBlockers(state.blockers || [state.blocker]) || '';
38
+ updateDetail.textContent = blockerDetail
39
+ ? `Downloaded and verified. ${blockerDetail}`
40
+ : 'Downloaded and verified. Waiting until every Overleaf tab is saved and idle.';
37
41
  } else if (state.state === 'rolled_back') {
38
42
  updateDetail.textContent = 'The previous version was restored after a failed health check.';
39
43
  } else if (state.state === 'committed') {
@@ -0,0 +1,78 @@
1
+ (function initCodexOverleafUpdateStatus(root) {
2
+ 'use strict';
3
+
4
+ const BLOCKER_MESSAGES = Object.freeze({
5
+ run: 'A Codex run is still active.',
6
+ cancelling: 'A Codex cancellation is still settling.',
7
+ storage: 'Extension state is still being saved.',
8
+ reviewAction: 'An Accept or Undo action is still running.',
9
+ dialog: 'A confirmation dialog is still open.',
10
+ save_state_unverified: 'Overleaf has not confirmed that the document is saved.',
11
+ recent_user_activity: 'Recent editor activity must be idle for 30 seconds.',
12
+ save_state_not_stable: 'The saved state must remain stable for 3 seconds.',
13
+ idle_probe_failed: 'The Overleaf idle check failed.',
14
+ tab_unavailable: 'An Overleaf tab is unavailable.',
15
+ tab_probe_timeout: 'An Overleaf tab did not answer the idle check in time.',
16
+ tab_probe_unavailable: 'Reload an Overleaf tab so the updater can verify that it is idle.',
17
+ tab_not_idle: 'An Overleaf tab is still busy.',
18
+ native_project_locked: 'The native host still holds a project lock.',
19
+ native_run_active: 'The native host is still processing a Codex run.',
20
+ native_gate_unavailable: 'The native host could not report whether it is idle.',
21
+ native_not_idle: 'The native host is still busy.',
22
+ busy: 'An update safety check is still busy.'
23
+ });
24
+
25
+ function normalizeBlockers(values = []) {
26
+ const result = [];
27
+ const seen = new Set();
28
+ const visit = value => {
29
+ if (Array.isArray(value)) {
30
+ value.forEach(visit);
31
+ return;
32
+ }
33
+ const code = String(value || '').trim();
34
+ if (!code || seen.has(code)) return;
35
+ seen.add(code);
36
+ result.push(code);
37
+ };
38
+ visit(values);
39
+ return result;
40
+ }
41
+
42
+ function collectBlockers(probes = [], nativeGate = null) {
43
+ const blockers = [];
44
+ for (const probe of probes || []) {
45
+ if (probe?.idle === true) continue;
46
+ if (Array.isArray(probe?.blockers) && probe.blockers.length) {
47
+ blockers.push(probe.blockers);
48
+ } else {
49
+ blockers.push('tab_not_idle');
50
+ }
51
+ }
52
+ if (!nativeGate?.ok) {
53
+ blockers.push(nativeGate?.error?.code || 'native_gate_unavailable');
54
+ } else if (nativeGate.result?.idle !== true) {
55
+ blockers.push(nativeGate.result?.blockers?.length ? nativeGate.result.blockers : 'native_not_idle');
56
+ }
57
+ return normalizeBlockers(blockers);
58
+ }
59
+
60
+ function describeBlocker(code) {
61
+ const normalized = String(code || '').trim();
62
+ if (!normalized) return '';
63
+ return BLOCKER_MESSAGES[normalized]
64
+ || `Update is waiting on: ${normalized.replaceAll('_', ' ')}.`;
65
+ }
66
+
67
+ function formatBlockers(blockers = []) {
68
+ return normalizeBlockers(blockers).map(describeBlocker).filter(Boolean).join(' ');
69
+ }
70
+
71
+ root.CodexOverleafUpdateStatus = Object.freeze({
72
+ BLOCKER_MESSAGES,
73
+ collectBlockers,
74
+ describeBlocker,
75
+ formatBlockers,
76
+ normalizeBlockers
77
+ });
78
+ })(typeof window !== 'undefined' ? window : globalThis);
@@ -52,6 +52,7 @@
52
52
  "src/content/writebackOrchestrator.js",
53
53
  "src/content/panelMaintenance.js",
54
54
  "src/content/updateIdle.js",
55
+ "src/content/updateNotice.js",
55
56
  "src/content/contentRuntime.js",
56
57
  "src/contentScript.js"
57
58
  ],
@@ -530,3 +530,23 @@ if (!globalThis.CodexOverleafCompatibility) {
530
530
  return true;
531
531
  }
532
532
  })();
533
+
534
+ (function loadConsentDrivenUpdateRuntime(root) {
535
+ 'use strict';
536
+
537
+ try {
538
+ const workerPath = chrome.runtime.getManifest().background?.service_worker || '';
539
+ const runtimePrefix = workerPath.startsWith('bootstrap/') ? 'runtime/' : '';
540
+ if (!root.CodexOverleafUpdateConsent) {
541
+ importScripts(chrome.runtime.getURL(runtimePrefix + 'src/shared/updateConsent.js'));
542
+ }
543
+ if (!root.CodexOverleafUpdateCoordinator) {
544
+ importScripts(chrome.runtime.getURL(runtimePrefix + 'src/backgroundUpdateCoordinator.js'));
545
+ }
546
+ root.CodexOverleafUpdateCoordinator?.init?.({
547
+ nativeBridge: root.CodexOverleafNativeBridge
548
+ });
549
+ } catch (error) {
550
+ console.error('Consent-driven updater failed to initialize:', error?.message || String(error));
551
+ }
552
+ })(globalThis);