chrome_driver.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. const config_1 = require("../config");
  4. const binary_1 = require("./binary");
  5. const chrome_xml_1 = require("./chrome_xml");
  6. class ChromeDriver extends binary_1.Binary {
  7. constructor(opt_alternativeCdn) {
  8. super(opt_alternativeCdn || config_1.Config.cdnUrls().chrome);
  9. this.configSource = new chrome_xml_1.ChromeXml();
  10. this.name = 'chromedriver';
  11. this.versionDefault = ChromeDriver.versionDefault;
  12. this.versionCustom = this.versionDefault;
  13. }
  14. id() {
  15. return ChromeDriver.id;
  16. }
  17. prefix() {
  18. return 'chromedriver_';
  19. }
  20. suffix() {
  21. return '.zip';
  22. }
  23. getVersionList() {
  24. // If an alternative cdn is set, return an empty list.
  25. if (this.alternativeDownloadUrl != null) {
  26. Promise.resolve([]);
  27. }
  28. else {
  29. return this.configSource.getVersionList();
  30. }
  31. }
  32. }
  33. ChromeDriver.id = 'chrome';
  34. ChromeDriver.isDefault = true;
  35. ChromeDriver.os = [binary_1.OS.Windows_NT, binary_1.OS.Linux, binary_1.OS.Darwin];
  36. ChromeDriver.versionDefault = config_1.Config.binaryVersions().chrome;
  37. exports.ChromeDriver = ChromeDriver;
  38. //# sourceMappingURL=chrome_driver.js.map