When defining a chunk size for <CDPSession>.send('IO.read', { handle, size }), the CDPSession will occasionally indicate that it has reached the end of file without sending a full pdf. This is documented by the associated issue.
This behavior is not reproducible when leaving out the size parameter. Since the size parameter is not required on the CDPSession side and is merely a suggestion on the stream side, we can safely leave it out.
Issues: #7757
If an iframe has a border, it has to be added to the offsets
too. We can work around it by using the content box coordinates
for the offsets. That should also prevent discrepancies if the
iframe has a padding set.
The doc for boundingBox says that it should return the boundingBox
relative to the main frame, therefore, this fix would make the
actual implementation correspond to the documentation. boxModel
documentation does not have this note but I think it'd make sense
to have it match the behaviour of the boundingBox API.
So it appears that all bindings are added to the secondary world and all
evaluations are also running there. ElementHandle.evaluate is returning
handles from the main world though. Therefore, we need to be careful
and adopt handles to the right context before doing waitForSelector
So it appears that all bindings are added to the secondary world and all
evaluations are also running there. ElementHandle.evaluate is returning
handles from the main world though. Therefore, we need to be careful
and adopt handles to the right context before doing waitForSelector.
Reverts #6998
We unfortunately have to revert this commit for two reasons:
The approach for generating types.d.ts implemented in the commit invalidates triple-slash compiler directives since it prepends a declaration before the types.d.ts generated by api-extractor.
In particular, the directive /// <reference types="node" /> in the final types.d.ts is ignored by the typescript compiler making module resolution fail.
The commit makes Puppeteer types ship without DOM types per default. This is not ideal since Puppeteer (and usage of Puppeteer) relies heavily on interacting with DOM elements.
The existing comment suggests that only the default changes–however, even if you set `devtools: false` and `headless: true`, Puppeteer will still open with headful.
When the browser has been started and we have a valid reference lets make use of it instead of force-killing the process. A force kill should probably be the last resort in cleaning up the process.
This will help with Firefox as described on #7668 (comment).
When using a custom Firefox profile for Puppeteer the modified
preferences as present in prefs.js need to be reset once the
profile is no longer needed by Puppeteer. If not done this could
cause side-effects when the profile is used next time outside
of Puppeteer.
As ride-along fix the "--foreground" argument for Firefox will
only be used on MacOS because that's the only supported platform.
This updates the regular expression used to parse aria attribute
selectors so that single quotes may be used as an alternative to double
quotes, e.g. `aria/Single button[role='button']`.
Issues: #7721
Co-authored-by: Andy Earnshaw <andy.earnshaw@gmail.com>
This pull request to adds better support for OOP iframes (see #2548)
The current problem with OOP iframes is that they are moved to a different target. Because of this, the previous versions of Puppeteer pretty much ignored them.
This change extends the FrameManager to already take OOP iframes into account and hides the fact that those frames are actually in different targets.
Further work needs to be done to also make the NetworkManager aware of these and to make sure that settings like emulations etc. are also properly passed down to the new targets.
In some situations, Puppeteer is left in an invalid state because protocol errors that could have been handled by the user where just hidden from them. This patch removes some of these cases and also makes sure that unhandled promise rejections lead to a test failure in mocha.
When the browser child process has logging enabled
and output on stdout isn't constantly processed,
the brower process is about to freeze.
To avoid such a situation at least the stdout
pipe shouldn't be set by default but only if
dumpio is enabled.
Co-authored-by: Jan Scheffler <janscheffler@chromium.org>
Enable developers to handle 'Invalid header' errors instead of hiding them to make sure they can address them properly.
Co-authored-by: Jan Scheffler <janscheffler@chromium.org>
This patch fixes the BrowserFetcher._getFolderPath method so that it supports relative download paths using PUPPETEER_DOWNLOAD_PATH or npm config
Issues: #7592