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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@single-file/single-file-cli",
3
- "version": "2.0.40",
3
+ "version": "2.0.42",
4
4
  "description": "SingleFile CLI",
5
5
  "nodeModulesDir": true,
6
6
  "exports": {
package/lib/browser.js CHANGED
@@ -117,7 +117,11 @@ async function closeBrowser() {
117
117
  child = undefined;
118
118
  }
119
119
  if (profilePath !== undefined) {
120
- await remove(profilePath, { recursive: true });
121
- profilePath = undefined;
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 options = {
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
- options.acceptLanguage = options.acceptLanguage;
99
+ agentOptions.acceptLanguage = options.acceptLanguage;
100
100
  }
101
101
  if (options.platform || options.browserMobileEmulation) {
102
- options.platform = options.platform || "Android";
102
+ agentOptions.platform = options.platform || "Android";
103
103
  }
104
- await Emulation.setUserAgentOverride(options);
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.40";
1
+ export const version = "2.0.42";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "single-file-cli",
3
- "version": "2.0.40",
3
+ "version": "2.0.42",
4
4
  "description": "SingleFile CLI",
5
5
  "author": "Gildas Lormeau",
6
6
  "engines": {