1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-25 12:15:18 +01:00

[EC-661] Add web worker code bundles to Safari browser extension (#3986)

* Make browser bundle encrypt-worker.ts into a single named file

* Add encrypt-worker bundle to xcode proj
This commit is contained in:
Thomas Rittson 2022-11-08 11:15:12 +10:00 committed by GitHub
parent 22a6957162
commit da542c84f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 1 deletions

View File

@ -7,6 +7,7 @@
objects = {
/* Begin PBXBuildFile section */
03100CAF291891F4008E14EF /* encrypt-worker.js in Resources */ = {isa = PBXBuildFile; fileRef = 03100CAE291891F4008E14EF /* encrypt-worker.js */; };
55E0374D2577FA6B00979016 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55E0374C2577FA6B00979016 /* AppDelegate.swift */; };
55E037502577FA6B00979016 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 55E0374E2577FA6B00979016 /* Main.storyboard */; };
55E037522577FA6B00979016 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55E037512577FA6B00979016 /* ViewController.swift */; };
@ -50,6 +51,7 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
03100CAE291891F4008E14EF /* encrypt-worker.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = "encrypt-worker.js"; path = "../../../build/encrypt-worker.js"; sourceTree = "<group>"; };
5508DD7926051B5900A85C58 /* libswiftAppKit.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libswiftAppKit.tbd; path = usr/lib/swift/libswiftAppKit.tbd; sourceTree = SDKROOT; };
55E037482577FA6B00979016 /* desktop.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = desktop.app; sourceTree = BUILT_PRODUCTS_DIR; };
55E0374B2577FA6B00979016 /* desktop.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = desktop.entitlements; sourceTree = "<group>"; };
@ -148,6 +150,7 @@
55E0376F2577FA6F00979016 /* Resources */ = {
isa = PBXGroup;
children = (
03100CAE291891F4008E14EF /* encrypt-worker.js */,
55E037702577FA6F00979016 /* popup */,
55E037712577FA6F00979016 /* background.js */,
55E037722577FA6F00979016 /* images */,
@ -263,6 +266,7 @@
55E037802577FA6F00979016 /* background.html in Resources */,
55E0377A2577FA6F00979016 /* background.js in Resources */,
55E037792577FA6F00979016 /* popup in Resources */,
03100CAF291891F4008E14EF /* encrypt-worker.js in Resources */,
55E0377C2577FA6F00979016 /* notification in Resources */,
55E0377E2577FA6F00979016 /* vendor.js in Resources */,
55E0377D2577FA6F00979016 /* content in Resources */,

View File

@ -138,6 +138,7 @@ const config = {
"content/contextMenuHandler": "./src/content/contextMenuHandler.ts",
"content/message_handler": "./src/content/message_handler.ts",
"notification/bar": "./src/notification/bar.js",
"encrypt-worker": "../../libs/common/src/services/cryptography/encrypt.worker.ts",
},
optimization: {
minimize: ENV !== "development",

View File

@ -33,7 +33,11 @@ export class MultithreadEncryptServiceImplementation extends EncryptServiceImple
this.logService.info("Starting decryption using multithreading");
this.worker ??= new Worker(
new URL("@bitwarden/common/services/cryptography/encrypt.worker.ts", import.meta.url)
new URL(
/* webpackChunkName: 'encrypt-worker' */
"@bitwarden/common/services/cryptography/encrypt.worker.ts",
import.meta.url
)
);
this.restartTimeout();