Skip to content
This repository was archived by the owner on Apr 17, 2026. It is now read-only.
This repository was archived by the owner on Apr 17, 2026. It is now read-only.

Use other webdriver's cdn url config ? #300

Closed

Description

@abcfy2

I want to use webdriver-manager update for updating all drivers, so --alternate_cdn is not enough. Maybe we can reuse other webdrivers' cdn url?

For example, chromedriver use chromedriver_cdnurl, see: https://www.npmjs.com/package/chromedriver#custom-binaries-url

And here is some other driver cdn url config:

npm set chromedriver_cdnurl http://cdn.npm.taobao.org/dist/chromedriver
npm set operadriver_cdnurl http://cdn.npm.taobao.org/dist/operadriver
npm set phantomjs_cdnurl http://cdn.npm.taobao.org/dist/phantomjs
npm set geckodriver_cdnurl https://github.com/mozilla/geckodriver/releases/download

Could you please reuse these config?

Activity

  1. bksantiago commented on Feb 20, 2018

    @bksantiago

    Most libraries that downloads external binary files(i.e. node sass, phantomjs, etc) already have this behavior, so I assume there should be no issue/conflict to not implement this.

  2. abcfy2 commented on Feb 20, 2018

    @abcfy2
    Author

    I mean that webdriver-manager update use its own download url config for all webdrivers. I wish I can set every webdriver cdn url. So I think reuse other webdrivers config is a good idea.

  3. cnishina commented on Mar 8, 2018

    @cnishina
    Contributor

    Wow this is neat. Okay for reference... we should look into https://docs.npmjs.com/cli/config ?

    This could be a great PR for someone...if anyone has free cycles.

  4. elgohr commented on Mar 9, 2018

    @elgohr

    From #294

    Webdriver-manager could then parse this file and you could then download the right file.

    Why don't we skip this, when the direct URL is provided?

  5. jhuesos commented on Apr 17, 2018

    @jhuesos

    This would be great. At this moment there does not seem to be a way to override default location of binaries. This is a huge problem in very restrictive corporate environments and we need to host the binaries ourselves inside our corporate network.

  6. bksantiago commented on Apr 18, 2018

    @bksantiago

    @jhuesos what we did is we host our own webdriver servers where we copy most of what we need. Works like a charm.

  7. stieler-it commented on Apr 19, 2018

    @stieler-it

    @bksantiago but how do you tell webdriver manager to use you own server instead of the public one?

  8. bksantiago commented on May 18, 2018

    @bksantiago

    @stieler-it we've copied the contents of https://chromedriver.storage.googleapis.com/ and download a couple of our drivers on our internal server, At first, we manually change the value of the url in node_modules/webdriver-manager/built/config.json but then eventually we just created a script to automate it.

    Found the solution here: https://stackoverflow.com/a/47082925/1947652

  9. Jahmilli commented on Aug 21, 2018

    @Jahmilli

    Hey @cnishina is there any plans to keep working on this issue or are you intending on replacing it with webdriver-manager-replacement?
    I think something useful for this would be allowing for an alternate config.json file to be passed in as well as a parameter that allows users to download specific zip files rather than parsing an xml file.
    Just wondering if this is something that would be worthwhile investing time into or will this be replaced soon anyway?

  10. cnishina commented on Aug 22, 2018

    @cnishina
    Contributor

    Sssssh, that's super secret squirrel. But in seriousness... what is the motivation to set a download url / alternative cdn?

    Webdriver-manager currently downloads a list and parses out the latest version to download. For ChromeDriver, IEDriverServer, and Selenium these are xml files. For GeckoDriver, it downloads a json file then downloads a tar or zip file. To parse out these files, the format is pretty specific. This means someone would have to replicate this file and store the files in the locations specified by the path.

    If we are downloading very specific files from a known location, an alternative could be a script file with wget or curl commands to download the files, uncompress them and set the chmod as an executable (for MacOS or Linux).

    This to me, side steps the benefit of webdriver-manager.

  11. Jahmilli commented on Aug 22, 2018

    @Jahmilli

    @cnishina Woops.... i'll keep my eye on it though!
    The problem i'm facing is hitting the Github Rate Limit on automated tests. I wanted to be able to download these driver files and store them in my own CDN and either use similar XML files which I could then choose my own version of each driver respectively through the alternate config file. Or I pass in a specific download URL in the alternate config file and set a flag that would tell Webriver-Manager to not try and parse the file at the endpoint and instead just download it.

    It is a fairly specific problem but I think could help with users that don't want to have to go onto the web to download these files and instead are developing their own workarounds for this. Let me know what you think anyway, i'd like to hear your thoughts on this when you have time.

    The error is:
    I/config_source - curl -o/agent/work/72933b26e7519aac/node_modules/protractor/node_modules/webdriver-manager/selenium/gecko-response.json https://api.github.com/repos/mozilla/geckodriver/releases[15:02:54][Step 2/3] (node:6773) UnhandledPromiseRejectionWarning: Error: Failed to make Github request, rate limit reached.

  12. cnishina commented on Aug 22, 2018

    @cnishina
    Contributor

    Try out the new package. I have some feature parity for browser support...

    The GitHub token can be added via command line (see cnishina/webdriver-manager-replacement#66) or via environment variable (see https://github.com/cnishina/webdriver-manager-replacement/blob/master/docs/env_vars.md).

    If you run into any issues, write it in my repo. If you are a Protractor test that uses directConnect or Protractor launches the selenium server for you, this will not work (for now). If you are using webdriver-manager start with the new repo, it should be fine.

  13. CSchulz commented on Oct 2, 2018

    @CSchulz

    Another reason why to use own cdn mirrors is a restrictive corporate proxy setup.

  14. CSchulz commented on Oct 4, 2018

    @CSchulz

    My workaround for the moment is to save the config source files in my project and copy them to the node_modules folder. We have setup a mirror for the chrome driver repo itself and download it before the webdriver-manager is called, because the alternate_cdn is ignored finally #325 .

  15. pezetko commented on Nov 7, 2018

    @pezetko

    Would it be possible to set alternate_cdn (or possibly set of other variables specific to each CDN) via .npmrc or some environment variable?
    I'm asking because we're behind corporate proxy and webdriver-manager is downloaded as protractor dependency, which is downloaded by another 3rd party code that we do not have a possibility to modify / override, so it gets very frustrating to tell webdriver-manager to use our own CDN sources rather then the public ones.
    I think if you would be able to define overriding variables for base CDN URLs via .npmrc, that would be amazing.

  16. cnishina commented on Apr 11, 2019

    @cnishina
    Contributor

    Okay after discussion with the team offline, this is not something we will support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions