Skip to content

Commit 04c1d16

Browse files
committed
chore(config): add navigator webgpu handling
1 parent 9fceee6 commit 04c1d16

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

docker/Dockerfile.headless_shell_playwright

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,6 @@ ENV LAUNCH=init
7171
ENV DEFAULT_PORT=9223
7272
ENV DEFAULT_PORT_SERVER=6000
7373
ENV DEFAULT_LAUNCH_NAME=/out/latest/headless-shell/headless-shell
74+
# ENV HOSTNAME_OVERRIDE=127.0.0.1
7475

7576
ENTRYPOINT ["tini", "--", "/docker-entrypoint.sh"]

headless_browser_lib/src/conf.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::sync::atomic::{AtomicBool, AtomicU64};
22

33
/// The performance arg count.
4-
pub(crate) const PERF_ARGS: usize = 91;
4+
pub(crate) const PERF_ARGS: usize = 94;
55

66
lazy_static::lazy_static! {
77
/// The chrome args to use test ( basic without anything used for testing ).
@@ -150,6 +150,9 @@ lazy_static::lazy_static! {
150150
gpu_enabled,
151151
gpu_enabled_sandboxed,
152152
"--enable-webgl",
153+
"--enable-webgl2-compute-context",
154+
"--enable-webgl-draft-extensions",
155+
"--enable-unsafe-webgpu",
153156
// use_gl,
154157
// "--use-angle=swiftshader",
155158
"--no-first-run",
@@ -186,7 +189,6 @@ lazy_static::lazy_static! {
186189
"--disable-background-timer-throttling",
187190
"--disable-breakpad",
188191
"--disable-crash-reporter",
189-
"--disable-software-rasterizer",
190192
"--disable-asynchronous-spellchecking",
191193
"--disable-html5-camera",
192194
"--noerrdialogs",
@@ -240,7 +242,12 @@ lazy_static::lazy_static! {
240242
"--disable-ipc-flooding-protection", // we do not need to throttle navigation for https://github.com/spider-rs/spider/commit/9ff5bbd7a2656b8edb84b62843b72ae9d09af079#diff-75ce697faf0d37c3dff4a3a19e7524798b3cb5487f8f54beb5d04c4d48e34234R446.
241243
// --deterministic-mode 10-20% drop in perf
242244
// "--blink-settings=primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4",
243-
"--disable-features=PaintHolding,HttpsUpgrades,DeferRendererTasksAfterInput,LensOverlay,ThirdPartyStoragePartitioning,IsolateSandboxedIframes,ProcessPerSiteUpToMainFrameThreshold,site-per-process,WebUIJSErrorReportingExtended,DIPS,InterestFeedContentSuggestions,PrivacySandboxSettings4,AutofillServerCommunication,CalculateNativeWinOcclusion,OptimizationHints,AudioServiceOutOfProcess,IsolateOrigins,ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync,Translate"
245+
"--disable-features=PaintHolding,HttpsUpgrades,DeferRendererTasksAfterInput,LensOverlay,ThirdPartyStoragePartitioning,IsolateSandboxedIframes,ProcessPerSiteUpToMainFrameThreshold,site-per-process,WebUIJSErrorReportingExtended,DIPS,InterestFeedContentSuggestions,PrivacySandboxSettings4,AutofillServerCommunication,CalculateNativeWinOcclusion,OptimizationHints,AudioServiceOutOfProcess,IsolateOrigins,ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync,Translate",
246+
if !gpu {
247+
"--enable-unsafe-swiftshader"
248+
} else {
249+
""
250+
}
244251
]
245252
};
246253

0 commit comments

Comments
 (0)