Bug 1623297 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

The following can be replicated in a Puppeteer test when using the following line:

> let element = await page.$("h1");

Here how Chrome behaves:

```
puppeteer:protocol SEND ► {"sessionId":"C84FB0929B07F2343A111D38B02D679B","method":"Runtime.evaluate","params":{"expression":"document\n//# sourceURL=__puppeteer_evaluation_script__","contextId":3,"returnByValue":false,"awaitPromise":true,"userGesture":true},"id":18} +1ms
  puppeteer:protocol ◀ RECV {"id":18,"result":{"result":{"type":"object","subtype":"node","className":"HTMLDocument","description":"#document","objectId":"{\"injectedScriptId\":3,\"id\":1}"}},"sessionId":"C84FB0929B07F2343A111D38B02D679B"} +4ms
```

And that is what we currently get with Firefox:

```
  puppeteer:protocol SEND ► {"sessionId":1,"method":"Runtime.evaluate","params":{"expression":"document\n//# sourceURL=__puppeteer_evaluation_script__","contextId":3,"returnByValue":false,"awaitPromise":true,"userGesture":true},"id":18} +2ms
  puppeteer:protocol ◀ RECV {"sessionId":1,"id":18,"result":{"result":{"type":"object","subtype":"node"}}} +8ms
```

The `objectId` is needed for commands like `describeNode`, and not returning it will break certain parts of element interaction.
The following can be replicated in a Puppeteer test when using the following line:

> let element = await page.waitForSelector("h1");

Here how Chrome behaves:

```
 puppeteer:protocol SEND ► {"sessionId":"FFF0703460B692B2245C6733A21F3608","method":"Runtime.callFunctionOn","params":{"functionDeclaration":"async function waitForPredicatePageFunction(predicateBody, polling, timeout, ...args) {\n  const p
[..]
"value":"h1"},{"value":false},{"value":false},{"value":false}],"returnByValue":false,"awaitPromise":true,"userGesture":true},"id":18} +3ms
  puppeteer:protocol ◀ RECV {"id":18,"result":{"result":{"type":"object","subtype":"node","className":"HTMLHeadingElement","description":"h1","objectId":"{\"injectedScriptId\":4,\"id\":1}"}},"sessionId":"FFF0703460B692B2245C6733A21F3608"} +4ms
```

And that is what we currently get with Firefox:

```
  puppeteer:protocol ◀ RECV {"sessionId":1,"id":18,"result":{"result":{"type":"object","subtype":"node"}}} +8ms
```

The `objectId` is needed for commands like `describeNode`, and not returning it will break certain parts of element interaction.

Back to Bug 1623297 Comment 0