@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
|
@@ -73,7 +73,7 @@ exports.AppEventBus = class AppEventBus {
|
|
|
73
73
|
if (matching.length === 0) {
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
|
-
|
|
76
|
+
await Promise.allSettled(
|
|
77
77
|
matching.map(async (sub) => {
|
|
78
78
|
try {
|
|
79
79
|
await sub.handler(payload);
|
|
@@ -86,12 +86,6 @@ exports.AppEventBus = class AppEventBus {
|
|
|
86
86
|
}
|
|
87
87
|
})
|
|
88
88
|
);
|
|
89
|
-
const failed = results.filter((r) => r.status === "rejected").length;
|
|
90
|
-
if (failed > 0) {
|
|
91
|
-
console.warn(
|
|
92
|
-
`[AppEventBus] ${failed}/${matching.length} handler(s) failed for event "${eventName}"`
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
89
|
}
|
|
96
90
|
// ─────────────────────────────────────────────────────────────────────────
|
|
97
91
|
// Utilities
|
|
@@ -303,16 +297,11 @@ class NonceService {
|
|
|
303
297
|
*/
|
|
304
298
|
cleanup() {
|
|
305
299
|
const now = Date.now();
|
|
306
|
-
let removed = 0;
|
|
307
300
|
this.nonceStore.forEach((entry, nonce) => {
|
|
308
301
|
if (now > entry.expiresAt) {
|
|
309
302
|
this.nonceStore.delete(nonce);
|
|
310
|
-
removed++;
|
|
311
303
|
}
|
|
312
304
|
});
|
|
313
|
-
if (removed > 0) {
|
|
314
|
-
console.log(`[NonceService] Cleaned up ${removed} expired nonces`);
|
|
315
|
-
}
|
|
316
305
|
}
|
|
317
306
|
/**
|
|
318
307
|
* Destroy the service (stop cleanup interval)
|
|
@@ -463,10 +452,8 @@ const _PopupVisibilityService = class _PopupVisibilityService {
|
|
|
463
452
|
onPortConnected() {
|
|
464
453
|
const wasVisible = this.isPopupVisible();
|
|
465
454
|
this.connectedPortCount++;
|
|
466
|
-
console.log(`[PopupVisibilityService] Port connected, count: ${this.connectedPortCount}`);
|
|
467
455
|
if (!wasVisible && this.isPopupVisible()) {
|
|
468
456
|
this.lastVisibilityChangeAt = Date.now();
|
|
469
|
-
console.log("[PopupVisibilityService] Popup became visible, notifying listeners");
|
|
470
457
|
this.notifyListeners(true);
|
|
471
458
|
}
|
|
472
459
|
}
|
|
@@ -477,10 +464,8 @@ const _PopupVisibilityService = class _PopupVisibilityService {
|
|
|
477
464
|
onPortDisconnected() {
|
|
478
465
|
const wasVisible = this.isPopupVisible();
|
|
479
466
|
this.connectedPortCount = Math.max(0, this.connectedPortCount - 1);
|
|
480
|
-
console.log(`[PopupVisibilityService] Port disconnected, count: ${this.connectedPortCount}`);
|
|
481
467
|
if (wasVisible && !this.isPopupVisible()) {
|
|
482
468
|
this.lastVisibilityChangeAt = Date.now();
|
|
483
|
-
console.log("[PopupVisibilityService] Popup became hidden, notifying listeners");
|
|
484
469
|
this.notifyListeners(false);
|
|
485
470
|
}
|
|
486
471
|
}
|
|
@@ -537,24 +522,18 @@ function setupEarlyListener(portName = DEFAULT_PORT_NAME$1) {
|
|
|
537
522
|
if (portsClaimed && onPortConnectCallback) {
|
|
538
523
|
onPortConnectCallback(port);
|
|
539
524
|
} else {
|
|
540
|
-
console.debug(`[EarlyListener] Captured early port connection: ${port.name}`);
|
|
541
525
|
earlyPorts.push(port);
|
|
542
526
|
}
|
|
543
527
|
});
|
|
544
|
-
console.debug(`[EarlyListener] Early connection listener registered for port: ${portName}`);
|
|
545
528
|
}
|
|
546
529
|
function claimEarlyPorts(onConnect) {
|
|
547
530
|
if (portsClaimed) {
|
|
548
|
-
console.warn("[EarlyListener] Ports already claimed, returning empty array");
|
|
549
531
|
return [];
|
|
550
532
|
}
|
|
551
533
|
portsClaimed = true;
|
|
552
534
|
onPortConnectCallback = onConnect;
|
|
553
535
|
const captured = [...earlyPorts];
|
|
554
536
|
earlyPorts.length = 0;
|
|
555
|
-
if (captured.length > 0) {
|
|
556
|
-
console.debug(`[EarlyListener] Claimed ${captured.length} early port(s)`);
|
|
557
|
-
}
|
|
558
537
|
return captured;
|
|
559
538
|
}
|
|
560
539
|
function isEarlyListenerSetup() {
|
|
@@ -1151,11 +1130,6 @@ const _AlarmAdapter = class _AlarmAdapter {
|
|
|
1151
1130
|
await this.clearStaleAlarms();
|
|
1152
1131
|
chrome.alarms.onAlarm.addListener(this.handleAlarm);
|
|
1153
1132
|
this.listenerRegistered = true;
|
|
1154
|
-
console.log("[AlarmAdapter] \u2705 Chrome Alarms API available and listener registered");
|
|
1155
|
-
} else {
|
|
1156
|
-
console.log(
|
|
1157
|
-
"[AlarmAdapter] \u26A0\uFE0F Chrome Alarms API not available - will use setTimeout fallback"
|
|
1158
|
-
);
|
|
1159
1133
|
}
|
|
1160
1134
|
};
|
|
1161
1135
|
/**
|
|
@@ -1168,9 +1142,6 @@ const _AlarmAdapter = class _AlarmAdapter {
|
|
|
1168
1142
|
chrome.alarms.getAll((alarms) => {
|
|
1169
1143
|
const staleAlarms = alarms.filter((a) => a.name.startsWith(_AlarmAdapter.ALARM_PREFIX));
|
|
1170
1144
|
if (staleAlarms.length > 0) {
|
|
1171
|
-
console.log(
|
|
1172
|
-
`[AlarmAdapter] \u{1F9F9} Clearing ${staleAlarms.length} stale alarms from previous session`
|
|
1173
|
-
);
|
|
1174
1145
|
let cleared = 0;
|
|
1175
1146
|
staleAlarms.forEach((alarm) => {
|
|
1176
1147
|
chrome.alarms.clear(alarm.name, () => {
|
|
@@ -1200,7 +1171,6 @@ const _AlarmAdapter = class _AlarmAdapter {
|
|
|
1200
1171
|
return;
|
|
1201
1172
|
}
|
|
1202
1173
|
const jobId = alarm.name.slice(_AlarmAdapter.ALARM_PREFIX.length);
|
|
1203
|
-
console.log(`[AlarmAdapter] \u{1F514} Chrome Alarm fired: ${jobId}`);
|
|
1204
1174
|
this.callbacks.delete(jobId);
|
|
1205
1175
|
this.triggerCallback?.(jobId);
|
|
1206
1176
|
};
|
|
@@ -1216,17 +1186,11 @@ const _AlarmAdapter = class _AlarmAdapter {
|
|
|
1216
1186
|
chrome.alarms.create(alarmName, {
|
|
1217
1187
|
when
|
|
1218
1188
|
});
|
|
1219
|
-
console.log(
|
|
1220
|
-
`[AlarmAdapter] \u23F0 Chrome Alarm scheduled: ${id} in ${Math.round(delay / 1e3)}s`
|
|
1221
|
-
);
|
|
1222
1189
|
this.callbacks.set(id, () => {
|
|
1223
1190
|
chrome.alarms.clear(alarmName);
|
|
1224
1191
|
});
|
|
1225
1192
|
return null;
|
|
1226
1193
|
}
|
|
1227
|
-
console.log(
|
|
1228
|
-
`[AlarmAdapter] \u23F1\uFE0F setTimeout fallback: ${id} in ${Math.round(delay / 1e3)}s (Chrome Alarms: ${this.isChromeAlarmsAvailable() ? "available but delay too short" : "unavailable"})`
|
|
1229
|
-
);
|
|
1230
1194
|
const timeoutId = setTimeout(() => {
|
|
1231
1195
|
this.callbacks.delete(id);
|
|
1232
1196
|
this.triggerCallback?.(id);
|
|
@@ -2986,4 +2950,4 @@ exports.getPopupVisibilityService = getPopupVisibilityService;
|
|
|
2986
2950
|
exports.getSubscribeMetadata = getSubscribeMetadata;
|
|
2987
2951
|
exports.isEarlyListenerSetup = isEarlyListenerSetup;
|
|
2988
2952
|
exports.setupEarlyListener = setupEarlyListener;
|
|
2989
|
-
//# sourceMappingURL=boot-
|
|
2953
|
+
//# sourceMappingURL=boot-BlwTZbY7.js.map
|