MCPcopy Index your code
hub / github.com/SeleniumHQ/selenium / geckodriver

Function geckodriver

scripts/pinned_browsers.py:394–447  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

392
393
394def geckodriver():
395 content = ""
396
397 r = http.request("GET", "https://api.github.com/repos/mozilla/geckodriver/releases/latest")
398 for a in json.loads(r.data)["assets"]:
399 if a["name"].endswith("-linux64.tar.gz"):
400 url = a["browser_download_url"]
401 sha = calculate_hash(url)
402 content = (
403 content
404 + f""" http_archive(
405 name = "linux_geckodriver",
406 url = "{url}",
407 sha256 = "{sha}",
408 build_file_content = \"\"\"
409load("@aspect_rules_js//js:defs.bzl", "js_library")
410package(default_visibility = ["//visibility:public"])
411
412exports_files(["geckodriver"])
413
414js_library(
415 name = "geckodriver-js",
416 data = ["geckodriver"],
417)
418\"\"\",
419 )
420"""
421 )
422
423 if a["name"].endswith("-macos-aarch64.tar.gz"):
424 url = a["browser_download_url"]
425 sha = calculate_hash(url)
426 content = (
427 content
428 + f"""
429 http_archive(
430 name = "mac_geckodriver",
431 url = "{url}",
432 sha256 = "{sha}",
433 build_file_content = \"\"\"
434load("@aspect_rules_js//js:defs.bzl", "js_library")
435package(default_visibility = ["//visibility:public"])
436
437exports_files(["geckodriver"])
438
439js_library(
440 name = "geckodriver-js",
441 data = ["geckodriver"],
442)
443\"\"\",
444 )
445"""
446 )
447 return content
448
449
450def firefox():

Callers 1

pinned_browsers.pyFile · 0.85

Calls 2

calculate_hashFunction · 0.85
requestMethod · 0.45

Tested by

no test coverage detected