gecko_driver.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. const config_1 = require("../config");
  4. const binary_1 = require("./binary");
  5. const gecko_driver_github_1 = require("./gecko_driver_github");
  6. class GeckoDriver extends binary_1.Binary {
  7. constructor(opt_alternativeCdn) {
  8. super(opt_alternativeCdn || config_1.Config.cdnUrls().gecko);
  9. this.configSource = new gecko_driver_github_1.GeckoDriverGithub();
  10. this.name = 'geckodriver';
  11. this.versionDefault = GeckoDriver.versionDefault;
  12. this.versionCustom = this.versionDefault;
  13. }
  14. id() {
  15. return GeckoDriver.id;
  16. }
  17. prefix() {
  18. return 'geckodriver-';
  19. }
  20. suffix() {
  21. if (this.ostype === 'Windows_NT') {
  22. return '.zip';
  23. }
  24. else {
  25. return '.tar.gz';
  26. }
  27. }
  28. getVersionList() {
  29. if (this.alternativeDownloadUrl != null) {
  30. return Promise.resolve([]);
  31. }
  32. else {
  33. return this.configSource.getVersionList();
  34. }
  35. }
  36. }
  37. GeckoDriver.id = 'gecko';
  38. GeckoDriver.isDefault = true;
  39. GeckoDriver.os = [binary_1.OS.Windows_NT, binary_1.OS.Linux, binary_1.OS.Darwin];
  40. GeckoDriver.versionDefault = config_1.Config.binaryVersions().gecko;
  41. GeckoDriver.suffixes = {
  42. 'Darwin': { 'x64': '-macos.tar.gz' },
  43. 'Linux': { 'x64': '-linux64.tar.gz', 'ia32': '-linux32.tar.gz' },
  44. 'Windows_NT': {
  45. 'x64': '-win64.zip',
  46. 'ia32': '-win32.zip',
  47. }
  48. };
  49. exports.GeckoDriver = GeckoDriver;
  50. //# sourceMappingURL=gecko_driver.js.map