Skip to content

Commit 212a77f

Browse files
committed
Handle Demo Mode edge case for "chrome://" URLs
1 parent 723cd81 commit 212a77f

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,18 @@ def open(self, url):
309309
if self.undetectable:
310310
self.__uc_frame_layer = 0
311311
if self.demo_mode:
312-
if not js_utils.is_jquery_activated(self.driver):
313-
js_utils.add_js_link(self.driver, constants.JQuery.MIN_JS)
312+
if (
313+
self.driver.current_url.startswith("http")
314+
or self.driver.current_url.startswith("file")
315+
or self.driver.current_url.startswith("data")
316+
):
317+
if not js_utils.is_jquery_activated(self.driver):
318+
try:
319+
js_utils.add_js_link(
320+
self.driver, constants.JQuery.MIN_JS
321+
)
322+
except Exception:
323+
pass
314324
self.__demo_mode_pause_if_active()
315325

316326
def get(self, url):

0 commit comments

Comments
 (0)