1+ diff --git a/package.json b/package.json
2+ index 0195dc8bea..949d07c41e 100644
3+ --- a/package.json
4+ +++ b/package.json
5+ @@ -3,7 +3,7 @@
6+ "private": true,
7+ "license": "GPL-3.0",
8+ "workspaces": [
9+ - "applications/*",
10+ + "applications/drive",
11+ "applications/pass-desktop/native",
12+ "packages/*",
13+ "packages/wasm/*",
14+ @@ -60,4 +60,4 @@
15+ "publishConfig": {
16+ "registry": "https://nexus.protontech.ch/repository/web-npm/"
17+ }
18+ - }
19+ + }
20+ \ No newline at end of file
21+ - -
22+
123diff --git a/applications/drive/package.json b/applications/drive/package.json
2- index c037e3ce53..e1655f0a06 100644
24+ index 0d537c5dda..976305cc4a 100644
325--- a/applications/drive/package.json
426+++ b/applications/drive/package.json
527@@ -7,7 +7,6 @@
628 "main": "index.ts",
729 "scripts": {
830 "analyze": "yarn build:web --analyze",
9- - "build:web": "cross-env NODE_ENV=production TS_NODE_PROJECT=\"../../tsconfig.webpack.json\" proton-pack build --webpackOnCaffeine --appMode=sso",
31+ - "build:web": "cross-env NODE_ENV=production TS_NODE_PROJECT=\"../../tsconfig.webpack.json\" proton-pack build --configV2 -- webpackOnCaffeine --appMode=sso --handleSupportAndErrors --optimizeAssets ",
1032 "check-types": "tsc",
1133 "i18n:extract:local": "yarn workspace @proton/i18n build && yarn build:web && proton-i18n extract",
1234 "i18n:extract:web": "proton-i18n extract",
35+ @@ -96,4 +95,4 @@
36+ "peerDependencies": {
37+ "@openpgp/web-stream-tools": "^0.1.0"
38+ }
39+ - }
40+ + }
41+ \ No newline at end of file
42+ - -
1343
1444diff --git a/applications/drive/src/app/index.tsx b/applications/drive/src/app/index.tsx
15- index 7ca2da66f3..2a99b061bb 100644
45+ index 4d03c64db1..0e5766fcfe 100644
1646--- a/applications/drive/src/app/index.tsx
1747+++ b/applications/drive/src/app/index.tsx
18- @@ -9,6 +9,8 @@ import { initializePerformanceMetrics } from './utils/performance ';
19-
20- const isPublicUrl = window.location.pathname.startsWith('/urls') ;
21-
48+ @@ -9,6 +9,8 @@ import App from './App ';
49+ import './style';
50+ import { initializePerformanceMetrics } from './utils/performance' ;
51+
2252+ window.sessionStorage.setItem("electron_mail:proton_app_name", "proton-drive");
2353+
24- initializePerformanceMetrics(isPublicUrl );
25-
26- ReactDOM.render(isPublicUrl ? <UrlsApp /> : <App />, document.querySelector('.app-root'));
54+ initializePerformanceMetrics(false );
55+
56+ ReactDOM.render(<App />, document.querySelector('.app-root'));
2757
2858diff --git a/applications/drive/src/.htaccess b/applications/drive/src/.htaccess
2959index b0b25a5fae..11d4e4af0f 100644
@@ -44,60 +74,82 @@ index b0b25a5fae..11d4e4af0f 100644
4474 AddOutputFilter INCLUDES;DEFLATE svg
4575
4676diff --git a/applications/drive/src/app/store/_downloads/fileSaver/download.ts b/applications/drive/src/app/store/_downloads/fileSaver/download.ts
47- index e3a5bd4889..da2217e2f3 100644
77+ index 1db1b7ca29..a7e6e460fd 100644
4878--- a/applications/drive/src/app/store/_downloads/fileSaver/download.ts
4979+++ b/applications/drive/src/app/store/_downloads/fileSaver/download.ts
50- @@ -1,6 +1,5 @@
51- import { WritableStream } from 'web-streams-polyfill';
52-
53- - import { isIos, isSafari } from '@proton/shared/lib/helpers/browser';
54- import { stripLeadingAndTrailingSlash } from '@proton/shared/lib/helpers/string';
55- import { PUBLIC_PATH } from '@proton/shared/lib/webpack.constants';
56-
57- @@ -15,17 +14,7 @@ let workerWakeupInterval: ReturnType<typeof setInterval>;
58- * IOS - forces all browsers to use webkit, so same problems as safari in all browsers.
59- * For them download is done in-memory using blob response.
60- */
61- - export const isUnsupported = () => {
62- - /* TODO: To be removed after test DRVWEB-4375 */
63- - if (typeof window !== 'undefined') {
64- - const isSWForSafariEnabled = 'isSWForSafariEnabled' in window && window.isSWForSafariEnabled;
65- - if (isSWForSafariEnabled) {
66- - return !('serviceWorker' in navigator);
67- - }
68- - }
69- - // Original
70- - return !('serviceWorker' in navigator) || isSafari() || isIos();
71- - };
72- + export const isUnsupported = () => !('serviceWorker' in navigator);
73-
80+ @@ -5,9 +5,11 @@ import type { TransferMeta } from '../../../components/TransferManager/transfer'
81+
82+ let workerWakeupInterval: ReturnType<typeof setInterval>;
83+
84+ + // <electron-mail-mark>
85+ export const isServiceWorkersUnsupported = () => {
86+ return !('serviceWorker' in navigator);
87+ };
88+ + // </electron-mail-mark>
89+
7490 // createDownloadIframe opens download URL created in service worker to
7591 // initialize the download in the browser. The response has headers to
76- @@ -73,6 +62,7 @@ function serviceWorkerKeepAlive() {
92+ @@ -55,11 +57,12 @@ function serviceWorkerKeepAlive() {
7793 }, 10000);
7894 }
79-
80- + /* <electron-mail-mark> */
95+
96+ + // <electron-mail-mark>
8197 export async function initDownloadSW() {
82- if (isUnsupported()) {
83- throw new Error('Saving file via download is unsupported by this browser');
84- @@ -81,7 +71,7 @@ export async function initDownloadSW() {
85- await navigator.serviceWorker
86- .register(
87- /* webpackChunkName: "downloadSW" */
88- - new URL('./downloadSW', import.meta.url),
89- + new URL('./downloadSW', import.meta.url), // electron-mail-mark
90- {
91- scope: `/${stripLeadingAndTrailingSlash(PUBLIC_PATH)}`,
92- }
93- @@ -107,6 +97,7 @@ export async function initDownloadSW() {
94-
98+ // wait Service Worker is registered
99+ await navigator.serviceWorker.register(
100+ /* webpackChunkName: "downloadSW" */
101+ - new URL('./downloadSW', import.meta.url),
102+ + new URL('./downloadSW', import.meta.url), // electron-mail-mark
103+ {
104+ scope: `/${stripLeadingAndTrailingSlash(PUBLIC_PATH)}`,
105+ }
106+ @@ -77,6 +80,7 @@ export async function initDownloadSW() {
107+
95108 serviceWorkerKeepAlive();
96109 }
97- + /* </electron-mail-mark> */
98-
110+ + // </electron-mail-mark>
111+
112+ /**
113+ * Opens download stream into service worker. Use abort signal when pipeTo can't close the download stream.
114+ diff --git a/packages/drive-store/store/_downloads/fileSaver/download.ts b/packages/drive-store/store/_downloads/fileSaver/download.ts
115+ index 1db1b7ca29..a7e6e460fd 100644
116+ --- a/packages/drive-store/store/_downloads/fileSaver/download.ts
117+ +++ b/packages/drive-store/store/_downloads/fileSaver/download.ts
118+ @@ -5,9 +5,11 @@ import type { TransferMeta } from '../../../components/TransferManager/transfer'
119+
120+ let workerWakeupInterval: ReturnType<typeof setInterval>;
121+
122+ + // <electron-mail-mark>
123+ export const isServiceWorkersUnsupported = () => {
124+ return !('serviceWorker' in navigator);
125+ };
126+ + // </electron-mail-mark>
127+
128+ // createDownloadIframe opens download URL created in service worker to
129+ // initialize the download in the browser. The response has headers to
130+ @@ -55,11 +57,12 @@ function serviceWorkerKeepAlive() {
131+ }, 10000);
132+ }
133+
134+ + // <electron-mail-mark>
135+ export async function initDownloadSW() {
136+ // wait Service Worker is registered
137+ await navigator.serviceWorker.register(
138+ /* webpackChunkName: "downloadSW" */
139+ - new URL('./downloadSW', import.meta.url),
140+ + new URL('./downloadSW', import.meta.url), // electron-mail-mark
141+ {
142+ scope: `/${stripLeadingAndTrailingSlash(PUBLIC_PATH)}`,
143+ }
144+ @@ -77,6 +80,7 @@ export async function initDownloadSW() {
145+
146+ serviceWorkerKeepAlive();
147+ }
148+ + // </electron-mail-mark>
149+
99150 /**
100151 * Opens download stream into service worker. Use abort signal when pipeTo can't close the download stream.
152+ - -
101153
102154diff --git a/applications/drive/src/app/store/_shares/shareUrl.ts b/applications/drive/src/app/store/_shares/shareUrl.ts
103155index 1b76b8ea81..748ede869b 100644
0 commit comments