single-file-cli 2.0.40 → 2.0.42
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.
- package/deno.json +1 -1
- package/lib/browser.js +6 -2
- package/lib/cdp-client.js +5 -5
- package/lib/version.js +1 -1
- package/package.json +1 -1
package/deno.json
CHANGED
package/lib/browser.js
CHANGED
|
@@ -117,7 +117,11 @@ async function closeBrowser() {
|
|
|
117
117
|
child = undefined;
|
|
118
118
|
}
|
|
119
119
|
if (profilePath !== undefined) {
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
try {
|
|
121
|
+
await remove(profilePath, { recursive: true });
|
|
122
|
+
profilePath = undefined;
|
|
123
|
+
} catch (error) {
|
|
124
|
+
console.log("Warning: failed to remove profile directory: " + profilePath); // eslint-disable-line no-console
|
|
125
|
+
}
|
|
122
126
|
}
|
|
123
127
|
}
|
package/lib/cdp-client.js
CHANGED
|
@@ -92,16 +92,16 @@ async function getPageData(options) {
|
|
|
92
92
|
if (!options.userAgent) {
|
|
93
93
|
({ browserUserAgent } = await Browser.getVersion());
|
|
94
94
|
}
|
|
95
|
-
const
|
|
95
|
+
const agentOptions = {
|
|
96
96
|
userAgent: options.userAgent || (options.browserMobileEmulation ? "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome Mobile Safari/537.36" : browserUserAgent)
|
|
97
97
|
};
|
|
98
98
|
if (options.acceptLanguage) {
|
|
99
|
-
|
|
99
|
+
agentOptions.acceptLanguage = options.acceptLanguage;
|
|
100
100
|
}
|
|
101
101
|
if (options.platform || options.browserMobileEmulation) {
|
|
102
|
-
|
|
102
|
+
agentOptions.platform = options.platform || "Android";
|
|
103
103
|
}
|
|
104
|
-
await Emulation.setUserAgentOverride(
|
|
104
|
+
await Emulation.setUserAgentOverride(agentOptions);
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
if (options.httpProxyUsername) {
|
|
@@ -397,4 +397,4 @@ function getBrowserOptions(options) {
|
|
|
397
397
|
browserOptions.userAgent = options.userAgent;
|
|
398
398
|
browserOptions.httpProxyServer = options.httpProxyServer;
|
|
399
399
|
return browserOptions;
|
|
400
|
-
}
|
|
400
|
+
}
|
package/lib/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = "2.0.
|
|
1
|
+
export const version = "2.0.42";
|