MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / chromedriver

Function chromedriver

scripts/pinned_browsers.py:55–109  ·  view source on GitHub ↗
(selected_version, workspace_prefix="")

Source from the content-addressed store, hash-verified

53
54
55def chromedriver(selected_version, workspace_prefix=""):
56 content = ""
57
58 drivers = selected_version["downloads"]["chromedriver"]
59
60 url = next((d["url"] for d in drivers if d["platform"] == "linux64"), None)
61 if url is None:
62 raise ValueError("No chromedriver download found for platform 'linux64'")
63 sha = calculate_hash(url)
64
65 content += f""" http_archive(
66 name = "linux_{workspace_prefix}chromedriver",
67 url = "{url}",
68 sha256 = "{sha}",
69 strip_prefix = "chromedriver-linux64",
70 build_file_content = \"\"\"
71load("@aspect_rules_js//js:defs.bzl", "js_library")
72package(default_visibility = ["//visibility:public"])
73
74exports_files(["chromedriver"])
75
76js_library(
77 name = "chromedriver-js",
78 data = ["chromedriver"],
79)
80\"\"\",
81 )
82"""
83
84 url = next((d["url"] for d in drivers if d["platform"] == "mac-arm64"), None)
85 if url is None:
86 raise ValueError("No chromedriver download found for platform 'mac-arm64'")
87 sha = calculate_hash(url)
88
89 content += f"""
90 http_archive(
91 name = "mac_{workspace_prefix}chromedriver",
92 url = "{url}",
93 sha256 = "{sha}",
94 strip_prefix = "chromedriver-mac-arm64",
95 build_file_content = \"\"\"
96load("@aspect_rules_js//js:defs.bzl", "js_library")
97package(default_visibility = ["//visibility:public"])
98
99exports_files(["chromedriver"])
100
101js_library(
102 name = "chromedriver-js",
103 data = ["chromedriver"],
104)
105\"\"\",
106 )
107"""
108
109 return content
110
111
112def chrome(selected_version, workspace_prefix=""):

Callers 1

pinned_browsers.pyFile · 0.85

Calls 1

calculate_hashFunction · 0.85

Tested by

no test coverage detected