HelloSun commited on
Commit
774151c
·
verified ·
1 Parent(s): 9ab43a0

Remove temporary browser-test dependency loader.js

Browse files
node_modules/playwright-core/lib/server/electron/loader.js DELETED
@@ -1,120 +0,0 @@
1
- "use strict";
2
-
3
- // packages/playwright-core/src/server/electron/loader.ts
4
- var import_electron = require("electron");
5
-
6
- // packages/playwright-core/src/server/chromium/chromiumSwitches.ts
7
- var disabledFeatures = [
8
- // See https://github.com/microsoft/playwright/issues/14047
9
- "AvoidUnnecessaryBeforeUnloadCheckSync",
10
- "DestroyProfileOnBrowserClose",
11
- // See https://github.com/microsoft/playwright/pull/13854
12
- "DialMediaRouteProvider",
13
- "GlobalMediaControls",
14
- // See https://github.com/microsoft/playwright/pull/27605
15
- "HttpsUpgrades",
16
- // Hides the Lens feature in the URL address bar. Its not working in unofficial builds.
17
- "LensOverlay",
18
- // See https://github.com/microsoft/playwright/pull/8162
19
- "MediaRouter",
20
- // See https://github.com/microsoft/playwright/issues/28023
21
- "PaintHolding",
22
- // See https://github.com/microsoft/playwright/issues/32230
23
- "ThirdPartyStoragePartitioning",
24
- // Chromium 149 rejects re-applying the `origin` header on a redirect (as request interception
25
- // does) with net::ERR_INVALID_ARGUMENT. See https://github.com/microsoft/playwright/issues/41690
26
- "BlockOriginHeaderModificationOnRedirect",
27
- // See https://github.com/microsoft/playwright/issues/16126
28
- "Translate",
29
- // See https://issues.chromium.org/u/1/issues/435410220
30
- "AutoDeElevate",
31
- // Prevents downloading optimization hints on startup.
32
- "OptimizationHints",
33
- // Prevents network time queries to clients2.google.com on startup.
34
- "NetworkTimeServiceQuerying",
35
- // Prevents AI Mode eligibility requests to www.google.com on startup.
36
- "AimEnabled",
37
- // Disables forced sign-in in Edge.
38
- "msForceBrowserSignIn",
39
- // Disables updating the preferred version in LaunchServices preferences on mac.
40
- "msEdgeUpdateLaunchServicesPreferredVersion"
41
- ].filter(Boolean);
42
- var chromiumSwitches = (options) => [
43
- "--disable-field-trial-config",
44
- // https://source.chromium.org/chromium/chromium/src/+/main:testing/variations/README.md
45
- "--disable-background-networking",
46
- "--disable-background-timer-throttling",
47
- "--disable-backgrounding-occluded-windows",
48
- "--disable-back-forward-cache",
49
- // Avoids surprises like main request not being intercepted during page.goBack().
50
- "--disable-breakpad",
51
- "--disable-client-side-phishing-detection",
52
- "--disable-component-extensions-with-background-pages",
53
- "--disable-component-update",
54
- // Avoids unneeded network activity after startup.
55
- "--no-default-browser-check",
56
- "--disable-default-apps",
57
- "--disable-dev-shm-usage",
58
- "--disable-edgeupdater",
59
- // Disables Edge-specific updater on mac.
60
- "--disable-extensions",
61
- "--disable-features=" + disabledFeatures.join(","),
62
- process.env.PLAYWRIGHT_LEGACY_SCREENSHOT ? "" : "--enable-features=CDPScreenshotNewSurface",
63
- "--allow-pre-commit-input",
64
- "--disable-hang-monitor",
65
- "--disable-ipc-flooding-protection",
66
- "--disable-popup-blocking",
67
- "--disable-prompt-on-repost",
68
- "--disable-renderer-backgrounding",
69
- "--disable-updater-scheduler",
70
- // Prevents Edge-specific updater from being launched when Edge is launched on mac.
71
- "--force-color-profile=srgb",
72
- "--metrics-recording-only",
73
- "--no-first-run",
74
- "--password-store=basic",
75
- "--use-mock-keychain",
76
- // See https://chromium-review.googlesource.com/c/chromium/src/+/2436773
77
- "--no-service-autorun",
78
- "--export-tagged-pdf",
79
- // https://chromium-review.googlesource.com/c/chromium/src/+/4853540
80
- "--disable-search-engine-choice-screen",
81
- // https://issues.chromium.org/41491762
82
- "--unsafely-disable-devtools-self-xss-warnings",
83
- // Edge can potentially restart on Windows (msRelaunchNoCompatLayer) which looses its file descriptors (stdout/stderr) and CDP (3/4). Disable until fixed upstream.
84
- "--edge-skip-compat-layer-relaunch",
85
- // This disables Chrome for Testing infobar that is visible in the persistent context.
86
- // The switch is ignored everywhere else, including Chromium/Chrome/Edge.
87
- "--disable-infobars",
88
- // Less annoying popups.
89
- "--disable-search-engine-choice-screen",
90
- // Prevents the "three dots" menu crash in IdentityManager::HasPrimaryAccount for ephemeral contexts.
91
- options?.android ? "" : "--disable-sync"
92
- ].filter(Boolean);
93
-
94
- // packages/playwright-core/src/server/electron/loader.ts
95
- process.argv.splice(1, process.argv.indexOf("--remote-debugging-port=0"));
96
- for (const arg of chromiumSwitches()) {
97
- const match = arg.match(/--([^=]*)=?(.*)/);
98
- import_electron.app.commandLine.appendSwitch(match[1], match[2]);
99
- }
100
- var originalWhenReady = import_electron.app.whenReady();
101
- var originalEmit = import_electron.app.emit.bind(import_electron.app);
102
- var readyEventArgs;
103
- import_electron.app.emit = (event, ...args) => {
104
- if (event === "ready") {
105
- readyEventArgs = args;
106
- return import_electron.app.listenerCount("ready") > 0;
107
- }
108
- return originalEmit(event, ...args);
109
- };
110
- var isReady = false;
111
- var whenReadyCallback;
112
- var whenReadyPromise = new Promise((f) => whenReadyCallback = f);
113
- import_electron.app.isReady = () => isReady;
114
- import_electron.app.whenReady = () => whenReadyPromise;
115
- globalThis.__playwright_run = async () => {
116
- const event = await originalWhenReady;
117
- isReady = true;
118
- whenReadyCallback(event);
119
- originalEmit("ready", ...readyEventArgs);
120
- };