codex-overleaf-link 1.9.6 → 1.9.8
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 +23 -23
- package/extension/bootstrap/background.js +7 -2
- package/extension/bootstrap/manifest.template.json +3 -1
- package/extension/bootstrap/popup.html +0 -13
- package/extension/bootstrap/update.css +366 -0
- package/extension/bootstrap/update.html +55 -0
- package/extension/bootstrap/update.js +331 -0
- package/extension/runtime-manifest.json +2 -0
- package/extension/src/backgroundUpdateCoordinator.js +51 -5
- package/extension/src/content/settingsPanel.js +12 -0
- package/extension/src/content/updateNotice.js +117 -6
- package/extension/src/popup.js +24 -35
- package/extension/src/shared/compatibility.js +1 -1
- package/extension/src/shared/i18n.js +6 -0
- package/package.json +1 -1
package/extension/src/popup.js
CHANGED
|
@@ -248,39 +248,9 @@
|
|
|
248
248
|
|
|
249
249
|
function scheduleConsentUpdateUi() {
|
|
250
250
|
const start = () => {
|
|
251
|
-
if (typeof document.
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
let actionInFlight = false;
|
|
255
|
-
let currentView = null;
|
|
256
|
-
|
|
257
|
-
section.addEventListener('click', async event => {
|
|
258
|
-
const action = event.target?.closest?.('[data-update-action]')?.dataset?.updateAction;
|
|
259
|
-
if (!action || actionInFlight) return;
|
|
260
|
-
actionInFlight = true;
|
|
261
|
-
renderUpdateSection(section, currentView, { busyAction: action });
|
|
262
|
-
try {
|
|
263
|
-
currentView = await sendConsentAction(action);
|
|
264
|
-
} catch (error) {
|
|
265
|
-
currentView = failedUpdateView(currentView, error);
|
|
266
|
-
} finally {
|
|
267
|
-
actionInFlight = false;
|
|
268
|
-
renderUpdateSection(section, currentView);
|
|
269
|
-
}
|
|
270
|
-
});
|
|
271
|
-
|
|
272
|
-
chrome.runtime.onMessage.addListener(message => {
|
|
273
|
-
if (message?.type !== 'codex-overleaf/consent-update-state') return;
|
|
274
|
-
currentView = message.view;
|
|
275
|
-
if (!actionInFlight) renderUpdateSection(section, currentView);
|
|
276
|
-
});
|
|
277
|
-
|
|
278
|
-
sendConsentAction('get')
|
|
279
|
-
.then(view => {
|
|
280
|
-
currentView = view;
|
|
281
|
-
renderUpdateSection(section, view);
|
|
282
|
-
})
|
|
283
|
-
.catch(error => renderUpdateSection(section, failedUpdateView(null, error)));
|
|
251
|
+
if (typeof document.querySelector !== 'function') return;
|
|
252
|
+
document.querySelector('.updates')?.remove();
|
|
253
|
+
document.body?.classList?.remove('consent-update-focus');
|
|
284
254
|
};
|
|
285
255
|
|
|
286
256
|
if (document.readyState === 'loading') {
|
|
@@ -303,8 +273,27 @@
|
|
|
303
273
|
return section;
|
|
304
274
|
}
|
|
305
275
|
|
|
306
|
-
|
|
307
|
-
|
|
276
|
+
function openUpdateCenter(action = '') {
|
|
277
|
+
const url = new URL(chrome.runtime.getURL('bootstrap/update.html'));
|
|
278
|
+
if (action) url.searchParams.set('action', action);
|
|
279
|
+
const opened = window.open(
|
|
280
|
+
url.href,
|
|
281
|
+
'codex-overleaf-update-center',
|
|
282
|
+
'popup,width=420,height=540,resizable=yes,scrollbars=yes'
|
|
283
|
+
);
|
|
284
|
+
if (opened) {
|
|
285
|
+
opened.focus();
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
window.location.assign(url.href);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
async function sendConsentAction(action) {
|
|
292
|
+
if (action === 'install' || action === 'retry' || action === 'center') {
|
|
293
|
+
openUpdateCenter(action === 'center' ? '' : action);
|
|
294
|
+
action = 'get';
|
|
295
|
+
}
|
|
296
|
+
const type = {
|
|
308
297
|
get: 'codex-overleaf/consent-update-get-state',
|
|
309
298
|
check: 'codex-overleaf/consent-update-check',
|
|
310
299
|
install: 'codex-overleaf/consent-update-install',
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
const MIN_NATIVE_VERSION = '1.0.0';
|
|
13
13
|
const MIN_COMPATIBLE_NATIVE_VERSION = '1.0.0';
|
|
14
14
|
const MIN_COMPATIBLE_EXTENSION_VERSION = '1.0.0';
|
|
15
|
-
const BUILD_TARGET_VERSION = '1.9.
|
|
15
|
+
const BUILD_TARGET_VERSION = '1.9.8';
|
|
16
16
|
const DEFAULT_CHROME_EXTENSION_ID = 'illdpneeeopfffmiepaejglgmhpmdhdc';
|
|
17
17
|
const REQUIRED_CAPABILITIES = Object.freeze([
|
|
18
18
|
'bridgePing',
|
|
@@ -284,6 +284,9 @@
|
|
|
284
284
|
eventsTruncatedNote: 'Earlier steps of this run were trimmed.',
|
|
285
285
|
newSessionTooltip: 'Start a fresh conversation — the current session\u2019s context will not carry over',
|
|
286
286
|
storageTitle: 'History & storage',
|
|
287
|
+
softwareUpdatesTitle: 'Software updates',
|
|
288
|
+
softwareUpdatesHelp: 'Automatically checks signed stable releases for the Extension and Native Host.',
|
|
289
|
+
checkForUpdates: 'Check for updates',
|
|
287
290
|
storageUsageLoading: 'Calculating usage\u2026',
|
|
288
291
|
storageClearAll: 'Clear all history\u2026',
|
|
289
292
|
storageClearAllHelp: 'Removes every stored session, run and audit record for all projects. Project settings and rules are kept.',
|
|
@@ -756,6 +759,9 @@
|
|
|
756
759
|
eventsTruncatedNote: '本轮更早的步骤已精简。',
|
|
757
760
|
newSessionTooltip: '开启全新对话——当前会话的上下文不会带入',
|
|
758
761
|
storageTitle: '历史与存储',
|
|
762
|
+
softwareUpdatesTitle: '软件更新',
|
|
763
|
+
softwareUpdatesHelp: '自动检查 Extension 与 Native Host 的签名稳定版本。',
|
|
764
|
+
checkForUpdates: '检查更新',
|
|
759
765
|
storageUsageLoading: '正在计算占用…',
|
|
760
766
|
storageClearAll: '清空全部历史…',
|
|
761
767
|
storageClearAllHelp: '删除所有项目已存储的全部会话、运行与审计记录。项目设置与规则会保留。',
|