Use Thunderbird background scripts for MV3

This commit is contained in:
Jordan Wages 2026-04-19 01:56:14 -05:00
commit e5f89222a3
4 changed files with 6 additions and 4 deletions

View file

@ -106,7 +106,7 @@ This document records the PsiTransfer behavior inferred from the local source at
- A stable public delete endpoint for previously uploaded files suitable for Thunderbird `onFileDeleted`. - A stable public delete endpoint for previously uploaded files suitable for Thunderbird `onFileDeleted`.
- A stable public rename endpoint suitable for Thunderbird `onFileRename`. - A stable public rename endpoint suitable for Thunderbird `onFileRename`.
- Whether the Thunderbird provider should upload one file per bucket or group related files into a shared bucket. PsiTransfer is bucket-oriented, while Thunderbird `cloudFile` uploads are file-oriented. - Whether the Thunderbird provider should upload one file per bucket or group related files into a shared bucket. PsiTransfer is bucket-oriented, while Thunderbird `cloudFile` uploads are file-oriented.
- Whether Thunderbird MV3 background service workers expose every browser primitive expected by the vendored `tus-js-client` bundle in all supported Thunderbird versions. The current implementation assumes the vendored bundle runs in the background worker. - Whether Thunderbird MV3 background scripts expose every browser primitive expected by the vendored `tus-js-client` bundle in all supported Thunderbird versions. The current implementation assumes the vendored bundle runs in the background context.
## Implemented minimal-v1 mapping ## Implemented minimal-v1 mapping

View file

@ -17,7 +17,9 @@
"https://*/*" "https://*/*"
], ],
"background": { "background": {
"service_worker": "src/background.js", "scripts": [
"src/background.js"
],
"type": "module" "type": "module"
}, },
"cloud_file": { "cloud_file": {

View file

@ -26,5 +26,5 @@ async function bootstrap() {
} }
bootstrap().catch(caughtError => { bootstrap().catch(caughtError => {
logError("Failed to bootstrap background service worker", caughtError); logError("Failed to bootstrap background script", caughtError);
}); });

View file

@ -106,7 +106,7 @@ export class PsiTransferClient {
}; };
if (!tus?.Upload) { if (!tus?.Upload) {
throw new Error("Vendored tus client did not load. Verify vendor/tus.js is packaged and accessible to the background service worker."); throw new Error("Vendored tus client did not load. Verify vendor/tus.js is packaged and accessible to the background context.");
} }
} }