Remove Frame.isMainFrame()

This patch removes redundant frame.isMainFrame() method. The suggested
way to check for main frame is:

```js
frame === page.mainFrame()
```

Fixes #120.
This commit is contained in:
Andrey Lushnikov
2017-07-24 21:25:54 -07:00
parent 91cbe561ba
commit 236acec228
2 changed files with 1 additions and 14 deletions

View File

@@ -162,7 +162,7 @@ class FrameManager extends EventEmitter {
*/
async _evaluateOnFrame(frame, expression) {
let contextId = undefined;
if (!frame.isMainFrame()) {
if (frame !== this._mainFrame) {
contextId = this._frameIdToExecutionContextId.get(frame._id);
console.assert(contextId, 'Frame does not have default context to evaluate in!');
}
@@ -244,13 +244,6 @@ class Frame {
return Array.from(this._childFrames);
}
/**
* @return {boolean}
*/
isMainFrame() {
return !this._detached && !this._parentFrame;
}
/**
* @return {boolean}
*/