Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 🎭 Playwright

[![npm version](https://img.shields.io/npm/v/playwright.svg)](https://www.npmjs.com/package/playwright) <!-- GEN:chromium-version-badge -->[![Chromium version](https://img.shields.io/badge/chromium-158.0.8127.2-blue.svg?logo=google-chrome)](https://www.chromium.org/Home)<!-- GEN:stop --> <!-- GEN:firefox-version-badge -->[![Firefox version](https://img.shields.io/badge/firefox-158.0-blue.svg?logo=firefoxbrowser)](https://www.mozilla.org/en-US/firefox/new/)<!-- GEN:stop --> <!-- GEN:webkit-version-badge -->[![WebKit version](https://img.shields.io/badge/webkit-27.2-blue.svg?logo=safari)](https://webkit.org/)<!-- GEN:stop --> [![Join Discord](https://img.shields.io/badge/join-discord-informational)](https://aka.ms/playwright/discord)
[![npm version](https://img.shields.io/npm/v/playwright.svg)](https://www.npmjs.com/package/playwright) <!-- GEN:chromium-version-badge -->[![Chromium version](https://img.shields.io/badge/chromium-158.0.8127.2-blue.svg?logo=google-chrome)](https://www.chromium.org/Home)<!-- GEN:stop --> <!-- GEN:firefox-version-badge -->[![Firefox version](https://img.shields.io/badge/firefox-159.0-blue.svg?logo=firefoxbrowser)](https://www.mozilla.org/en-US/firefox/new/)<!-- GEN:stop --> <!-- GEN:webkit-version-badge -->[![WebKit version](https://img.shields.io/badge/webkit-27.2-blue.svg?logo=safari)](https://webkit.org/)<!-- GEN:stop --> [![Join Discord](https://img.shields.io/badge/join-discord-informational)](https://aka.ms/playwright/discord)

## [Documentation](https://playwright.dev) | [API reference](https://playwright.dev/docs/api/class-playwright)

Expand Down Expand Up @@ -298,7 +298,7 @@ The [Playwright VS Code extension](https://marketplace.visualstudio.com/items?it
| :--- | :---: | :---: | :---: |
| Chromium<sup>1</sup> <!-- GEN:chromium-version -->158.0.8127.2<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| WebKit <!-- GEN:webkit-version -->27.2<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Firefox <!-- GEN:firefox-version -->158.0<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Firefox <!-- GEN:firefox-version -->159.0<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |

Headless and headed execution on all platforms. <sup>1</sup> Uses [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing) by default.

Expand Down
2 changes: 1 addition & 1 deletion browser_patches/firefox/UPSTREAM_CONFIG.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
REMOTE_URL="https://github.com/mozilla-firefox/firefox"
BASE_BRANCH="release"
BASE_REVISION="3c71aeacdb296402e41fb2084b13e797d1770642"
BASE_REVISION="9a2dc53c369c7ae5172018b35988e1d2ffeff402"
3 changes: 3 additions & 0 deletions browser_patches/firefox/juggler/TargetRegistry.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ let didCreateFirstPage = false;
let globalNewPageChain = Promise.resolve();

let globalContextCloseCounter = 0;
let lastMousePointerId = 0;

const HELPER_APP_DIALOG_CONTRACT_ID = '@mozilla.org/helperapplauncherdialog;1';

Expand Down Expand Up @@ -664,6 +665,8 @@ export class PageTarget {
helper.decorateAsEventEmitter(this);

this._targetId = helper.generateId();
// Pointer capture is keyed by pointer ID across tabs, but each page has its own mouse.
this._mousePointerId = ++lastMousePointerId;
this._registry = registry;
this._window = win;
this._gBrowser = win.gBrowser;
Expand Down
2 changes: 1 addition & 1 deletion browser_patches/firefox/juggler/content/Runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

if (!this.Debugger) {
// Worker has a Debugger defined already.
const {addDebuggerToGlobal} = ChromeUtils.importESModule("resource://gre/modules/jsdebugger.sys.mjs");
const {addDebuggerToGlobal} = ChromeUtils.importESModule("moz-src:///devtools/platform/jsdebugger.sys.mjs");
addDebuggerToGlobal(Components.utils.getGlobalForObject(globalThis));
}

Expand Down
4 changes: 2 additions & 2 deletions browser_patches/firefox/juggler/protocol/PageHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ export class PageHandler {
x + boundingBox.left,
y + boundingBox.top,
{
identifier: win.windowUtils.DEFAULT_MOUSE_POINTER_ID,
identifier: this._pageTarget._mousePointerId,
button,
buttons,
clickCount,
Expand Down Expand Up @@ -537,7 +537,7 @@ export class PageHandler {
0 /* x */,
0 /* y */,
{
identifier: win.windowUtils.DEFAULT_MOUSE_POINTER_ID,
identifier: this._pageTarget._mousePointerId,
button,
clickCount,
modifiers,
Expand Down
181 changes: 84 additions & 97 deletions browser_patches/firefox/patches/bootstrap.diff

Large diffs are not rendered by default.

107 changes: 107 additions & 0 deletions browser_patches/firefox/preferences/playwright.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -373,3 +373,110 @@ pref("browser.translations.enable", false);

// Disable spell check
pref("layout.spellcheckDefault", 0);

// Additional automation preferences from remote/shared/RecommendedPreferences.sys.mjs.

// Disable scroll axis lock, WebDriver should be able to scroll arbitrary
// directions.
pref("apz.axis_lock.mode", 0);

// Use zero movement tolerance before a touch is treated as a pan, so that in
// automation touch events scroll from exactly the position they are dispatched
// without small movements first being absorbed.
pref("apz.touch_move_tolerance", "0.0");
pref("apz.touch_start_tolerance", "0.0");

// Disable the profile backup service.
pref("browser.backup.enabled", false);

// Disable extension discovery
pref("browser.discovery.enabled", false);

// Make sure error page is not shown for blank pages with 4xx or 5xx response code
pref("browser.http.blank_page_with_error_response.enabled", true);

// Disable all machine learning features by default
pref("browser.ml.enable", false);

// Disable CFR features for automated tests.
pref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features", false);

// Do not initialize any activitystream features
pref("browser.newtabpage.activity-stream.testing.shouldInitializeFeeds", false);

// Disable session restore infobar
pref("browser.startup.couldRestoreSession.count", -1);

// Unload the previously selected tab immediately
pref("browser.tabs.remote.unloadDelayMs", 0);

// Don't unload tabs when available memory is running low
pref("browser.tabs.unloadOnLowMemory", false);

// Don't show the Bookmarks Toolbar on any tab (the above pref that
// disables the New Tab Page ends up showing the toolbar on about:blank).
pref("browser.toolbars.bookmarks.visibility", "never");

// Turn off Merino suggestions in the location bar so as not to trigger
// network connections.
pref("browser.urlbar.merino.endpointURL", "");
pref("browser.urlbar.merino.ohttpConfigURL", "");
pref("browser.urlbar.merino.ohttpRelayURL", "");

// Do not show datareporting policy notifications which can
// interfere with tests
pref("datareporting.usage.uploadEnabled", false);
pref("telemetry.fog.test.localhost_port", -1);

// Disable the QoS manager on MacOS and the priority manager on all other
// platforms to not cause stalled processes in background tabs when the
// overall CPU load on the machine is high.
//
// TODO: Should be considered to get removed once bug 1960741 is fixed.
pref("threads.lower_mainthread_priority_in_background.enabled", false);
pref("dom.ipc.processPriorityManager.enabled", false);

// Disable location change rate limitation
pref("dom.navigation.navigationRateLimit.count", 0);

// Screen Orientation API
pref("dom.screenorientation.allow-lock", true);

// Disable dialog abuse if alerts are triggered too quickly.
pref("dom.successive_dialog_time_limit", 0);

// Disable form autofill for extensions and credit cards
pref("extensions.formautofill.addresses.enabled", false);
pref("extensions.formautofill.creditCards.enabled", false);

// Make sure opening about:addons will not hit the network
pref("extensions.getAddons.discovery.api_url", "data:, ");

// Redirect various extension update URLs
pref("extensions.systemAddon.update.enabled", false);

// Do not open system settings when geolocation is requested without OS permission
pref("geo.prompt.open_system_prefs", false);

// Disable geolocation ping(#2)
pref("geo.provider.network.url", "");

// Allow scroll amount larger than one page on a single mouse wheel event.
pref("mousewheel.allow_scrolling_more_than_one_page", true);

// Turn off semantic history search as it triggers network connections to
// download ML models.
pref("places.semanticHistory.featureGate", false);

// Privacy and Tracking Protection
pref("privacy.trackingprotection.pbmode.enabled", false);

// Disable the WebAuthn consents prompt
pref("security.webauthn.related_origin_requests_mode", 1);

// Disable logging for remote settings
pref("services.settings.loglevel", "off");

// Disable alerts for credential issues
pref("signon.management.page.breach-alerts.enabled", false);
pref("signon.management.page.vulnerable-passwords.enabled", false);
4 changes: 2 additions & 2 deletions packages/isomorphic/deviceDescriptorsSource.json
Original file line number Diff line number Diff line change
Expand Up @@ -2662,7 +2662,7 @@
"defaultBrowserType": "chromium"
},
"Desktop Firefox HiDPI": {
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:158.0) Gecko/20100101 Firefox/158.0",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:159.0) Gecko/20100101 Firefox/159.0",
"screen": {
"width": 1792,
"height": 1120
Expand Down Expand Up @@ -2722,7 +2722,7 @@
"defaultBrowserType": "chromium"
},
"Desktop Firefox": {
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:158.0) Gecko/20100101 Firefox/158.0",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:159.0) Gecko/20100101 Firefox/159.0",
"screen": {
"width": 1920,
"height": 1080
Expand Down
4 changes: 2 additions & 2 deletions packages/playwright-core/browsers.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
},
{
"name": "firefox",
"revision": "1570",
"revision": "1572",
"installByDefault": true,
"browserVersion": "158.0",
"browserVersion": "159.0",
"title": "Firefox"
},
{
Expand Down
2 changes: 1 addition & 1 deletion tests/page/page-mouse.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ it('MO-004 should pointerdown the div with a custom button', async ({ page, serv
expect(event.isTrusted).toBe(true);
expect(event.button).toBe(1);
expect(event.buttons).toBe(4);
expect(event.pointerId).toBe(browserName === 'firefox' ? 0 : 1);
expect(event.pointerId).toBeGreaterThanOrEqual(0);
});

it('MO-005 should report correct buttons property', async ({ page }) => {
Expand Down
Loading