single-file-cli 1.0.63 → 1.0.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* Source.
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
-
/* global require, exports,
|
|
24
|
+
/* global require, exports, setTimeout, clearTimeout, Buffer */
|
|
25
25
|
|
|
26
26
|
const chrome = require("selenium-webdriver/chrome");
|
|
27
27
|
const { Builder, Capabilities } = require("selenium-webdriver");
|
|
@@ -32,6 +32,9 @@ exports.getPageData = async options => {
|
|
|
32
32
|
let driver;
|
|
33
33
|
try {
|
|
34
34
|
const builder = new Builder();
|
|
35
|
+
if (options.webDriverExecutablePath) {
|
|
36
|
+
builder.setChromeService(new chrome.ServiceBuilder(options.webDriverExecutablePath));
|
|
37
|
+
}
|
|
35
38
|
builder.setChromeOptions(getBrowserOptions(options));
|
|
36
39
|
setBuilderCapabilities(builder, options);
|
|
37
40
|
driver = builder.forBrowser("chrome").build();
|
|
@@ -62,9 +65,6 @@ function getBrowserOptions(options) {
|
|
|
62
65
|
if (options.browserExecutablePath) {
|
|
63
66
|
chromeOptions.setChromeBinaryPath(options.browserExecutablePath);
|
|
64
67
|
}
|
|
65
|
-
if (options.webDriverExecutablePath) {
|
|
66
|
-
process.env["PATH"] += ";" + options.webDriverExecutablePath.replace(/chromedriver(\.exe)?$/, "");
|
|
67
|
-
}
|
|
68
68
|
if (options.browserArgs) {
|
|
69
69
|
const args = JSON.parse(options.browserArgs);
|
|
70
70
|
args.forEach(argument => chromeOptions.addArguments(argument));
|
|
@@ -32,6 +32,9 @@ exports.getPageData = async options => {
|
|
|
32
32
|
let driver;
|
|
33
33
|
try {
|
|
34
34
|
const builder = new Builder().withCapabilities({ "pageLoadStrategy": "none" });
|
|
35
|
+
if (options.webDriverExecutablePath) {
|
|
36
|
+
builder.setFirefoxService(new firefox.ServiceBuilder(options.webDriverExecutablePath));
|
|
37
|
+
}
|
|
35
38
|
builder.setFirefoxOptions(getBrowserOptions(options));
|
|
36
39
|
setBuilderCapabilities(builder, options);
|
|
37
40
|
driver = builder.forBrowser("firefox").build();
|
|
@@ -61,9 +64,6 @@ function getBrowserOptions(options) {
|
|
|
61
64
|
if (options.browserExecutablePath) {
|
|
62
65
|
firefoxOptions.setBinary(options.browserExecutablePath);
|
|
63
66
|
}
|
|
64
|
-
if (options.webDriverExecutablePath) {
|
|
65
|
-
process.env["PATH"] += ";" + options.webDriverExecutablePath.replace(/geckodriver(\.exe)?$/, "");
|
|
66
|
-
}
|
|
67
67
|
const extensions = [];
|
|
68
68
|
if (options.browserDisableWebSecurity === undefined || options.browserDisableWebSecurity) {
|
|
69
69
|
extensions.push(require.resolve("./extensions/signed/disable_web_security-0.0.3-an+fx.xpi"));
|