question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Out-of-process iframes are here now and have to be supported.

For the following HTML served from localhost, pptr fails to report the frame:

<h1>Hello world</h1>
<script>
  const frame = document.createElement('iframe')
  frame.setAttribute('name', 'bob')
  frame.setAttribute('src', 'https://google.com')
  document.body.appendChild(frame)
</script>

Original example: https://github.com/achingbrain/puppeteer-frames Reported here: https://github.com/GoogleChrome/puppeteer/issues/1140#issuecomment-389054750

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:36
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

40reactions
aslushnikovcommented, May 18, 2018

While we’re figuring this out, a workaround is to run with --disable-features=site-per-process flag:

const browser = await puppeteer.launch({                                                                                                                                                                                                                                                            
  args: ['--disable-features=site-per-process'],                                                                                                                                                                                                                                                    
  headless: false                                                                                                                                                                                                                                                                                   
}) ;
22reactions
benbuzbeecommented, Nov 7, 2019

@aslushnikov could be willing to take a stab at this but how long this issue has been neglected makes me nervous that there may be some hidden dangers.

What would you say are the major concerns?

The change seems something like

  • use target attached/detatched/destroyed events with type=iframe as a hint to the frame tree and update the frame manager accordingly https://cs.chromium.org/chromium/src/content/browser/devtools/protocol/target_auto_attacher.cc?type=cs&sq=package:chromium&g=0&l=173

  • The frame needs its own CDPSession if created in this way instead of inheriting the parents so that it can use a separate sessionid, seems relatively straight-forward. Seems to be some finagling to do here so each instance ignores messages not meant for it

  • Commands that use the devtools Page domain that aren’t already on the Frame class may need to be changed to send to all frame’s sessions This one may be sketch. Some commands will be fine, like captureScreenshot which can exist only being dispatched to the root frame, but others wont. It looks like Page.addScriptToEvaluateOnNewDocument doesn’t filter to OOPIF so Page::exposeFunction() won’t work for them. That said, this limitation seems like something that could be slowly addressed over time in the future and not having it but having most other things seems strictly better.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Out-of-Process iframes (OOPIFs) - The Chromium Projects
This page provides an overview of Chromium's support for out-of-process iframes (OOPIFs), which allow a child frame of a page to be rendered...
Read more >
FYI: Out-of-process iframes are now enabled (via
We have now added OOPIF support for drag and drop, added the ability to print an OOPIF, and fixed a handful of other...
Read more >
Does Firefox, IE, Opera or Safari support OOPIF? (Out-of ...
Since Google Chrome v55 (and some previous versions) support for OOPIF (multi-threading iframes) is enabled by default.
Read more >
455764 - OOPIF: Printing Support - chromium - Monorail
To print pages with out-of-process iframes, we will need to assemble a PDF based on output from several renderer processes. Each frame's renderer...
Read more >
Site Isolation Design Document - Google Sites
9.1 Site Isolation Overview; 9.2 Chromium Changes for OOPIF ... To support a site-per-process policy in a multi-process web browser, we need to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found