@@ -68,7 +68,7 @@ protected function configureDownloadPath($browser, $path)
6868 public static function prepare ()
6969 {
7070 if (!static ::runningInSail ()) {
71- static ::startChromeDriver ();
71+ static ::startChromeDriver ([ ' --port=9515 ' ] );
7272 }
7373 }
7474
@@ -94,41 +94,19 @@ protected function driver()
9494 {
9595 $ options = (new ChromeOptions )->addArguments (collect ([
9696 $ this ->shouldStartMaximized () ? '--start-maximized ' : '--window-size=1920,1080 ' ,
97- '--force-color-profile=srgb ' ,
98- '--force-device-scale-factor=2 ' ,
97+ '--disable-search-engine-choice-screen ' ,
9998 ])->unless ($ this ->hasHeadlessDisabled (), function ($ items ) {
10099 return $ items ->merge ([
101100 '--disable-gpu ' ,
102- '--headless ' ,
101+ '--headless=new ' ,
103102 ]);
104103 })->all ());
105104
106105 return RemoteWebDriver::create (
107106 $ _ENV ['DUSK_DRIVER_URL ' ] ?? 'http://localhost:9515 ' ,
108107 DesiredCapabilities::chrome ()->setCapability (
109- ChromeOptions::CAPABILITY ,
110- $ options
111- )
108+ ChromeOptions::CAPABILITY , $ options
109+ )->setCapability ('goog:loggingPrefs ' , ['browser ' => 'ALL ' ])
112110 );
113111 }
114-
115- /**
116- * Determine whether the Dusk command has disabled headless mode.
117- *
118- * @return bool
119- */
120- protected function hasHeadlessDisabled ()
121- {
122- return isset ($ _SERVER ['DUSK_HEADLESS_DISABLED ' ]) || isset ($ _ENV ['DUSK_HEADLESS_DISABLED ' ]);
123- }
124-
125- /**
126- * Determine if the browser window should start maximized.
127- *
128- * @return bool
129- */
130- protected function shouldStartMaximized ()
131- {
132- return isset ($ _SERVER ['DUSK_START_MAXIMIZED ' ]) || isset ($ _ENV ['DUSK_START_MAXIMIZED ' ]);
133- }
134112}
0 commit comments