single-file-cli 2.0.16 → 2.0.17
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/cdp-client.js +11 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- /package/{build-lib.sh → build.sh} +0 -0
- /package/{build-dev-lib.sh → dev-build.sh} +0 -0
package/deno.json
CHANGED
package/lib/cdp-client.js
CHANGED
|
@@ -128,8 +128,10 @@ async function getPageData(options) {
|
|
|
128
128
|
const pageNavigated = Page.navigate({ url: options.url });
|
|
129
129
|
const pageReady = new Promise(resolve => {
|
|
130
130
|
const LIFE_CYCLE_EVENT = "lifecycleEvent";
|
|
131
|
+
const FRAME_NAVIGATED_EVENT = "frameNavigated";
|
|
131
132
|
let contentLoaded;
|
|
132
133
|
Page.addEventListener(LIFE_CYCLE_EVENT, onLifecycleEvent);
|
|
134
|
+
Page.addEventListener(FRAME_NAVIGATED_EVENT, onFrameNavigated);
|
|
133
135
|
|
|
134
136
|
async function onLifecycleEvent({ params }) {
|
|
135
137
|
const { name, frameId } = params;
|
|
@@ -142,6 +144,7 @@ async function getPageData(options) {
|
|
|
142
144
|
setTimeout(() => resolve, options.browserWaitDelay);
|
|
143
145
|
} else {
|
|
144
146
|
Page.removeEventListener(LIFE_CYCLE_EVENT, onLifecycleEvent);
|
|
147
|
+
Page.removeEventListener(FRAME_NAVIGATED_EVENT, onFrameNavigated);
|
|
145
148
|
await Page.setLifecycleEventsEnabled({ enabled: false });
|
|
146
149
|
await Page.disable();
|
|
147
150
|
resolve();
|
|
@@ -149,6 +152,13 @@ async function getPageData(options) {
|
|
|
149
152
|
}
|
|
150
153
|
}
|
|
151
154
|
}
|
|
155
|
+
|
|
156
|
+
async function onFrameNavigated({ params }) {
|
|
157
|
+
const { frame } = params;
|
|
158
|
+
if (!frame.parentId) {
|
|
159
|
+
contextId = undefined;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
152
162
|
});
|
|
153
163
|
let timeoutReady, timeoutId, resolveTimeoutReady;
|
|
154
164
|
if (options.browserLoadMaxTime) {
|
|
@@ -182,7 +192,7 @@ async function getPageData(options) {
|
|
|
182
192
|
|
|
183
193
|
async function executionContextCreated({ params }) {
|
|
184
194
|
const { context } = params;
|
|
185
|
-
if (context.name === SINGLE_FILE_WORLD_NAME && context.auxData && context.auxData.frameId === topFrameId) {
|
|
195
|
+
if (contextId === undefined && context.name === SINGLE_FILE_WORLD_NAME && context.auxData && context.auxData.frameId === topFrameId) {
|
|
186
196
|
contextId = context.id;
|
|
187
197
|
}
|
|
188
198
|
}
|
package/lib/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = "2.0.
|
|
1
|
+
export const version = "2.0.17";
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|