single-file-cli 1.0.16 → 1.0.18

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/README.MD CHANGED
@@ -72,7 +72,7 @@ Alternatively, it can also emulate a browser with JavaScript disabled by using
72
72
 
73
73
  - Download and install globally with `npm`
74
74
 
75
- `npm install -g "gildas-lormeau/single-file-cli"`
75
+ `npm install -g "single-file-cli"`
76
76
 
77
77
  - Download and unzip manually the
78
78
  [master archive](https://github.com/gildas-lormeau/single-file-cli/archive/master.zip)
@@ -21,7 +21,7 @@
21
21
  * Source.
22
22
  */
23
23
 
24
- /* global singlefile, infobar, require, exports */
24
+ /* global singlefile, require, exports */
25
25
 
26
26
  const playwright = require("playwright").chromium;
27
27
  const scripts = require("./common/scripts.js");
@@ -104,10 +104,6 @@ async function getPageData(page, options) {
104
104
  await page.waitForTimeout(options.browserWaitDelay);
105
105
  }
106
106
  return await page.evaluate(async options => {
107
- const pageData = await singlefile.getPageData(options);
108
- if (options.includeInfobar) {
109
- await infobar.includeScript(pageData);
110
- }
111
- return pageData;
107
+ return await singlefile.getPageData(options);
112
108
  }, options);
113
109
  }
@@ -21,7 +21,7 @@
21
21
  * Source.
22
22
  */
23
23
 
24
- /* global singlefile, infobar, require, exports */
24
+ /* global singlefile, require, exports */
25
25
 
26
26
  const playwright = require("playwright").firefox;
27
27
  const scripts = require("./common/scripts.js");
@@ -104,10 +104,6 @@ async function getPageData(page, options) {
104
104
  await page.waitForTimeout(options.browserWaitDelay);
105
105
  }
106
106
  return await page.evaluate(async options => {
107
- const pageData = await singlefile.getPageData(options);
108
- if (options.includeInfobar) {
109
- await infobar.includeScript(pageData);
110
- }
111
- return pageData;
107
+ return await singlefile.getPageData(options);
112
108
  }, options);
113
109
  }
@@ -21,7 +21,7 @@
21
21
  * Source.
22
22
  */
23
23
 
24
- /* global singlefile, infobar, require, exports */
24
+ /* global singlefile, require, exports */
25
25
 
26
26
  const puppeteer = require("puppeteer-core");
27
27
  const scripts = require("./common/scripts.js");
@@ -113,11 +113,7 @@ async function getPageData(browser, page, options) {
113
113
  await page.waitForTimeout(options.browserWaitDelay);
114
114
  }
115
115
  return await page.evaluate(async options => {
116
- const pageData = await singlefile.getPageData(options);
117
- if (options.includeInfobar) {
118
- await infobar.includeScript(pageData);
119
- }
120
- return pageData;
116
+ return await singlefile.getPageData(options);
121
117
  }, options);
122
118
  } catch (error) {
123
119
  if (error.message && error.message.includes(EXECUTION_CONTEXT_DESTROYED_ERROR)) {
@@ -21,7 +21,7 @@
21
21
  * Source.
22
22
  */
23
23
 
24
- /* global singlefile, infobar, require, exports */
24
+ /* global singlefile, require, exports */
25
25
 
26
26
  const puppeteer = require("puppeteer-core");
27
27
  const scripts = require("./common/scripts.js");
@@ -137,11 +137,7 @@ async function getPageData(browser, page, options) {
137
137
  await page.waitForTimeout(options.browserWaitDelay);
138
138
  }
139
139
  return await page.evaluate(async options => {
140
- const pageData = await singlefile.getPageData(options);
141
- if (options.includeInfobar) {
142
- await infobar.includeScript(pageData);
143
- }
144
- return pageData;
140
+ return await singlefile.getPageData(options);
145
141
  }, options);
146
142
  } catch (error) {
147
143
  if (error.message && error.message.includes(EXECUTION_CONTEXT_DESTROYED_ERROR)) {
@@ -158,11 +158,7 @@ function getPageDataScript() {
158
158
  .catch(error => callback({ error: error && error.toString() }));
159
159
 
160
160
  async function getPageData() {
161
- const pageData = await singlefile.getPageData(options);
162
- if (options.includeInfobar) {
163
- await infobar.includeScript(pageData);
164
- }
165
- return pageData;
161
+ return await singlefile.getPageData(options);
166
162
  }
167
163
  `;
168
164
  }
@@ -171,11 +171,7 @@ function getPageDataScript() {
171
171
  .catch(error => callback({ error: error && error.toString() }));
172
172
 
173
173
  async function getPageData() {
174
- const pageData = await window.singlefile.getPageData(options);
175
- if (options.includeInfobar) {
176
- await infobar.includeScript(pageData);
177
- }
178
- return pageData;
174
+ return await window.singlefile.getPageData(options);
179
175
  }
180
176
  `;
181
177
  }