puppeteer/lib
Andrey Lushnikov 6512ce768d
fix(Frame): postpone evaluations until execution context gets created (#1415)
In Blink, frames don't necesserily have execution context all the time.
DevTools Protocol precisely reports this situation, which results in
Puppeteer's frame.executionContext() being null occasionally.

However, from puppeteer point of view every frame will have at least a
default executions context, sooner or later:

- frame's execution context might be created naturally to run frame's
  javascript
- if frame has no javascript, devtools protocol will issue execution
  context creation

This patch builds up on this assumption and makes frame.executionContext()
to be a promise.
As a result, all the evaluations await for the execution context to be created first.

Fixes #827, #1325

BREAKING CHANGE: this patch changes frame.executionContext() method to return a promise.
To migrate onto a new behavior, await the context first before using it.
2017-11-18 16:27:52 -08:00
..
.eslintrc.js Introduce Eslint to validate style 2017-06-11 01:32:59 -07:00
Browser.js chore(Browser): fix jsdoc in Browser.create method (#1403) 2017-11-16 16:28:52 -08:00
Connection.js feat(browser): add browser.disconnected event (#960) 2017-11-03 18:46:17 -07:00
Dialog.js chore: Use Typescript to lint JSDoc annotations (#986) 2017-10-09 22:31:40 -07:00
ElementHandle.js fix(ElementHandle.screenshot): account for scroll (#1323) 2017-11-10 16:02:52 -08:00
EmulationManager.js chore: Use Typescript to lint JSDoc annotations (#986) 2017-10-09 22:31:40 -07:00
ExecutionContext.js fix(Frame): postpone evaluations until execution context gets created (#1415) 2017-11-18 16:27:52 -08:00
externs.d.ts chore: Use Typescript to lint JSDoc annotations (#986) 2017-10-09 22:31:40 -07:00
FrameManager.js fix(Frame): postpone evaluations until execution context gets created (#1415) 2017-11-18 16:27:52 -08:00
helper.js fix: Remove synchronous operation with file system. (#879) 2017-10-11 00:55:48 -07:00
Input.js fix(touch): requestAnimationFrame before sending tap (#1142) 2017-10-26 14:53:50 -07:00
Launcher.js fix(Launcher): handle SIGHUP signal (#1405) 2017-11-16 19:28:32 -08:00
Multimap.js chore: Use Typescript to lint JSDoc annotations (#986) 2017-10-09 22:31:40 -07:00
NavigatorWatcher.js fix(Navigation): wait for lifecycle events for the frame subtree (#1356) 2017-11-10 15:44:14 -08:00
NetworkManager.js fix: support PlzNavigate in puppeteer. (#1239) 2017-11-01 14:04:10 -07:00
Page.js fix(Frame): postpone evaluations until execution context gets created (#1415) 2017-11-18 16:27:52 -08:00
Puppeteer.js chore: Use Typescript to lint JSDoc annotations (#986) 2017-10-09 22:31:40 -07:00
Tracing.js fix: Remove synchronous operation with file system. (#879) 2017-10-11 00:55:48 -07:00
USKeyboardLayout.js feat(keyboard): Accept codes (#1116) 2017-10-23 12:43:45 -07:00