passbolt-browser-extension 5.2.0 → 5.3.2
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/CHANGELOG.md +79 -1
- package/Gruntfile.js +1 -1
- package/RELEASE_NOTES.md +27 -71
- package/doc/browser-extension-class-diagram.md +9 -0
- package/package.json +5 -5
- package/src/all/_locales/sl/messages.json +2 -2
- package/src/all/background_page/controller/clipboard/cancelClipboardContentFlushController.js +51 -0
- package/src/all/background_page/controller/clipboard/cancelClipboardContentFlushController.test.js +46 -0
- package/src/all/background_page/controller/clipboard/copyTemporarilyToClipboardController.js +53 -0
- package/src/all/background_page/controller/clipboard/copyTemporarilyToClipboardController.test.js +47 -0
- package/src/all/background_page/controller/clipboard/{clipboardController.js → copyToClipboardController.js} +8 -8
- package/src/all/background_page/controller/clipboard/copyToClipboardController.test.js +47 -0
- package/src/all/background_page/controller/extension/getExtensionVersionController.test.js +1 -1
- package/src/all/background_page/controller/metadata/getOrFindMetadataKeysSettingsController.js +53 -0
- package/src/all/background_page/controller/metadata/getOrFindMetadataKeysSettingsController.test.js +106 -0
- package/src/all/background_page/controller/resource/updateResourceLocalStorageByFolderParentIdController.js +70 -0
- package/src/all/background_page/controller/resource/updateResourceLocalStorageByFolderParentIdController.test.js +78 -0
- package/src/all/background_page/controller/share/shareOneFolderController.test.js +2 -1
- package/src/all/background_page/controller/share/shareResourcesController.test.js +1 -1
- package/src/all/background_page/controller/user/deleteDryRunUserController.js +73 -0
- package/src/all/background_page/controller/user/deleteDryRunUserController.test.js +129 -0
- package/src/all/background_page/controller/user/deleteUserController.js +76 -0
- package/src/all/background_page/controller/user/deleteUserController.test.js +141 -0
- package/src/all/background_page/event/actionLogEvents.js +5 -12
- package/src/all/background_page/event/appEvents.js +33 -0
- package/src/all/background_page/event/findAllForActionLogController.js +58 -0
- package/src/all/background_page/event/findAllForActionLogController.test.js +43 -0
- package/src/all/background_page/event/quickAccessEvents.js +32 -0
- package/src/all/background_page/event/resourceEvents.js +11 -0
- package/src/all/background_page/event/userEvents.js +7 -20
- package/src/all/background_page/event/webIntegrationEvents.js +11 -0
- package/src/all/background_page/model/actionLog/{actionLogModel.js → findActionLogService.js} +25 -5
- package/src/all/background_page/model/actionLog/findActionLogService.test.js +61 -0
- package/src/all/background_page/model/comment/commentModel.js +5 -5
- package/src/all/background_page/model/entity/actionLog/actionLogsCollection.test.data.js +18 -0
- package/src/all/background_page/model/entity/actionLog/defaultActionLogEntity.test.data.js +34 -0
- package/src/all/background_page/model/entity/resource/resourcesCollection.js +25 -0
- package/src/all/background_page/model/entity/resource/resourcesCollection.test.js +34 -0
- package/src/all/background_page/model/import/resources/resourcesKdbxImportParser.test.js +0 -1
- package/src/all/background_page/model/user/userModel.js +0 -60
- package/src/all/background_page/pagemod/appPagemod.js +0 -2
- package/src/all/background_page/pagemod/appPagemod.test.js +2 -6
- package/src/all/background_page/service/alarm/globalAlarmService.js +2 -0
- package/src/all/background_page/service/api/actionLog/{actionLogService.js → actionLogApiService.js} +5 -4
- package/src/all/background_page/service/api/actionLog/actionLogApiService.test.js +55 -0
- package/src/all/background_page/service/api/comment/{commentService.js → commentApiService.js} +6 -7
- package/src/all/background_page/service/api/comment/commentApiService.test.js +122 -0
- package/src/all/background_page/service/api/resource/resourceService.js +1 -0
- package/src/all/background_page/service/auth/postLogoutService.js +2 -0
- package/src/all/background_page/service/auth/postLogoutService.test.js +4 -1
- package/src/all/background_page/service/browser/browserService.js +22 -0
- package/src/all/background_page/service/clipboard/clipboardProviderService.js +40 -0
- package/src/all/background_page/service/clipboard/clipboardProviderService.test.js +61 -0
- package/src/all/background_page/service/clipboard/copyToClipboardService.js +123 -0
- package/src/all/background_page/service/clipboard/copyToClipboardService.test.js +174 -0
- package/src/all/background_page/service/resource/findAndUpdateResourcesLocalStorageService.js +52 -1
- package/src/all/background_page/service/resource/findAndUpdateResourcesLocalStorageService.test.js +100 -0
- package/src/all/background_page/service/resource/findResourcesService.js +53 -19
- package/src/all/background_page/service/resource/findResourcesService.test.js +191 -0
- package/src/all/background_page/service/resourceType/updateResourceTypesService.test.js +1 -1
- package/src/all/background_page/service/share/shareResourceService.test.js +1 -1
- package/src/all/background_page/service/user/deleteUserService.js +97 -0
- package/src/all/background_page/service/user/deleteUserService.test.js +178 -0
- package/src/all/locales/de-DE/common.json +2 -2
- package/src/all/locales/es-ES/common.json +2 -2
- package/src/all/locales/fr-FR/common.json +5 -5
- package/src/all/locales/it-IT/common.json +2 -2
- package/src/all/locales/ja-JP/common.json +2 -2
- package/src/all/locales/ko-KR/common.json +2 -2
- package/src/all/locales/lt-LT/common.json +2 -2
- package/src/all/locales/nl-NL/common.json +2 -2
- package/src/all/locales/pl-PL/common.json +5 -5
- package/src/all/locales/pt-BR/common.json +2 -2
- package/src/all/locales/ro-RO/common.json +2 -2
- package/src/all/locales/ru-RU/common.json +2 -2
- package/src/all/locales/sl-SI/common.json +33 -33
- package/src/all/locales/sv-SE/common.json +2 -2
- package/src/all/locales/uk-UA/common.json +3 -3
- package/src/chrome/manifest.json +1 -1
- package/src/chrome/polyfill/clipboard/edgeBackgroundPageClipboardService.js +31 -0
- package/src/chrome/polyfill/clipboard/edgeBackgroundPageClipboardService.test.js +51 -0
- package/src/chrome-mv3/index.js +3 -3
- package/src/chrome-mv3/manifest.json +1 -1
- package/src/chrome-mv3/offscreens/{fetch.html → offscreen.html} +1 -1
- package/src/chrome-mv3/offscreens/{fetch.js → offscreen.js} +2 -2
- package/src/chrome-mv3/offscreens/service/clipboard/writeClipobardOffscreenService.js +54 -0
- package/src/chrome-mv3/offscreens/service/clipboard/writeClipobardOffscreenService.test.js +56 -0
- package/src/chrome-mv3/offscreens/service/network/fetchOffscreenService.js +36 -44
- package/src/chrome-mv3/offscreens/service/network/fetchOffscreenService.test.data.js +0 -1
- package/src/chrome-mv3/offscreens/service/network/fetchOffscreenService.test.js +90 -120
- package/src/chrome-mv3/offscreens/service/offscreen/handleOffscreenRequestService.js +85 -0
- package/src/chrome-mv3/offscreens/service/offscreen/handleOffscreenRequestService.test.js +99 -0
- package/src/chrome-mv3/polyfill/clipboardOffscreenPolyfill.js +19 -0
- package/src/chrome-mv3/serviceWorker/service/clipboard/requestClipboardOffscreenService.js +51 -0
- package/src/chrome-mv3/serviceWorker/service/clipboard/requestClipboardOffscreenService.test.js +70 -0
- package/src/chrome-mv3/serviceWorker/service/clipboard/responseClipboardOffscreenService.js +25 -0
- package/src/chrome-mv3/serviceWorker/service/clipboard/responseClipboardOffscreenService.test.data.js +21 -0
- package/src/chrome-mv3/serviceWorker/service/clipboard/responseClipboardOffscreenService.test.js +33 -0
- package/src/chrome-mv3/serviceWorker/service/network/requestFetchOffscreenService.js +25 -50
- package/src/chrome-mv3/serviceWorker/service/network/requestFetchOffscreenService.test.js +16 -39
- package/src/chrome-mv3/serviceWorker/service/network/responseFetchOffscreenService.js +14 -45
- package/src/chrome-mv3/serviceWorker/service/network/responseFetchOffscreenService.test.js +5 -37
- package/src/chrome-mv3/serviceWorker/service/offscreen/createOffscreenDocumentService.js +43 -0
- package/src/chrome-mv3/serviceWorker/service/offscreen/createOffscreenDocumentService.test.js +48 -0
- package/src/chrome-mv3/serviceWorker/service/offscreen/handleOffscreenResponseService.js +119 -0
- package/src/chrome-mv3/serviceWorker/service/offscreen/handleOffscreenResponseService.test.js +159 -0
- package/src/firefox/manifest.json +1 -1
- package/src/safari/manifest.json +1 -1
- package/test/jest.setup.js +4 -0
- package/test/mocks/mockNavigatorClipboard.js +40 -0
- package/test/mocks/mockWebExtensionPolyfill.js +2 -1
- package/{webpack-offscreens.fetch.config.js → webpack-offscreens.config.js} +1 -1
- package/webpack.service-worker.config.js +1 -0
- package/src/all/background_page/controller/clipboard/clipboardController.test.js +0 -68
- package/src/all/background_page/event/clipboardEvents.js +0 -28
|
@@ -105,8 +105,8 @@
|
|
|
105
105
|
"The server key is expired.": "A chave do servidor expirou.",
|
|
106
106
|
"The service is unavailable": "O serviço está indisponível",
|
|
107
107
|
"The verificationResult keyID should be a valid keyID Object.": "The verificationResult keyID should be a valid keyID Object.",
|
|
108
|
-
"The verificationResult signature should be a valid verified Promise<openpgp.Signature>.": "",
|
|
109
|
-
"The verificationResult verified should be a valid verified Promise<boolean>.": "",
|
|
108
|
+
"The verificationResult signature should be a valid verified Promise<openpgp.Signature>.": "The verificationResult signature should be a valid verified Promise<openpgp.Signature>.",
|
|
109
|
+
"The verificationResult verified should be a valid verified Promise<boolean>.": "The verificationResult verified should be a valid verified Promise<boolean>.",
|
|
110
110
|
"This is not a valid passphrase": "Esta não é uma senha válida",
|
|
111
111
|
"This key does not match any account.": "Esta chave não corresponde a nenhuma conta.",
|
|
112
112
|
"This key is already used by another user.": "Essa chave já está sendo usada por outro usuário.",
|
|
@@ -105,8 +105,8 @@
|
|
|
105
105
|
"The server key is expired.": "Cheia serverului a expirat.",
|
|
106
106
|
"The service is unavailable": "Serviciul nu este disponibil",
|
|
107
107
|
"The verificationResult keyID should be a valid keyID Object.": "The verificationResult keyID should be a valid keyID Object.",
|
|
108
|
-
"The verificationResult signature should be a valid verified Promise<openpgp.Signature>.": "",
|
|
109
|
-
"The verificationResult verified should be a valid verified Promise<boolean>.": "",
|
|
108
|
+
"The verificationResult signature should be a valid verified Promise<openpgp.Signature>.": "The verificationResult signature should be a valid verified Promise<openpgp.Signature>.",
|
|
109
|
+
"The verificationResult verified should be a valid verified Promise<boolean>.": "The verificationResult verified should be a valid verified Promise<boolean>.",
|
|
110
110
|
"This is not a valid passphrase": "Aceasta nu este o parolă validă",
|
|
111
111
|
"This key does not match any account.": "Această cheie nu se potrivește cu niciun cont.",
|
|
112
112
|
"This key is already used by another user.": "Această cheie este deja folosită de un alt utilizator.",
|
|
@@ -105,8 +105,8 @@
|
|
|
105
105
|
"The server key is expired.": "Срок действия ключа сервера истёк.",
|
|
106
106
|
"The service is unavailable": "Сервис недоступен",
|
|
107
107
|
"The verificationResult keyID should be a valid keyID Object.": "The verificationResult keyID should be a valid keyID Object.",
|
|
108
|
-
"The verificationResult signature should be a valid verified Promise<openpgp.Signature>.": "",
|
|
109
|
-
"The verificationResult verified should be a valid verified Promise<boolean>.": "",
|
|
108
|
+
"The verificationResult signature should be a valid verified Promise<openpgp.Signature>.": "The verificationResult signature should be a valid verified Promise<openpgp.Signature>.",
|
|
109
|
+
"The verificationResult verified should be a valid verified Promise<boolean>.": "The verificationResult verified should be a valid verified Promise<boolean>.",
|
|
110
110
|
"This is not a valid passphrase": "Это недействительная парольная фраза",
|
|
111
111
|
"This key does not match any account.": "Этот ключ не соответствует ни одной учетной записи.",
|
|
112
112
|
"This key is already used by another user.": "Этот ключ уже используется другим пользователем.",
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"Adding tag...": "Dodajam oznako...",
|
|
3
3
|
"An ECC key should be based on a supported curve.": "Ključ ECC mora temeljiti na podprti krivulji.",
|
|
4
|
-
"An internal error occurred. The server response could not be parsed. Please contact your administrator.": "Prišlo je do notranje napake. Odgovora strežnika ni bilo mogoče
|
|
4
|
+
"An internal error occurred. The server response could not be parsed. Please contact your administrator.": "Prišlo je do notranje napake. Odgovora strežnika ni bilo mogoče obdelati. Obrnite se na svojega skrbnika.",
|
|
5
5
|
"An RSA key should have a length of {{size}} bits minimum.": "Ključ RSA mora imeti najmanj {{size}} bitov dolžine.",
|
|
6
6
|
"Autofill failed. Could not find the active tab.": "Samodejno izpolnjevanje ni uspelo. Aktivnega zavihka ni bilo mogoče najti.",
|
|
7
7
|
"Calculate permissions": "Izračunaj dovoljenja",
|
|
8
8
|
"Calculating changes for {{name}}": "Izračunavam spremembe za {{name}}",
|
|
9
9
|
"Calculating folders permissions changes": "Izračunavam spremembe dovoljenj za mape",
|
|
10
10
|
"Calculating resources permissions changes": "Izračunavam spremembe dovoljenj za vire",
|
|
11
|
-
"Calculating secrets": "Izračunavam
|
|
12
|
-
"Calculating secrets {{counter}}/{{total}}": "Izračunavam
|
|
11
|
+
"Calculating secrets": "Izračunavam gesla",
|
|
12
|
+
"Calculating secrets {{counter}}/{{total}}": "Izračunavam gesla {{counter}}/{{total}}",
|
|
13
13
|
"Confirming share operation": "Potrjevanje operacije deljenja",
|
|
14
|
-
"Could not verify the server key.": "
|
|
14
|
+
"Could not verify the server key.": "Ključa strežnika ni bilo mogoče preveriti.",
|
|
15
15
|
"Creating folder...": "Ustvarjanje mape...",
|
|
16
16
|
"Creating password": "Ustvarjanje gesla",
|
|
17
17
|
"Decrypting ...": "Dešifriranje ...",
|
|
18
18
|
"Decrypting {{counter}}/{{total}}": "Dešifriranje {{counter}}/{{total}}",
|
|
19
|
-
"Decrypting secrets": "Dešifriranje
|
|
20
|
-
"Decrypting secrets {{counter}}/{{total}}": "Dešifriranje
|
|
19
|
+
"Decrypting secrets": "Dešifriranje gesel",
|
|
20
|
+
"Decrypting secrets {{counter}}/{{total}}": "Dešifriranje gesel {{counter}}/{{total}}",
|
|
21
21
|
"Done": "Končano",
|
|
22
22
|
"Done!": "Končano!",
|
|
23
23
|
"Encrypting {{counter}}/{{total}}": "Šifriranje {{counter}}/{{total}}",
|
|
24
24
|
"Encrypting Metadata": "Šifriranje metapodatkov",
|
|
25
|
-
"Encrypting secret": "Šifriranje
|
|
26
|
-
"Encrypting Secret": "Šifriranje
|
|
27
|
-
"Encrypting secrets": "Šifriranje
|
|
25
|
+
"Encrypting secret": "Šifriranje gesla",
|
|
26
|
+
"Encrypting Secret": "Šifriranje gesla",
|
|
27
|
+
"Encrypting secrets": "Šifriranje gesla",
|
|
28
28
|
"Expiry date will be updated on {{count}} resource._one": "Datum poteka bo posodobljen za {{count}} vir.",
|
|
29
29
|
"Expiry date will be updated on {{count}} resource._other": "Datum poteka bo posodobljen za {{count}} virov.",
|
|
30
30
|
"Exporting ...": "Izvažanje ...",
|
|
@@ -36,15 +36,15 @@
|
|
|
36
36
|
"Importing ...": "Uvažanje ...",
|
|
37
37
|
"Importing folders {{importedCount}}/{{total}}": "Uvažanje map {{importedCount}}/{{total}}",
|
|
38
38
|
"Importing passwords {{importedCount}}/{{total}}": "Uvažanje gesel {{importedCount}}/{{total}}",
|
|
39
|
-
"Inactive worker on the page.": "Neaktiven delavec na strani.",
|
|
39
|
+
"Inactive worker on the page.": "Neaktiven delavec (worker) na strani.",
|
|
40
40
|
"Initialize": "Inicializiraj",
|
|
41
41
|
"Initializing": "Inicializiranje",
|
|
42
42
|
"Initializing ...": "Inicializiranje ...",
|
|
43
43
|
"Mark as expired ...": "Označi kot poteklo ...",
|
|
44
|
-
"MFA authentication is required.": "
|
|
45
|
-
"Migrating metadata": "
|
|
46
|
-
"Migrating resources metadata page {{number}}/{{totalPagesCount}}": "
|
|
47
|
-
"Moving {{count}} resources_one": "Premikam
|
|
44
|
+
"MFA authentication is required.": "Za prijavo je zahtevana večfaktorska avtentikacija (MFA).",
|
|
45
|
+
"Migrating metadata": "Migracija metapodatkov",
|
|
46
|
+
"Migrating resources metadata page {{number}}/{{totalPagesCount}}": "Migracija metapodatkov virov, stran {{number}}/{{totalPagesCount}}",
|
|
47
|
+
"Moving {{count}} resources_one": "Premikam vir",
|
|
48
48
|
"Moving {{count}} resources_other": "Premikam {{count}} virov",
|
|
49
49
|
"Moving {{name}}": "Premikam {{name}}",
|
|
50
50
|
"Moving folder": "Premikanje mape",
|
|
@@ -55,14 +55,14 @@
|
|
|
55
55
|
"Rekeying users' key": "Znova nastavljam ključe uporabnikov",
|
|
56
56
|
"Retrieving all resources parent folders permissions": "Pridobivam dovoljenja nadrejenih map za vse vire",
|
|
57
57
|
"Retrieving destination folder permissions": "Pridobivam dovoljenja ciljne mape",
|
|
58
|
-
"Retrieving folders permissions": "Pridobivam dovoljenja
|
|
58
|
+
"Retrieving folders permissions": "Pridobivam dovoljenja map",
|
|
59
59
|
"Retrieving resource types": "Pridobivam vrste virov",
|
|
60
60
|
"Retrieving resources permissions": "Pridobivam dovoljenja za vire",
|
|
61
|
-
"Retrieving secrets": "
|
|
61
|
+
"Retrieving secrets": "Pridobivanje gesla",
|
|
62
62
|
"Saving permissions...": "Shranjevanje dovoljenj...",
|
|
63
63
|
"Saving resource": "Shranjevanje vira",
|
|
64
64
|
"Server internal error. Check with your administrator.": "Notranja napaka strežnika. Preverite pri svojem skrbniku.",
|
|
65
|
-
"Share {{count}} resource_one": "Deli
|
|
65
|
+
"Share {{count}} resource_one": "Deli vir",
|
|
66
66
|
"Share {{count}} resource_other": "Deli {{count}} virov",
|
|
67
67
|
"Sharing folder {{name}}": "Deljenje mape {{name}}",
|
|
68
68
|
"Sharing folders": "Deljenje map",
|
|
@@ -70,29 +70,29 @@
|
|
|
70
70
|
"Sharing resources": "Deljenje virov",
|
|
71
71
|
"Sharing resources {{counter}}/{{total}}": "Deljenje virov {{counter}}/{{total}}",
|
|
72
72
|
"Start sharing": "Začni z deljenjem",
|
|
73
|
-
"Synchronizing keyring": "
|
|
73
|
+
"Synchronizing keyring": "Sinhronizacija zbirke ključev",
|
|
74
74
|
"Synchronizing keys": "Synchroniziranje ključev",
|
|
75
75
|
"Tagging passwords {{taggedCount}}/{{total}}": "Označevanje gesel {{taggedCount}}/{{total}}",
|
|
76
|
-
"The encryption key used to share metadata between users could not be verified and is considered untrusted.": "
|
|
76
|
+
"The encryption key used to share metadata between users could not be verified and is considered untrusted.": "Šifrirnega ključa za izmenjavo metapodatkov med uporabniki ni bilo mogoče preveriti in velja za nezaupanja vrednega.",
|
|
77
77
|
"The external service is unavailable": "Zunanja storitev ni na voljo",
|
|
78
78
|
"The external service raised an error": "Zunanja storitev je povzročila napako",
|
|
79
79
|
"The folder cannot be moved inside itself.": "Mape ni mogoče premakniti znotraj same sebe.",
|
|
80
|
-
"The key should be a valid openpgp armored key string.": "Ključ mora biti veljaven niz
|
|
80
|
+
"The key should be a valid openpgp armored key string.": "Ključ mora biti veljaven niz armored ključa openpgp.",
|
|
81
81
|
"The key should be a valid openpgp key.": "Ključ mora biti veljaven openpgp ključ.",
|
|
82
82
|
"The key should be a valid openpgp private key.": "Ključ mora biti veljaven openpgp zasebni ključ.",
|
|
83
83
|
"The key should be a valid openpgp public key.": "Ključ mora biti veljaven openpgp javni ključ.",
|
|
84
|
-
"The keys should be an array of valid decrypted openpgp private keys.": "Ključi morajo biti polje veljavnih dešifriranih
|
|
85
|
-
"The keys should be an array of valid encrypted openpgp private keys.": "Ključi morajo biti polje veljavnih šifriranih
|
|
86
|
-
"The keys should be an array of valid openpgp armored key strings.": "Ključi morajo biti polje veljavnih
|
|
84
|
+
"The keys should be an array of valid decrypted openpgp private keys.": "Ključi morajo biti polje veljavnih dešifriranih OpenPGP zasebnih ključev.",
|
|
85
|
+
"The keys should be an array of valid encrypted openpgp private keys.": "Ključi morajo biti polje veljavnih šifriranih OpenPGP zasebnih ključev.",
|
|
86
|
+
"The keys should be an array of valid openpgp armored key strings.": "Ključi morajo biti polje veljavnih nizov armored ključev OpenPGP.",
|
|
87
87
|
"The keys should be an array of valid openpgp private keys.": "Ključi morajo biti polje veljavnih openpgp zasebnih ključev.",
|
|
88
88
|
"The keys should be an array of valid openpgp public keys.": "Ključi morajo biti polje veljavnih openpgp javnih ključev.",
|
|
89
|
-
"The keys should be an array.": "Ključi morajo biti polje.",
|
|
89
|
+
"The keys should be an array.": "Ključi morajo biti tipa polje.",
|
|
90
90
|
"The message should be a valid openpgp clear text message.": "Sporočilo mora biti veljavno openpgp besedilno sporočilo.",
|
|
91
91
|
"The message should be a valid openpgp message.": "Sporočilo mora biti veljavno openpgp sporočilo.",
|
|
92
92
|
"The message should be decrypted.": "Sporočilo mora biti dešifrirano.",
|
|
93
93
|
"The message should be of type string.": "Sporočilo mora biti tipa niz.",
|
|
94
94
|
"The message should contain at least one session key.": "Sporočilo mora vsebovati vsaj en sejni ključ.",
|
|
95
|
-
"The operation has been aborted to maintain security integrity.": "
|
|
95
|
+
"The operation has been aborted to maintain security integrity.": "Za ohranitev varnosti je bila operacija prekinjena.",
|
|
96
96
|
"The private key should be a valid openpgp key.": "Zasebni ključ mora biti veljaven openpgp ključ.",
|
|
97
97
|
"The private key should be decrypted.": "Zasebni ključ mora biti dešifriran.",
|
|
98
98
|
"The private key should be encrypted.": "Zasebni ključ mora biti šifriran.",
|
|
@@ -104,21 +104,21 @@
|
|
|
104
104
|
"The server key has changed.": "Ključ strežnika se je spremenil.",
|
|
105
105
|
"The server key is expired.": "Ključ strežnika je potekel.",
|
|
106
106
|
"The service is unavailable": "Storitev ni na voljo",
|
|
107
|
-
"The verificationResult keyID should be a valid keyID Object.": "
|
|
108
|
-
"The verificationResult signature should be a valid verified Promise<openpgp.Signature>.": "",
|
|
109
|
-
"The verificationResult verified should be a valid verified Promise<boolean>.": "",
|
|
107
|
+
"The verificationResult keyID should be a valid keyID Object.": "Vrednost keyID v verificationResult mora biti veljaven keyID objekt.",
|
|
108
|
+
"The verificationResult signature should be a valid verified Promise<openpgp.Signature>.": "Podpis verificationResult mora biti veljavna verificirana Promise<openpgp.Signature>.",
|
|
109
|
+
"The verificationResult verified should be a valid verified Promise<boolean>.": "Vrednost verified v verificationResult mora biti veljavna verificirana Promise<boolean>.",
|
|
110
110
|
"This is not a valid passphrase": "To ni veljavno geslo.",
|
|
111
111
|
"This key does not match any account.": "Ta ključ se ne ujema z nobenim računom.",
|
|
112
112
|
"This key is already used by another user.": "Ta ključ že uporablja drug uporabnik.",
|
|
113
113
|
"Unable to retrieve the active tab info.": "Ni mogoče pridobiti podatkov o aktivnem zavihku.",
|
|
114
|
-
"Updating folders local storage": "
|
|
114
|
+
"Updating folders local storage": "Posodabljanje map v lokalni shrambi",
|
|
115
115
|
"Updating group": "Posodabljam skupino",
|
|
116
116
|
"Updating group ...": "Posodabljam skupino ...",
|
|
117
117
|
"Updating password": "Posodabljam geslo",
|
|
118
|
-
"Updating resource": "
|
|
119
|
-
"Updating resources local storage": "
|
|
120
|
-
"Updating resources metadata": "
|
|
121
|
-
"Updating resources metadata {{counter}}/{{total}}": "
|
|
118
|
+
"Updating resource": "Posodabljanje vira",
|
|
119
|
+
"Updating resources local storage": "Posodabljanje virov v lokalni shrambi",
|
|
120
|
+
"Updating resources metadata": "Posodabljanje metapodatkov virov",
|
|
121
|
+
"Updating resources metadata {{counter}}/{{total}}": "Posodabljanje metapodatkov virov {{counter}}/{{total}}",
|
|
122
122
|
"Updating users' key...": "Posodabljam ključe uporabnikov...",
|
|
123
123
|
"You have already started the process on another tab.": "Postopek ste že začeli v drugem zavihku."
|
|
124
124
|
}
|
|
@@ -105,8 +105,8 @@
|
|
|
105
105
|
"The server key is expired.": "Servernyckeln har gått ut.",
|
|
106
106
|
"The service is unavailable": "Tjänsten är inte tillgänglig",
|
|
107
107
|
"The verificationResult keyID should be a valid keyID Object.": "The verificationResult keyID should be a valid keyID Object.",
|
|
108
|
-
"The verificationResult signature should be a valid verified Promise<openpgp.Signature>.": "",
|
|
109
|
-
"The verificationResult verified should be a valid verified Promise<boolean>.": "",
|
|
108
|
+
"The verificationResult signature should be a valid verified Promise<openpgp.Signature>.": "The verificationResult signature should be a valid verified Promise<openpgp.Signature>.",
|
|
109
|
+
"The verificationResult verified should be a valid verified Promise<boolean>.": "The verificationResult verified should be a valid verified Promise<boolean>.",
|
|
110
110
|
"This is not a valid passphrase": "Detta är inte en giltig lösenfras",
|
|
111
111
|
"This key does not match any account.": "Denna nyckel matchar inte något konto.",
|
|
112
112
|
"This key is already used by another user.": "Denna nyckel används redan av en annan användare.",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"Initialize": "Ініціалізувати",
|
|
41
41
|
"Initializing": "Ініціалізація",
|
|
42
42
|
"Initializing ...": "Ініціалізація…",
|
|
43
|
-
"Mark as expired ...": "Позначити як
|
|
43
|
+
"Mark as expired ...": "Позначити як прострочене ...",
|
|
44
44
|
"MFA authentication is required.": "Необхідна багатофакторна аутентифікація.",
|
|
45
45
|
"Migrating metadata": "Міграція метаданих",
|
|
46
46
|
"Migrating resources metadata page {{number}}/{{totalPagesCount}}": "Міграція сторінки метаданих ресурсів {{number}}/{{totalPagesCount}}",
|
|
@@ -105,8 +105,8 @@
|
|
|
105
105
|
"The server key is expired.": "Термін дії ключа сервера закінчився.",
|
|
106
106
|
"The service is unavailable": "Сервіс недоступний",
|
|
107
107
|
"The verificationResult keyID should be a valid keyID Object.": "verificationResult keyID має бути дійсним об'єктом keyID.",
|
|
108
|
-
"The verificationResult signature should be a valid verified Promise<openpgp.Signature>.": "",
|
|
109
|
-
"The verificationResult verified should be a valid verified Promise<boolean>.": "",
|
|
108
|
+
"The verificationResult signature should be a valid verified Promise<openpgp.Signature>.": "verificationResult verified має бути коректним перевіреним Promise<openpgp.Signature>.",
|
|
109
|
+
"The verificationResult verified should be a valid verified Promise<boolean>.": "verificationResult verified має бути коректним перевіреним Promise<boolean>.",
|
|
110
110
|
"This is not a valid passphrase": "Це не дійсна парольна фраза",
|
|
111
111
|
"This key does not match any account.": "Цей ключ не відповідає жодному обліковому запису.",
|
|
112
112
|
"This key is already used by another user.": "Цей ключ вже використовується іншим користувачем.",
|
package/src/chrome/manifest.json
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Passbolt ~ Open source password manager for teams
|
|
3
|
+
* Copyright (c) Passbolt SA (https://www.passbolt.com)
|
|
4
|
+
*
|
|
5
|
+
* Licensed under GNU Affero General Public License version 3 of the or any later version.
|
|
6
|
+
* For full copyright and license information, please see the LICENSE.txt
|
|
7
|
+
* Redistributions of files must retain the above copyright notice.
|
|
8
|
+
*
|
|
9
|
+
* @copyright Copyright (c) Passbolt SA (https://www.passbolt.com)
|
|
10
|
+
* @license https://opensource.org/licenses/AGPL-3.0 AGPL License
|
|
11
|
+
* @link https://www.passbolt.com Passbolt(tm)
|
|
12
|
+
* @since 5.3.2
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The service aims to create metadata key.
|
|
17
|
+
*/
|
|
18
|
+
export default class EdgeBackgroundPageClipboardService {
|
|
19
|
+
/**
|
|
20
|
+
* @inheritDoc navigator.clipboard.writeText
|
|
21
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/writeText
|
|
22
|
+
*/
|
|
23
|
+
static async writeText(data) {
|
|
24
|
+
const textarea = document.createElement("textarea");
|
|
25
|
+
document.body.appendChild(textarea);
|
|
26
|
+
textarea.value = data;
|
|
27
|
+
textarea.select();
|
|
28
|
+
document.execCommand("cut");
|
|
29
|
+
document.body.removeChild(textarea);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Passbolt ~ Open source password manager for teams
|
|
3
|
+
* Copyright (c) Passbolt SA (https://www.passbolt.com)
|
|
4
|
+
*
|
|
5
|
+
* Licensed under GNU Affero General Public License version 3 of the or any later version.
|
|
6
|
+
* For full copyright and license information, please see the LICENSE.txt
|
|
7
|
+
* Redistributions of files must retain the above copyright notice.
|
|
8
|
+
*
|
|
9
|
+
* @copyright Copyright (c) Passbolt SA (https://www.passbolt.com)
|
|
10
|
+
* @license https://opensource.org/licenses/AGPL-3.0 AGPL License
|
|
11
|
+
* @link https://www.passbolt.com Passbolt(tm)
|
|
12
|
+
* @since 5.3.2
|
|
13
|
+
*/
|
|
14
|
+
import EdgeBackgroundPageClipboardService from "./edgeBackgroundPageClipboardService";
|
|
15
|
+
|
|
16
|
+
describe("EdgeBackgroundPageClipboardService", () => {
|
|
17
|
+
describe("::writeText", () => {
|
|
18
|
+
it("should write the given data to the clipboard", async() => {
|
|
19
|
+
expect.assertions(8);
|
|
20
|
+
|
|
21
|
+
let copiedValue = "";
|
|
22
|
+
const fakeElement = {
|
|
23
|
+
value: "",
|
|
24
|
+
select: jest.fn().mockImplementation(() => { copiedValue = fakeElement.value; }),
|
|
25
|
+
};
|
|
26
|
+
// Faking document for this specific context
|
|
27
|
+
global.document = {
|
|
28
|
+
createElement: () => fakeElement,
|
|
29
|
+
body: {
|
|
30
|
+
appendChild: jest.fn(),
|
|
31
|
+
removeChild: jest.fn(),
|
|
32
|
+
},
|
|
33
|
+
execCommand: jest.fn()
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
document.execCommand.mockImplementation(() => {});
|
|
37
|
+
|
|
38
|
+
const dataToWrite = "text-to-copy";
|
|
39
|
+
await EdgeBackgroundPageClipboardService.writeText(dataToWrite);
|
|
40
|
+
|
|
41
|
+
expect(copiedValue).toStrictEqual(dataToWrite);
|
|
42
|
+
expect(fakeElement.select).toHaveBeenCalledTimes(1);
|
|
43
|
+
expect(document.body.appendChild).toHaveBeenCalledTimes(1);
|
|
44
|
+
expect(document.body.appendChild).toHaveBeenCalledWith(fakeElement);
|
|
45
|
+
expect(document.body.removeChild).toHaveBeenCalledTimes(1);
|
|
46
|
+
expect(document.body.removeChild).toHaveBeenCalledWith(fakeElement);
|
|
47
|
+
expect(document.execCommand).toHaveBeenCalledTimes(1);
|
|
48
|
+
expect(document.execCommand).toHaveBeenCalledWith("cut");
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
});
|
package/src/chrome-mv3/index.js
CHANGED
|
@@ -18,9 +18,9 @@ import TabService from "../all/background_page/service/tab/tabService";
|
|
|
18
18
|
import OnExtensionUpdateAvailableService
|
|
19
19
|
from "../all/background_page/service/extension/onExtensionUpdateAvailableService";
|
|
20
20
|
import GlobalAlarmService from "../all/background_page/service/alarm/globalAlarmService";
|
|
21
|
-
import ResponseFetchOffscreenService from "./serviceWorker/service/network/responseFetchOffscreenService";
|
|
22
21
|
import OnStartUpService from "../all/background_page/service/extension/onStartUpService";
|
|
23
22
|
import ToolbarService from "../all/background_page/service/toolbar/toolbarService";
|
|
23
|
+
import HandleOffscreenResponseService from "./serviceWorker/service/offscreen/handleOffscreenResponseService";
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Load all system requirement
|
|
@@ -68,9 +68,9 @@ browser.alarms.onAlarm.removeListener(GlobalAlarmService.exec);
|
|
|
68
68
|
browser.alarms.onAlarm.addListener(GlobalAlarmService.exec);
|
|
69
69
|
|
|
70
70
|
/**
|
|
71
|
-
* Handle offscreen
|
|
71
|
+
* Handle offscreen responses.
|
|
72
72
|
*/
|
|
73
|
-
chrome.runtime.onMessage.addListener(
|
|
73
|
+
chrome.runtime.onMessage.addListener(HandleOffscreenResponseService.handleOffscreenResponse);
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
76
|
* Handle suggested resources on toolbar icon
|
|
@@ -12,6 +12,6 @@
|
|
|
12
12
|
* @since 4.7.0
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import
|
|
15
|
+
import HandleOffscreenRequestService from "./service/offscreen/handleOffscreenRequestService";
|
|
16
16
|
|
|
17
|
-
chrome.runtime.onMessage.addListener(
|
|
17
|
+
chrome.runtime.onMessage.addListener(HandleOffscreenRequestService.handleOffscreenRequest);
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Passbolt ~ Open source password manager for teams
|
|
3
|
+
* Copyright (c) Passbolt SA (https://www.passbolt.com)
|
|
4
|
+
*
|
|
5
|
+
* Licensed under GNU Affero General Public License version 3 of the or any later version.
|
|
6
|
+
* For full copyright and license information, please see the LICENSE.txt
|
|
7
|
+
* Redistributions of files must retain the above copyright notice.
|
|
8
|
+
*
|
|
9
|
+
* @copyright Copyright (c) Passbolt SA (https://www.passbolt.com)
|
|
10
|
+
* @license https://opensource.org/licenses/AGPL-3.0 AGPL License
|
|
11
|
+
* @link https://www.passbolt.com Passbolt(tm)
|
|
12
|
+
* @since 5.3.2
|
|
13
|
+
*/
|
|
14
|
+
export const SEND_MESSAGE_TARGET_CLIPBOARD_WRITE_OFFSCREEN = "clipboard-write-offscreen";
|
|
15
|
+
export const SEND_MESSAGE_TARGET_CLIPBOARD_WRITE_OFFSCREEN_RESPONSE_HANDLER = "service-worker-clipboard-write-text-offscreen-response-handler";
|
|
16
|
+
|
|
17
|
+
export default class WriteClipobardOffscreenService {
|
|
18
|
+
/**
|
|
19
|
+
* Handle clipboard request.
|
|
20
|
+
* @param {{clipboardContent: string}} message arguments to pass to the clipboard.writeText.
|
|
21
|
+
* @returns {Promise<object>}
|
|
22
|
+
*/
|
|
23
|
+
static async handleClipboardRequest({clipboardContent}) {
|
|
24
|
+
await WriteClipobardOffscreenService._handleClipboardWriteTextRequest(clipboardContent);
|
|
25
|
+
return WriteClipobardOffscreenService._endClipboardWrite();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Handles and emulates a clipboard::writeText(data)
|
|
30
|
+
* @param {string} clipboardContent
|
|
31
|
+
* @returns {Promise<void>}
|
|
32
|
+
* @private
|
|
33
|
+
*/
|
|
34
|
+
static async _handleClipboardWriteTextRequest(clipboardContent) {
|
|
35
|
+
const textarea = document.createElement("textarea");
|
|
36
|
+
document.body.appendChild(textarea);
|
|
37
|
+
textarea.value = clipboardContent;
|
|
38
|
+
textarea.select();
|
|
39
|
+
document.execCommand("cut");
|
|
40
|
+
document.body.removeChild(textarea);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Return the clipboard write success data to send back to the requester.
|
|
45
|
+
* @returns {object}
|
|
46
|
+
* @private
|
|
47
|
+
*/
|
|
48
|
+
static _endClipboardWrite() {
|
|
49
|
+
return {
|
|
50
|
+
data: null,
|
|
51
|
+
target: SEND_MESSAGE_TARGET_CLIPBOARD_WRITE_OFFSCREEN_RESPONSE_HANDLER,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Passbolt ~ Open source password manager for teams
|
|
3
|
+
* Copyright (c) Passbolt SA (https://www.passbolt.com)
|
|
4
|
+
*
|
|
5
|
+
* Licensed under GNU Affero General Public License version 3 of the or any later version.
|
|
6
|
+
* For full copyright and license information, please see the LICENSE.txt
|
|
7
|
+
* Redistributions of files must retain the above copyright notice.
|
|
8
|
+
*
|
|
9
|
+
* @copyright Copyright (c) Passbolt SA (https://www.passbolt.com)
|
|
10
|
+
* @license https://opensource.org/licenses/AGPL-3.0 AGPL License
|
|
11
|
+
* @link https://www.passbolt.com Passbolt(tm)
|
|
12
|
+
* @since 5.3.2
|
|
13
|
+
*/
|
|
14
|
+
import WriteClipobardOffscreenService from "./writeClipobardOffscreenService";
|
|
15
|
+
|
|
16
|
+
export const SEND_MESSAGE_TARGET_CLIPBOARD_WRITE_OFFSCREEN = "clipboard-write-offscreen";
|
|
17
|
+
export const SEND_MESSAGE_TARGET_CLIPBOARD_WRITE_OFFSCREEN_RESPONSE_HANDLER = "service-worker-clipboard-write-text-offscreen-response-handler";
|
|
18
|
+
|
|
19
|
+
describe("WriteClipobardOffscreenService", () => {
|
|
20
|
+
describe("::handleClipboardRequest", () => {
|
|
21
|
+
it("should run the copy to clipboard and return a message tailored for the requester", async() => {
|
|
22
|
+
expect.assertions(9);
|
|
23
|
+
|
|
24
|
+
let copiedValue = "";
|
|
25
|
+
const fakeElement = {
|
|
26
|
+
value: "",
|
|
27
|
+
select: jest.fn().mockImplementation(() => { copiedValue = fakeElement.value; }),
|
|
28
|
+
};
|
|
29
|
+
global.document = {
|
|
30
|
+
createElement: () => fakeElement,
|
|
31
|
+
body: {
|
|
32
|
+
appendChild: jest.fn(),
|
|
33
|
+
removeChild: jest.fn(),
|
|
34
|
+
},
|
|
35
|
+
execCommand: jest.fn()
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const clipboardContent = "test";
|
|
39
|
+
const result = await WriteClipobardOffscreenService.handleClipboardRequest({clipboardContent});
|
|
40
|
+
const expectedResult = {
|
|
41
|
+
target: "service-worker-clipboard-write-text-offscreen-response-handler",
|
|
42
|
+
data: null,
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
expect(copiedValue).toStrictEqual(clipboardContent);
|
|
46
|
+
expect(fakeElement.select).toHaveBeenCalledTimes(1);
|
|
47
|
+
expect(document.body.appendChild).toHaveBeenCalledTimes(1);
|
|
48
|
+
expect(document.body.appendChild).toHaveBeenCalledWith(fakeElement);
|
|
49
|
+
expect(document.body.removeChild).toHaveBeenCalledTimes(1);
|
|
50
|
+
expect(document.body.removeChild).toHaveBeenCalledWith(fakeElement);
|
|
51
|
+
expect(document.execCommand).toHaveBeenCalledTimes(1);
|
|
52
|
+
expect(document.execCommand).toHaveBeenCalledWith("cut");
|
|
53
|
+
expect(result).toStrictEqual(expectedResult);
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
});
|
|
@@ -11,8 +11,6 @@
|
|
|
11
11
|
* @link https://www.passbolt.com Passbolt(tm)
|
|
12
12
|
* @since 4.7.0
|
|
13
13
|
*/
|
|
14
|
-
|
|
15
|
-
import Validator from "validator";
|
|
16
14
|
import FormDataUtils from "../../../../all/background_page/utils/format/formDataUtils";
|
|
17
15
|
|
|
18
16
|
export const SEND_MESSAGE_TARGET_FETCH_OFFSCREEN = "fetch-offscreen";
|
|
@@ -43,94 +41,88 @@ export default class FetchOffscreenService {
|
|
|
43
41
|
|
|
44
42
|
/**
|
|
45
43
|
* Handle fetch request.
|
|
46
|
-
* @param {
|
|
47
|
-
* @
|
|
44
|
+
* @param {string} id the request id.
|
|
45
|
+
* @param {{resource: string, options: object}} data the fetch parameters
|
|
46
|
+
* @returns {Promise<object>}
|
|
48
47
|
*/
|
|
49
|
-
static async handleFetchRequest(
|
|
50
|
-
|
|
51
|
-
if (
|
|
52
|
-
|
|
53
|
-
return;
|
|
48
|
+
static async handleFetchRequest({resource, options}) {
|
|
49
|
+
const validationErrors = FetchOffscreenService.validateMessageData(resource, options);
|
|
50
|
+
if (validationErrors) {
|
|
51
|
+
return validationErrors;
|
|
54
52
|
}
|
|
55
53
|
|
|
56
|
-
if (!(await FetchOffscreenService.validateMessageData(message.data))) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
const {id, resource, options} = message?.data || {};
|
|
60
54
|
// Update the body to fit the data type to send (JSON or FORM DATA)
|
|
61
|
-
options.body = options.body
|
|
55
|
+
options.body = options.body?.dataType === FETCH_OFFSCREEN_DATA_TYPE_JSON ? options.body.data : FormDataUtils.arrayToFormData(options.body.data);
|
|
62
56
|
await FetchOffscreenService.increaseAwaitingRequests();
|
|
63
57
|
try {
|
|
64
58
|
const response = await fetch(resource, options);
|
|
65
|
-
await FetchOffscreenService.handleSuccessResponse(
|
|
59
|
+
return await FetchOffscreenService.handleSuccessResponse(response);
|
|
66
60
|
} catch (error) {
|
|
67
|
-
|
|
61
|
+
console.log(error);
|
|
62
|
+
return FetchOffscreenService.handleErrorResponse(error);
|
|
63
|
+
} finally {
|
|
64
|
+
await FetchOffscreenService.decreaseAwaitingRequests();
|
|
68
65
|
}
|
|
69
|
-
await FetchOffscreenService.decreaseAwaitingRequests();
|
|
70
66
|
}
|
|
71
67
|
|
|
72
68
|
/**
|
|
73
69
|
* Validate message data.
|
|
74
|
-
* @param {
|
|
75
|
-
* @
|
|
70
|
+
* @param {string} resource
|
|
71
|
+
* @param {object} options
|
|
72
|
+
* @returns {object|null}
|
|
76
73
|
*/
|
|
77
|
-
static
|
|
74
|
+
static validateMessageData(resource, options) {
|
|
78
75
|
let error;
|
|
79
|
-
|
|
80
|
-
if (!messageData.id || typeof messageData.id !== "string" || !Validator.isUUID(messageData.id)) {
|
|
81
|
-
error = new Error("FetchOffscreenService: message.id should be a valid uuid.");
|
|
82
|
-
} else if (typeof messageData.resource !== "string") {
|
|
76
|
+
if (typeof resource !== "string") {
|
|
83
77
|
error = new Error("FetchOffscreenService: message.resource should be a valid valid.");
|
|
84
|
-
} else if (typeof
|
|
78
|
+
} else if (typeof options === "undefined" || !(options instanceof Object)) {
|
|
85
79
|
error = new Error("FetchOffscreenService: message.options should be an object.");
|
|
86
80
|
}
|
|
87
81
|
|
|
88
82
|
if (error) {
|
|
89
|
-
|
|
90
|
-
return false;
|
|
83
|
+
return FetchOffscreenService.handleErrorResponse(error);
|
|
91
84
|
}
|
|
92
85
|
|
|
93
|
-
return
|
|
86
|
+
return null;
|
|
94
87
|
}
|
|
95
88
|
|
|
96
89
|
/**
|
|
97
90
|
* Handle fetch success, and send response to the service worker.
|
|
98
|
-
* @param {string} id The fetch offscreen request id
|
|
99
91
|
* @param {Response} response The fetch response
|
|
100
92
|
* @returns {Promise<void>}
|
|
93
|
+
* @private
|
|
101
94
|
*/
|
|
102
|
-
static async handleSuccessResponse(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
id: id,
|
|
95
|
+
static async handleSuccessResponse(response) {
|
|
96
|
+
return {
|
|
97
|
+
data: await FetchOffscreenService.serializeResponse(response),
|
|
106
98
|
type: FETCH_OFFSCREEN_RESPONSE_TYPE_SUCCESS,
|
|
107
|
-
|
|
108
|
-
}
|
|
99
|
+
target: SEND_MESSAGE_TARGET_FETCH_OFFSCREEN_RESPONSE_HANDLER,
|
|
100
|
+
};
|
|
109
101
|
}
|
|
110
102
|
|
|
111
103
|
/**
|
|
112
104
|
* Handle fetch error, and communicate it the service worker.
|
|
113
|
-
* @param {string} id The fetch offscreen request id
|
|
114
105
|
* @param {Error} error The fetch error
|
|
115
|
-
* @returns {
|
|
106
|
+
* @returns {object}
|
|
107
|
+
* @private
|
|
116
108
|
*/
|
|
117
|
-
static
|
|
109
|
+
static handleErrorResponse(error) {
|
|
118
110
|
console.error(error);
|
|
119
|
-
|
|
120
|
-
target: SEND_MESSAGE_TARGET_FETCH_OFFSCREEN_RESPONSE_HANDLER,
|
|
121
|
-
id: id,
|
|
122
|
-
type: FETCH_OFFSCREEN_RESPONSE_TYPE_ERROR,
|
|
111
|
+
return {
|
|
123
112
|
data: {
|
|
124
113
|
name: error?.name,
|
|
125
114
|
message: error?.message || "FetchOffscreenService: an unexpected error occurred"
|
|
126
|
-
}
|
|
127
|
-
|
|
115
|
+
},
|
|
116
|
+
type: FETCH_OFFSCREEN_RESPONSE_TYPE_ERROR,
|
|
117
|
+
target: SEND_MESSAGE_TARGET_FETCH_OFFSCREEN_RESPONSE_HANDLER,
|
|
118
|
+
};
|
|
128
119
|
}
|
|
129
120
|
|
|
130
121
|
/**
|
|
131
122
|
* Serialize the fetch response to return to the service worker.
|
|
132
123
|
* @param {Response} response The response to serialize
|
|
133
124
|
* @returns {Promise<object>}
|
|
125
|
+
* @private
|
|
134
126
|
*/
|
|
135
127
|
static async serializeResponse(response) {
|
|
136
128
|
return {
|
|
@@ -17,7 +17,6 @@ import {FETCH_OFFSCREEN_DATA_TYPE_JSON, SEND_MESSAGE_TARGET_FETCH_OFFSCREEN} fro
|
|
|
17
17
|
export const defaultFetchMessage = message => ({
|
|
18
18
|
target: SEND_MESSAGE_TARGET_FETCH_OFFSCREEN,
|
|
19
19
|
data: {
|
|
20
|
-
id: crypto.randomUUID(),
|
|
21
20
|
resource: "https://www.passbolt.test/settings.json?api-version=v2",
|
|
22
21
|
options: {
|
|
23
22
|
credentials: "include",
|