This PR fixes the following edge case:
- `const oldPromise = world.puppeteerUtil`.
- setContext occurs but context is immediately destroyed, i.e.
`world.#puppeteerUtil === oldPromise` is not resolved.
- clearContext occurs due to destruction, i.e. `world.#puppeteerUtil` is
replaced (`world.#puppeteerUtil !== oldPromise`).
- `oldPromise` never resolves.
<!-- Thanks for submitting a pull request! Please provide enough
information so that others can review your pull request. -->
**What kind of change does this PR introduce?**
Test expectation file update
**Did you add tests for your changes?**
no
**Summary**
Unskippes tests for Firefox and linux, which were missed in the previous
update
**Does this PR introduce a breaking change?**
no
Issue: #9394
**What kind of change does this PR introduce?**
Feature - Added support of the `referrerPolicy` parameter (from CDP's
`Page.navigate`) to Puppeteer's `page.goto`.
**Did you add tests for your changes?**
No, currently it has no meaning that isn't browser implementation based,
which might get broken in the future. If there are suggestions to tests,
please let me know so I'll add them.
**If relevant, did you update the documentation?**
Yes, the documentation of the `goto` method has been updated.
**Summary**
I wanted to contribute to this project, which I used for testing on our
environment and saw issue #9394, so I decided to resolve it :)
**Does this PR introduce a breaking change?**
No. I added the `referrerPolicy` as an optional parameter, which will
use the HTTP header `Referrer-Policy` if not provided (much like the
`referer` parameter) so it will not interfere.
Co-authored-by: Ophir Back <ophir.back@broadcom.com>
What kind of change does this PR introduce?
Test expectation file update
Summary
Closes https://github.com/puppeteer/puppeteer/issues/9118.
This PR updates the test expectation file with more specific status for
firefox (like fail, fail-pass), removes the duplications.
Does this PR introduce a breaking change?
no
Bumps [glob](https://github.com/isaacs/node-glob) from 8.0.3 to 8.1.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/isaacs/node-glob/blob/main/changelog.md">glob's
changelog</a>.</em></p>
<blockquote>
<h2>8.1</h2>
<ul>
<li>Add <code>windowsPathsNoEscape</code> option</li>
</ul>
<h2>8.0</h2>
<ul>
<li>Only support node v12 and higher</li>
<li><code>\</code> is now <strong>only</strong> used as an escape
character, and never as a
path separator in glob patterns, so that Windows users have a
way to match against filenames containing literal glob pattern
characters.</li>
<li>Glob pattern paths <strong>must</strong> use forward-slashes as path
separators, since <code>\</code> is an escape character to match literal
glob pattern characters.</li>
<li>(8.0.2) <code>cwd</code> and <code>root</code> will always be
automatically coerced
to use <code>/</code> as path separators on Windows, as they cannot
contain glob patterns anyway, and are often supplied by
<code>path.resolve()</code> and other methods that will use
<code>\</code> path
separators by default.</li>
</ul>
<h2>7.2</h2>
<ul>
<li>Add fs option to allow passing virtual filesystem</li>
</ul>
<h2>7.1</h2>
<ul>
<li>Ignore stat errors that are not <code>ENOENT</code> to work around
Windows issues.</li>
<li>Support using root and absolute options together</li>
<li>Bring back lumpy space princess</li>
<li>force 'en' locale in string sorting</li>
</ul>
<h2>7.0</h2>
<ul>
<li>Raise error if <code>options.cwd</code> is specified, and not a
directory</li>
</ul>
<h2>6.0</h2>
<ul>
<li>Remove comment and negation pattern support</li>
<li>Ignore patterns are always in <code>dot:true</code> mode</li>
</ul>
<h2>5.0</h2>
<ul>
<li>Deprecate comment and negation patterns</li>
<li>Fix regression in <code>mark</code> and <code>nodir</code> options
from making all cache
keys absolute path.</li>
<li>Abort if <code>fs.readdir</code> returns an error that's
unexpected</li>
<li>Don't emit <code>match</code> events for ignored items</li>
<li>Treat ENOTSUP like ENOTDIR in readdir</li>
</ul>
<h2>4.5</h2>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="1b6bf20239"><code>1b6bf20</code></a>
8.1.0</li>
<li><a
href="1756fccfe7"><code>1756fcc</code></a>
add windowsPathsNoEscape option</li>
<li><a
href="af57da21c7"><code>af57da2</code></a>
update tap, libtap</li>
<li><a
href="e19db65d23"><code>e19db65</code></a>
Remove dependency on path-is-absolute</li>
<li>See full diff in <a
href="https://github.com/isaacs/node-glob/compare/v8.0.3...v8.1.0">compare
view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=glob&package-manager=npm_and_yarn&previous-version=8.0.3&new-version=8.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
</details>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
<!-- Thanks for submitting a pull request! Please provide enough
information so that others can review your pull request. -->
**What kind of change does this PR introduce?**
types fix
**Did you add tests for your changes?**
No
**If relevant, did you update the documentation?**
Not relevant
**Summary**
I am updating `import`s of `devtools-protocol` to always use named
import instead of the default.
For some reason, typescript doesn't understand when it is imported as
default.
```
node_modules/puppeteer-core/lib/esm/puppeteer/common/TargetManager.d.ts:23:59 - error TS2694: Namespace '"/Users/kyrylo/pacakge/node_modules/puppeteer-core/node_modules/devtools-protocol/types/protocol"' has no exported member 'Target'.
23 export declare type TargetFactory = (targetInfo: Protocol.Target.TargetInfo, session?: CDPSession) => Target;
~~~~~~
Found 1 error in node_modules/puppeteer-core/lib/esm/puppeteer/common/TargetManager.d.ts:23
```
**Does this PR introduce a breaking change?**
No
<!-- If this PR introduces a breaking change, please describe the impact
and a migration path for existing applications. -->
**Other information**
I am updating `import`s of `devtools-protocol` to always use named
import instead of the default.
<!-- Thanks for submitting a pull request! Please provide enough
information so that others can review your pull request. -->
**What kind of change does this PR introduce?**
This is a change to a custom mocha runner to look for expectation of the
test case by the whole test name instead of by the part of the name.
**Summary**
Working on integration of the puppeteer expectation file in mozilla repo
and unskipping a lot of tests, I've noticed that some tests get wrong
statuses. For example, a test case with the name `navigation Page.goto
should fail when navigating to bad SSL` got the status of `navigation
Page.goto should fail when navigating to bad SSL after redirects` or
`ElementHandle specs ElementHandle.boundingBox should work` get the
status of `ElementHandle specs ElementHandle.boundingBox should work
with SVG nodes`. So it seems like checking for the whole name of the
test should be safer, but let me know if I'm missing something here.
**Does this PR introduce a breaking change?**
no
Issue: #1313
<!-- Thanks for submitting a pull request! Please provide enough
information so that others can review your pull request. -->
**What kind of change does this PR introduce?**
Feature.
**Did you add tests for your changes?**
Yes.
**If relevant, did you update the documentation?**
Yes.
**Summary**
Supports keyboard shotcuts on MacOS. See Chrome Devtools Protocol
document:
https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-dispatchKeyEvent.
<!-- Thanks for submitting a pull request! Please provide enough
information so that others can review your pull request. -->
**What kind of change does this PR introduce?**
- adds missing golden asset for firefox
**Summary**
- This change will let us see in mozilla ci, where we don't skip this
test, a better error message. Right now it fails with missing asset
error.
**Does this PR introduce a breaking change?**
no
This PR adds configurations files to `puppeteer`'s methods for
configuration. Under the hood, `puppeteer` relies on
https://www.npmjs.com/package/cosmiconfig which resolves several formats
of configuration:
- a `puppeteer` property in package.json
- a `.puppeteerrc` file in JSON or YAML format
- a `.puppeteerrc.json`, `.puppeteerrc.yaml`, `.puppeteerrc.yml`,
`.puppeteerrc.js`, or `.puppeteerrc.cjs` file
- a `puppeteer.config.js` or `puppeteer.config.cjs` CommonJS module
exporting an object
Documentation will be added later.
Fixed: #9128