@chromahq/core 1.0.61 → 1.0.62
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/dist/{boot-yaI0mE0N.js → boot-Ap8sFDzW.js} +2 -38
- package/dist/boot-Ap8sFDzW.js.map +1 -0
- package/dist/{boot-CYBjSPxy.js → boot-BlwTZbY7.js} +2 -38
- package/dist/boot-BlwTZbY7.js.map +1 -0
- package/dist/boot.cjs.js +1 -1
- package/dist/boot.es.js +1 -1
- package/dist/index.cjs.js +1 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +1 -4
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
- package/dist/boot-CYBjSPxy.js.map +0 -1
- package/dist/boot-yaI0mE0N.js.map +0 -1
|
@@ -71,7 +71,7 @@ let AppEventBus = class {
|
|
|
71
71
|
if (matching.length === 0) {
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
74
|
-
|
|
74
|
+
await Promise.allSettled(
|
|
75
75
|
matching.map(async (sub) => {
|
|
76
76
|
try {
|
|
77
77
|
await sub.handler(payload);
|
|
@@ -84,12 +84,6 @@ let AppEventBus = class {
|
|
|
84
84
|
}
|
|
85
85
|
})
|
|
86
86
|
);
|
|
87
|
-
const failed = results.filter((r) => r.status === "rejected").length;
|
|
88
|
-
if (failed > 0) {
|
|
89
|
-
console.warn(
|
|
90
|
-
`[AppEventBus] ${failed}/${matching.length} handler(s) failed for event "${eventName}"`
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
87
|
}
|
|
94
88
|
// ─────────────────────────────────────────────────────────────────────────
|
|
95
89
|
// Utilities
|
|
@@ -301,16 +295,11 @@ class NonceService {
|
|
|
301
295
|
*/
|
|
302
296
|
cleanup() {
|
|
303
297
|
const now = Date.now();
|
|
304
|
-
let removed = 0;
|
|
305
298
|
this.nonceStore.forEach((entry, nonce) => {
|
|
306
299
|
if (now > entry.expiresAt) {
|
|
307
300
|
this.nonceStore.delete(nonce);
|
|
308
|
-
removed++;
|
|
309
301
|
}
|
|
310
302
|
});
|
|
311
|
-
if (removed > 0) {
|
|
312
|
-
console.log(`[NonceService] Cleaned up ${removed} expired nonces`);
|
|
313
|
-
}
|
|
314
303
|
}
|
|
315
304
|
/**
|
|
316
305
|
* Destroy the service (stop cleanup interval)
|
|
@@ -461,10 +450,8 @@ const _PopupVisibilityService = class _PopupVisibilityService {
|
|
|
461
450
|
onPortConnected() {
|
|
462
451
|
const wasVisible = this.isPopupVisible();
|
|
463
452
|
this.connectedPortCount++;
|
|
464
|
-
console.log(`[PopupVisibilityService] Port connected, count: ${this.connectedPortCount}`);
|
|
465
453
|
if (!wasVisible && this.isPopupVisible()) {
|
|
466
454
|
this.lastVisibilityChangeAt = Date.now();
|
|
467
|
-
console.log("[PopupVisibilityService] Popup became visible, notifying listeners");
|
|
468
455
|
this.notifyListeners(true);
|
|
469
456
|
}
|
|
470
457
|
}
|
|
@@ -475,10 +462,8 @@ const _PopupVisibilityService = class _PopupVisibilityService {
|
|
|
475
462
|
onPortDisconnected() {
|
|
476
463
|
const wasVisible = this.isPopupVisible();
|
|
477
464
|
this.connectedPortCount = Math.max(0, this.connectedPortCount - 1);
|
|
478
|
-
console.log(`[PopupVisibilityService] Port disconnected, count: ${this.connectedPortCount}`);
|
|
479
465
|
if (wasVisible && !this.isPopupVisible()) {
|
|
480
466
|
this.lastVisibilityChangeAt = Date.now();
|
|
481
|
-
console.log("[PopupVisibilityService] Popup became hidden, notifying listeners");
|
|
482
467
|
this.notifyListeners(false);
|
|
483
468
|
}
|
|
484
469
|
}
|
|
@@ -535,24 +520,18 @@ function setupEarlyListener(portName = DEFAULT_PORT_NAME$1) {
|
|
|
535
520
|
if (portsClaimed && onPortConnectCallback) {
|
|
536
521
|
onPortConnectCallback(port);
|
|
537
522
|
} else {
|
|
538
|
-
console.debug(`[EarlyListener] Captured early port connection: ${port.name}`);
|
|
539
523
|
earlyPorts.push(port);
|
|
540
524
|
}
|
|
541
525
|
});
|
|
542
|
-
console.debug(`[EarlyListener] Early connection listener registered for port: ${portName}`);
|
|
543
526
|
}
|
|
544
527
|
function claimEarlyPorts(onConnect) {
|
|
545
528
|
if (portsClaimed) {
|
|
546
|
-
console.warn("[EarlyListener] Ports already claimed, returning empty array");
|
|
547
529
|
return [];
|
|
548
530
|
}
|
|
549
531
|
portsClaimed = true;
|
|
550
532
|
onPortConnectCallback = onConnect;
|
|
551
533
|
const captured = [...earlyPorts];
|
|
552
534
|
earlyPorts.length = 0;
|
|
553
|
-
if (captured.length > 0) {
|
|
554
|
-
console.debug(`[EarlyListener] Claimed ${captured.length} early port(s)`);
|
|
555
|
-
}
|
|
556
535
|
return captured;
|
|
557
536
|
}
|
|
558
537
|
function isEarlyListenerSetup() {
|
|
@@ -1149,11 +1128,6 @@ const _AlarmAdapter = class _AlarmAdapter {
|
|
|
1149
1128
|
await this.clearStaleAlarms();
|
|
1150
1129
|
chrome.alarms.onAlarm.addListener(this.handleAlarm);
|
|
1151
1130
|
this.listenerRegistered = true;
|
|
1152
|
-
console.log("[AlarmAdapter] \u2705 Chrome Alarms API available and listener registered");
|
|
1153
|
-
} else {
|
|
1154
|
-
console.log(
|
|
1155
|
-
"[AlarmAdapter] \u26A0\uFE0F Chrome Alarms API not available - will use setTimeout fallback"
|
|
1156
|
-
);
|
|
1157
1131
|
}
|
|
1158
1132
|
};
|
|
1159
1133
|
/**
|
|
@@ -1166,9 +1140,6 @@ const _AlarmAdapter = class _AlarmAdapter {
|
|
|
1166
1140
|
chrome.alarms.getAll((alarms) => {
|
|
1167
1141
|
const staleAlarms = alarms.filter((a) => a.name.startsWith(_AlarmAdapter.ALARM_PREFIX));
|
|
1168
1142
|
if (staleAlarms.length > 0) {
|
|
1169
|
-
console.log(
|
|
1170
|
-
`[AlarmAdapter] \u{1F9F9} Clearing ${staleAlarms.length} stale alarms from previous session`
|
|
1171
|
-
);
|
|
1172
1143
|
let cleared = 0;
|
|
1173
1144
|
staleAlarms.forEach((alarm) => {
|
|
1174
1145
|
chrome.alarms.clear(alarm.name, () => {
|
|
@@ -1198,7 +1169,6 @@ const _AlarmAdapter = class _AlarmAdapter {
|
|
|
1198
1169
|
return;
|
|
1199
1170
|
}
|
|
1200
1171
|
const jobId = alarm.name.slice(_AlarmAdapter.ALARM_PREFIX.length);
|
|
1201
|
-
console.log(`[AlarmAdapter] \u{1F514} Chrome Alarm fired: ${jobId}`);
|
|
1202
1172
|
this.callbacks.delete(jobId);
|
|
1203
1173
|
this.triggerCallback?.(jobId);
|
|
1204
1174
|
};
|
|
@@ -1214,17 +1184,11 @@ const _AlarmAdapter = class _AlarmAdapter {
|
|
|
1214
1184
|
chrome.alarms.create(alarmName, {
|
|
1215
1185
|
when
|
|
1216
1186
|
});
|
|
1217
|
-
console.log(
|
|
1218
|
-
`[AlarmAdapter] \u23F0 Chrome Alarm scheduled: ${id} in ${Math.round(delay / 1e3)}s`
|
|
1219
|
-
);
|
|
1220
1187
|
this.callbacks.set(id, () => {
|
|
1221
1188
|
chrome.alarms.clear(alarmName);
|
|
1222
1189
|
});
|
|
1223
1190
|
return null;
|
|
1224
1191
|
}
|
|
1225
|
-
console.log(
|
|
1226
|
-
`[AlarmAdapter] \u23F1\uFE0F setTimeout fallback: ${id} in ${Math.round(delay / 1e3)}s (Chrome Alarms: ${this.isChromeAlarmsAvailable() ? "available but delay too short" : "unavailable"})`
|
|
1227
|
-
);
|
|
1228
1192
|
const timeoutId = setTimeout(() => {
|
|
1229
1193
|
this.callbacks.delete(id);
|
|
1230
1194
|
this.triggerCallback?.(id);
|
|
@@ -2967,4 +2931,4 @@ class BootstrapBuilder {
|
|
|
2967
2931
|
}
|
|
2968
2932
|
|
|
2969
2933
|
export { AppEventBus as A, EventBusToken as E, JobRegistry as J, NonceService as N, PopupVisibilityService as P, Subscribe as S, SUBSCRIBE_METADATA_KEY as a, getNonceService as b, getPopupVisibilityService as c, claimEarlyPorts as d, arePortsClaimed as e, container as f, getSubscribeMetadata as g, create as h, isEarlyListenerSetup as i, bootstrap as j, Scheduler as k, JobState as l, setupEarlyListener as s };
|
|
2970
|
-
//# sourceMappingURL=boot-
|
|
2934
|
+
//# sourceMappingURL=boot-Ap8sFDzW.js.map
|