From 29f7dfa3ee3952c6c229584be73a5c0bed729786 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Mon, 9 Aug 2021 23:57:17 +0300 Subject: [PATCH] feat(chromium): roll Chromium to M94 (#8047) --- README.md | 4 +- browsers.json | 4 +- src/server/chromium/chromium.ts | 3 +- src/server/chromium/crBrowser.ts | 2 +- src/server/chromium/protocol.d.ts | 48 ++++++++++++- src/server/deviceDescriptorsSource.json | 92 ++++++++++++------------ tests/browsercontext-add-cookies.spec.ts | 16 +++-- tests/browsercontext-cookies.spec.ts | 32 +++++---- tests/browsercontext-route.spec.ts | 4 +- tests/defaultbrowsercontext-1.spec.ts | 11 +-- tests/headful.spec.ts | 2 +- types/protocol.d.ts | 48 ++++++++++++- 12 files changed, 181 insertions(+), 85 deletions(-) diff --git a/README.md b/README.md index 57bf12e4a6..9b6e8dd1c8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # 🎭 Playwright -[![npm version](https://img.shields.io/npm/v/playwright.svg?style=flat)](https://www.npmjs.com/package/playwright) [![Join Slack](https://img.shields.io/badge/join-slack-infomational)](https://aka.ms/playwright-slack) [![Chromium version](https://img.shields.io/badge/chromium-93.0.4576.0-blue.svg?logo=google-chrome)](https://www.chromium.org/Home) [![Firefox version](https://img.shields.io/badge/firefox-90.0-blue.svg?logo=mozilla-firefox)](https://www.mozilla.org/en-US/firefox/new/) [![WebKit version](https://img.shields.io/badge/webkit-14.2-blue.svg?logo=safari)](https://webkit.org/) +[![npm version](https://img.shields.io/npm/v/playwright.svg?style=flat)](https://www.npmjs.com/package/playwright) [![Join Slack](https://img.shields.io/badge/join-slack-infomational)](https://aka.ms/playwright-slack) [![Chromium version](https://img.shields.io/badge/chromium-94.0.4595.0-blue.svg?logo=google-chrome)](https://www.chromium.org/Home) [![Firefox version](https://img.shields.io/badge/firefox-90.0-blue.svg?logo=mozilla-firefox)](https://www.mozilla.org/en-US/firefox/new/) [![WebKit version](https://img.shields.io/badge/webkit-14.2-blue.svg?logo=safari)](https://webkit.org/) ## [Documentation](https://playwright.dev) | [API reference](https://playwright.dev/docs/api/class-playwright/) @@ -8,7 +8,7 @@ Playwright is a Node.js library to automate [Chromium](https://www.chromium.org/ | | Linux | macOS | Windows | | :--- | :---: | :---: | :---: | -| Chromium 93.0.4576.0 | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Chromium 94.0.4595.0 | :white_check_mark: | :white_check_mark: | :white_check_mark: | | WebKit 14.2 | :white_check_mark: | :white_check_mark: | :white_check_mark: | | Firefox 90.0 | :white_check_mark: | :white_check_mark: | :white_check_mark: | diff --git a/browsers.json b/browsers.json index 92cad1955b..87bb891d39 100644 --- a/browsers.json +++ b/browsers.json @@ -3,12 +3,12 @@ "browsers": [ { "name": "chromium", - "revision": "901522", + "revision": "907428", "installByDefault": true }, { "name": "chromium-with-symbols", - "revision": "901522", + "revision": "907428", "installByDefault": false }, { diff --git a/src/server/chromium/chromium.ts b/src/server/chromium/chromium.ts index 6aacd35459..4b44c7a64d 100644 --- a/src/server/chromium/chromium.ts +++ b/src/server/chromium/chromium.ts @@ -197,8 +197,7 @@ const DEFAULT_ARGS = [ '--disable-default-apps', '--disable-dev-shm-usage', '--disable-extensions', - // BlinkGenPropertyTrees disabled due to crbug.com/937609 - '--disable-features=TranslateUI,BlinkGenPropertyTrees,ImprovedCookieControls,SameSiteByDefaultCookies,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose', + '--disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose', '--allow-pre-commit-input', '--disable-hang-monitor', '--disable-ipc-flooding-protection', diff --git a/src/server/chromium/crBrowser.ts b/src/server/chromium/crBrowser.ts index ad16e44f3a..d9ed6cb29e 100644 --- a/src/server/chromium/crBrowser.ts +++ b/src/server/chromium/crBrowser.ts @@ -361,7 +361,7 @@ export class CRBrowserContext extends BrowserContext { async _doCookies(urls: string[]): Promise { const { cookies } = await this._browser._session.send('Storage.getCookies', { browserContextId: this._browserContextId }); return network.filterCookies(cookies.map(c => { - const copy: any = { sameSite: 'None', ...c }; + const copy: any = { sameSite: 'Lax', ...c }; delete copy.size; delete copy.priority; delete copy.session; diff --git a/src/server/chromium/protocol.d.ts b/src/server/chromium/protocol.d.ts index 9bc8814fc5..7305991c9a 100644 --- a/src/server/chromium/protocol.d.ts +++ b/src/server/chromium/protocol.d.ts @@ -5938,6 +5938,10 @@ text, HTML markup or any other data. } export interface DragData { items: DragDataItem[]; + /** + * List of filenames that should be included when dropping + */ + files?: string[]; /** * Bit field representing allowed drag operations. Copy = 1, Link = 2, Move = 16 */ @@ -6064,6 +6068,35 @@ for example an emoji keyboard or an IME. } export type insertTextReturnValue = { } + /** + * This method sets the current candidate text for ime. +Use imeCommitComposition to commit the final text. +Use imeSetComposition with empty string as text to cancel composition. + */ + export type imeSetCompositionParameters = { + /** + * The text to insert + */ + text: string; + /** + * selection start + */ + selectionStart: number; + /** + * selection end + */ + selectionEnd: number; + /** + * replacement start + */ + replacementStart?: number; + /** + * replacement end + */ + replacementEnd?: number; + } + export type imeSetCompositionReturnValue = { + } /** * Dispatches a mouse event to the page. */ @@ -8368,6 +8401,11 @@ are represented by the invalid cookie line string instead of a proper cookie. established the connection, so we can't send it in `requestWillBeSentExtraInfo`. */ resourceIPAddressSpace: IPAddressSpace; + /** + * The status code of the response. This is useful in cases the request failed and no responseReceived +event is triggered, which is the case for, e.g., CORS errors. + */ + statusCode: number; /** * Raw response header text as it was received over the wire. The raw text may not always be available, such as in the case of HTTP/2 or QUIC. @@ -9800,7 +9838,7 @@ Backend then generates 'inspectNodeRequested' event upon element selection. * All Permissions Policy features. This enum should match the one defined in third_party/blink/renderer/core/permissions_policy/permissions_policy_features.json5. */ - export type PermissionsPolicyFeature = "accelerometer"|"ambient-light-sensor"|"attribution-reporting"|"autoplay"|"camera"|"ch-dpr"|"ch-device-memory"|"ch-downlink"|"ch-ect"|"ch-lang"|"ch-prefers-color-scheme"|"ch-rtt"|"ch-ua"|"ch-ua-arch"|"ch-ua-bitness"|"ch-ua-platform"|"ch-ua-model"|"ch-ua-mobile"|"ch-ua-full-version"|"ch-ua-platform-version"|"ch-viewport-width"|"ch-width"|"clipboard-read"|"clipboard-write"|"cross-origin-isolated"|"direct-sockets"|"display-capture"|"document-domain"|"encrypted-media"|"execution-while-out-of-viewport"|"execution-while-not-rendered"|"focus-without-user-activation"|"fullscreen"|"frobulate"|"gamepad"|"geolocation"|"gyroscope"|"hid"|"idle-detection"|"interest-cohort"|"magnetometer"|"microphone"|"midi"|"otp-credentials"|"payment"|"picture-in-picture"|"publickey-credentials-get"|"screen-wake-lock"|"serial"|"shared-autofill"|"storage-access-api"|"sync-xhr"|"trust-token-redemption"|"usb"|"vertical-scroll"|"web-share"|"window-placement"|"xr-spatial-tracking"; + export type PermissionsPolicyFeature = "accelerometer"|"ambient-light-sensor"|"attribution-reporting"|"autoplay"|"camera"|"ch-dpr"|"ch-device-memory"|"ch-downlink"|"ch-ect"|"ch-lang"|"ch-prefers-color-scheme"|"ch-rtt"|"ch-ua"|"ch-ua-arch"|"ch-ua-bitness"|"ch-ua-platform"|"ch-ua-model"|"ch-ua-mobile"|"ch-ua-full-version"|"ch-ua-platform-version"|"ch-ua-reduced"|"ch-viewport-width"|"ch-width"|"clipboard-read"|"clipboard-write"|"cross-origin-isolated"|"direct-sockets"|"display-capture"|"document-domain"|"encrypted-media"|"execution-while-out-of-viewport"|"execution-while-not-rendered"|"focus-without-user-activation"|"fullscreen"|"frobulate"|"gamepad"|"geolocation"|"gyroscope"|"hid"|"idle-detection"|"interest-cohort"|"magnetometer"|"microphone"|"midi"|"otp-credentials"|"payment"|"picture-in-picture"|"publickey-credentials-get"|"screen-wake-lock"|"serial"|"shared-autofill"|"storage-access-api"|"sync-xhr"|"trust-token-redemption"|"usb"|"vertical-scroll"|"web-share"|"window-placement"|"xr-spatial-tracking"; /** * Reason for a permissions policy feature to be disabled. */ @@ -10256,7 +10294,7 @@ Example URLs: http://www.google.com/file.html -> "google.com" /** * List of not restored reasons for back-forward cache. */ - export type BackForwardCacheNotRestoredReason = "NotMainFrame"|"BackForwardCacheDisabled"|"RelatedActiveContentsExist"|"HTTPStatusNotOK"|"SchemeNotHTTPOrHTTPS"|"Loading"|"WasGrantedMediaAccess"|"DisableForRenderFrameHostCalled"|"DomainNotAllowed"|"HTTPMethodNotGET"|"SubframeIsNavigating"|"Timeout"|"CacheLimit"|"JavaScriptExecution"|"RendererProcessKilled"|"RendererProcessCrashed"|"GrantedMediaStreamAccess"|"SchedulerTrackedFeatureUsed"|"ConflictingBrowsingInstance"|"CacheFlushed"|"ServiceWorkerVersionActivation"|"SessionRestored"|"ServiceWorkerPostMessage"|"EnteredBackForwardCacheBeforeServiceWorkerHostAdded"|"RenderFrameHostReused_SameSite"|"RenderFrameHostReused_CrossSite"|"ServiceWorkerClaim"|"IgnoreEventAndEvict"|"HaveInnerContents"|"TimeoutPuttingInCache"|"BackForwardCacheDisabledByLowMemory"|"BackForwardCacheDisabledByCommandLine"|"NetworkRequestDatapipeDrainedAsBytesConsumer"|"NetworkRequestRedirected"|"NetworkRequestTimeout"|"NetworkExceedsBufferLimit"|"NavigationCancelledWhileRestoring"|"NotMostRecentNavigationEntry"|"BackForwardCacheDisabledForPrerender"|"UserAgentOverrideDiffers"|"ForegroundCacheLimit"|"BrowsingInstanceNotSwapped"|"BackForwardCacheDisabledForDelegate"|"OptInUnloadHeaderNotPresent"|"UnloadHandlerExistsInSubFrame"|"ServiceWorkerUnregistration"|"CacheControlNoStore"|"CacheControlNoStoreCookieModified"|"CacheControlNoStoreHTTPOnlyCookieModified"|"WebSocket"|"WebRTC"|"MainResourceHasCacheControlNoStore"|"MainResourceHasCacheControlNoCache"|"SubresourceHasCacheControlNoStore"|"SubresourceHasCacheControlNoCache"|"ContainsPlugins"|"DocumentLoaded"|"DedicatedWorkerOrWorklet"|"OutstandingNetworkRequestOthers"|"OutstandingIndexedDBTransaction"|"RequestedNotificationsPermission"|"RequestedMIDIPermission"|"RequestedAudioCapturePermission"|"RequestedVideoCapturePermission"|"RequestedBackForwardCacheBlockedSensors"|"RequestedBackgroundWorkPermission"|"BroadcastChannel"|"IndexedDBConnection"|"WebXR"|"SharedWorker"|"WebLocks"|"WebHID"|"WebShare"|"RequestedStorageAccessGrant"|"WebNfc"|"WebFileSystem"|"OutstandingNetworkRequestFetch"|"OutstandingNetworkRequestXHR"|"AppBanner"|"Printing"|"WebDatabase"|"PictureInPicture"|"Portal"|"SpeechRecognizer"|"IdleManager"|"PaymentManager"|"SpeechSynthesis"|"KeyboardLock"|"WebOTPService"|"OutstandingNetworkRequestDirectSocket"|"IsolatedWorldScript"|"InjectedStyleSheet"|"MediaSessionImplOnServiceCreated"|"Unknown"; + export type BackForwardCacheNotRestoredReason = "NotMainFrame"|"BackForwardCacheDisabled"|"RelatedActiveContentsExist"|"HTTPStatusNotOK"|"SchemeNotHTTPOrHTTPS"|"Loading"|"WasGrantedMediaAccess"|"DisableForRenderFrameHostCalled"|"DomainNotAllowed"|"HTTPMethodNotGET"|"SubframeIsNavigating"|"Timeout"|"CacheLimit"|"JavaScriptExecution"|"RendererProcessKilled"|"RendererProcessCrashed"|"GrantedMediaStreamAccess"|"SchedulerTrackedFeatureUsed"|"ConflictingBrowsingInstance"|"CacheFlushed"|"ServiceWorkerVersionActivation"|"SessionRestored"|"ServiceWorkerPostMessage"|"EnteredBackForwardCacheBeforeServiceWorkerHostAdded"|"RenderFrameHostReused_SameSite"|"RenderFrameHostReused_CrossSite"|"ServiceWorkerClaim"|"IgnoreEventAndEvict"|"HaveInnerContents"|"TimeoutPuttingInCache"|"BackForwardCacheDisabledByLowMemory"|"BackForwardCacheDisabledByCommandLine"|"NetworkRequestDatapipeDrainedAsBytesConsumer"|"NetworkRequestRedirected"|"NetworkRequestTimeout"|"NetworkExceedsBufferLimit"|"NavigationCancelledWhileRestoring"|"NotMostRecentNavigationEntry"|"BackForwardCacheDisabledForPrerender"|"UserAgentOverrideDiffers"|"ForegroundCacheLimit"|"BrowsingInstanceNotSwapped"|"BackForwardCacheDisabledForDelegate"|"OptInUnloadHeaderNotPresent"|"UnloadHandlerExistsInSubFrame"|"ServiceWorkerUnregistration"|"CacheControlNoStore"|"CacheControlNoStoreCookieModified"|"CacheControlNoStoreHTTPOnlyCookieModified"|"NoResponseHead"|"WebSocket"|"WebRTC"|"MainResourceHasCacheControlNoStore"|"MainResourceHasCacheControlNoCache"|"SubresourceHasCacheControlNoStore"|"SubresourceHasCacheControlNoCache"|"ContainsPlugins"|"DocumentLoaded"|"DedicatedWorkerOrWorklet"|"OutstandingNetworkRequestOthers"|"OutstandingIndexedDBTransaction"|"RequestedNotificationsPermission"|"RequestedMIDIPermission"|"RequestedAudioCapturePermission"|"RequestedVideoCapturePermission"|"RequestedBackForwardCacheBlockedSensors"|"RequestedBackgroundWorkPermission"|"BroadcastChannel"|"IndexedDBConnection"|"WebXR"|"SharedWorker"|"WebLocks"|"WebHID"|"WebShare"|"RequestedStorageAccessGrant"|"WebNfc"|"WebFileSystem"|"OutstandingNetworkRequestFetch"|"OutstandingNetworkRequestXHR"|"AppBanner"|"Printing"|"WebDatabase"|"PictureInPicture"|"Portal"|"SpeechRecognizer"|"IdleManager"|"PaymentManager"|"SpeechSynthesis"|"KeyboardLock"|"WebOTPService"|"OutstandingNetworkRequestDirectSocket"|"IsolatedWorldScript"|"InjectedStyleSheet"|"MediaSessionImplOnServiceCreated"|"Unknown"; /** * Types of not restored reasons for back-forward cache. */ @@ -16067,6 +16105,10 @@ call). export type inspectRequestedPayload = { object: RemoteObject; hints: { [key: string]: string }; + /** + * Identifier of the context where the call was made. + */ + executionContextId?: ExecutionContextId; } /** @@ -16957,6 +16999,7 @@ unsubscribes current runtime agent from Runtime.bindingCalled notifications. "Input.dispatchDragEvent": Input.dispatchDragEventParameters; "Input.dispatchKeyEvent": Input.dispatchKeyEventParameters; "Input.insertText": Input.insertTextParameters; + "Input.imeSetComposition": Input.imeSetCompositionParameters; "Input.dispatchMouseEvent": Input.dispatchMouseEventParameters; "Input.dispatchTouchEvent": Input.dispatchTouchEventParameters; "Input.emulateTouchFromMouseEvent": Input.emulateTouchFromMouseEventParameters; @@ -17476,6 +17519,7 @@ unsubscribes current runtime agent from Runtime.bindingCalled notifications. "Input.dispatchDragEvent": Input.dispatchDragEventReturnValue; "Input.dispatchKeyEvent": Input.dispatchKeyEventReturnValue; "Input.insertText": Input.insertTextReturnValue; + "Input.imeSetComposition": Input.imeSetCompositionReturnValue; "Input.dispatchMouseEvent": Input.dispatchMouseEventReturnValue; "Input.dispatchTouchEvent": Input.dispatchTouchEventReturnValue; "Input.emulateTouchFromMouseEvent": Input.emulateTouchFromMouseEventReturnValue; diff --git a/src/server/deviceDescriptorsSource.json b/src/server/deviceDescriptorsSource.json index 9963d8586a..4a6445191b 100644 --- a/src/server/deviceDescriptorsSource.json +++ b/src/server/deviceDescriptorsSource.json @@ -110,7 +110,7 @@ "defaultBrowserType": "webkit" }, "Galaxy S5": { - "userAgent": "Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Mobile Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36", "viewport": { "width": 360, "height": 640 @@ -121,7 +121,7 @@ "defaultBrowserType": "chromium" }, "Galaxy S5 landscape": { - "userAgent": "Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Mobile Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36", "viewport": { "width": 640, "height": 360 @@ -132,7 +132,7 @@ "defaultBrowserType": "chromium" }, "Galaxy S8": { - "userAgent": "Mozilla/5.0 (Linux; Android 7.0; SM-G950U Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Mobile Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 7.0; SM-G950U Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36", "viewport": { "width": 360, "height": 740 @@ -143,7 +143,7 @@ "defaultBrowserType": "chromium" }, "Galaxy S8 landscape": { - "userAgent": "Mozilla/5.0 (Linux; Android 7.0; SM-G950U Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Mobile Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 7.0; SM-G950U Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36", "viewport": { "width": 740, "height": 360 @@ -154,7 +154,7 @@ "defaultBrowserType": "chromium" }, "Galaxy S9+": { - "userAgent": "Mozilla/5.0 (Linux; Android 8.0.0; SM-G965U Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Mobile Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 8.0.0; SM-G965U Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36", "viewport": { "width": 320, "height": 658 @@ -165,7 +165,7 @@ "defaultBrowserType": "chromium" }, "Galaxy S9+ landscape": { - "userAgent": "Mozilla/5.0 (Linux; Android 8.0.0; SM-G965U Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Mobile Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 8.0.0; SM-G965U Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36", "viewport": { "width": 658, "height": 320 @@ -176,7 +176,7 @@ "defaultBrowserType": "chromium" }, "Galaxy Tab S4": { - "userAgent": "Mozilla/5.0 (Linux; Android 8.1.0; SM-T837A) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 8.1.0; SM-T837A) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Safari/537.36", "viewport": { "width": 712, "height": 1138 @@ -187,7 +187,7 @@ "defaultBrowserType": "chromium" }, "Galaxy Tab S4 landscape": { - "userAgent": "Mozilla/5.0 (Linux; Android 8.1.0; SM-T837A) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 8.1.0; SM-T837A) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Safari/537.36", "viewport": { "width": 1138, "height": 712 @@ -708,7 +708,7 @@ "defaultBrowserType": "webkit" }, "LG Optimus L70": { - "userAgent": "Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; LGMS323 Build/KOT49I.MS32310c) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/93.0.4576.0 Mobile Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; LGMS323 Build/KOT49I.MS32310c) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/94.0.4595.0 Mobile Safari/537.36", "viewport": { "width": 384, "height": 640 @@ -719,7 +719,7 @@ "defaultBrowserType": "chromium" }, "LG Optimus L70 landscape": { - "userAgent": "Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; LGMS323 Build/KOT49I.MS32310c) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/93.0.4576.0 Mobile Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; LGMS323 Build/KOT49I.MS32310c) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/94.0.4595.0 Mobile Safari/537.36", "viewport": { "width": 640, "height": 384 @@ -730,7 +730,7 @@ "defaultBrowserType": "chromium" }, "Microsoft Lumia 550": { - "userAgent": "Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 550) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Mobile Safari/537.36 Edge/14.14263", + "userAgent": "Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 550) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36 Edge/14.14263", "viewport": { "width": 640, "height": 360 @@ -741,7 +741,7 @@ "defaultBrowserType": "chromium" }, "Microsoft Lumia 550 landscape": { - "userAgent": "Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 550) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Mobile Safari/537.36 Edge/14.14263", + "userAgent": "Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 550) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36 Edge/14.14263", "viewport": { "width": 360, "height": 640 @@ -752,7 +752,7 @@ "defaultBrowserType": "chromium" }, "Microsoft Lumia 950": { - "userAgent": "Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 950) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Mobile Safari/537.36 Edge/14.14263", + "userAgent": "Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 950) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36 Edge/14.14263", "viewport": { "width": 360, "height": 640 @@ -763,7 +763,7 @@ "defaultBrowserType": "chromium" }, "Microsoft Lumia 950 landscape": { - "userAgent": "Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 950) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Mobile Safari/537.36 Edge/14.14263", + "userAgent": "Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 950) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36 Edge/14.14263", "viewport": { "width": 640, "height": 360 @@ -774,7 +774,7 @@ "defaultBrowserType": "chromium" }, "Nexus 10": { - "userAgent": "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 10 Build/MOB31T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 10 Build/MOB31T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Safari/537.36", "viewport": { "width": 800, "height": 1280 @@ -785,7 +785,7 @@ "defaultBrowserType": "chromium" }, "Nexus 10 landscape": { - "userAgent": "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 10 Build/MOB31T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 10 Build/MOB31T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Safari/537.36", "viewport": { "width": 1280, "height": 800 @@ -796,7 +796,7 @@ "defaultBrowserType": "chromium" }, "Nexus 4": { - "userAgent": "Mozilla/5.0 (Linux; Android 4.4.2; Nexus 4 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Mobile Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 4.4.2; Nexus 4 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36", "viewport": { "width": 384, "height": 640 @@ -807,7 +807,7 @@ "defaultBrowserType": "chromium" }, "Nexus 4 landscape": { - "userAgent": "Mozilla/5.0 (Linux; Android 4.4.2; Nexus 4 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Mobile Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 4.4.2; Nexus 4 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36", "viewport": { "width": 640, "height": 384 @@ -818,7 +818,7 @@ "defaultBrowserType": "chromium" }, "Nexus 5": { - "userAgent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Mobile Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36", "viewport": { "width": 360, "height": 640 @@ -829,7 +829,7 @@ "defaultBrowserType": "chromium" }, "Nexus 5 landscape": { - "userAgent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Mobile Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36", "viewport": { "width": 640, "height": 360 @@ -840,7 +840,7 @@ "defaultBrowserType": "chromium" }, "Nexus 5X": { - "userAgent": "Mozilla/5.0 (Linux; Android 8.0.0; Nexus 5X Build/OPR4.170623.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Mobile Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 8.0.0; Nexus 5X Build/OPR4.170623.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36", "viewport": { "width": 412, "height": 732 @@ -851,7 +851,7 @@ "defaultBrowserType": "chromium" }, "Nexus 5X landscape": { - "userAgent": "Mozilla/5.0 (Linux; Android 8.0.0; Nexus 5X Build/OPR4.170623.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Mobile Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 8.0.0; Nexus 5X Build/OPR4.170623.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36", "viewport": { "width": 732, "height": 412 @@ -862,7 +862,7 @@ "defaultBrowserType": "chromium" }, "Nexus 6": { - "userAgent": "Mozilla/5.0 (Linux; Android 7.1.1; Nexus 6 Build/N6F26U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Mobile Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 7.1.1; Nexus 6 Build/N6F26U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36", "viewport": { "width": 412, "height": 732 @@ -873,7 +873,7 @@ "defaultBrowserType": "chromium" }, "Nexus 6 landscape": { - "userAgent": "Mozilla/5.0 (Linux; Android 7.1.1; Nexus 6 Build/N6F26U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Mobile Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 7.1.1; Nexus 6 Build/N6F26U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36", "viewport": { "width": 732, "height": 412 @@ -884,7 +884,7 @@ "defaultBrowserType": "chromium" }, "Nexus 6P": { - "userAgent": "Mozilla/5.0 (Linux; Android 8.0.0; Nexus 6P Build/OPP3.170518.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Mobile Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 8.0.0; Nexus 6P Build/OPP3.170518.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36", "viewport": { "width": 412, "height": 732 @@ -895,7 +895,7 @@ "defaultBrowserType": "chromium" }, "Nexus 6P landscape": { - "userAgent": "Mozilla/5.0 (Linux; Android 8.0.0; Nexus 6P Build/OPP3.170518.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Mobile Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 8.0.0; Nexus 6P Build/OPP3.170518.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36", "viewport": { "width": 732, "height": 412 @@ -906,7 +906,7 @@ "defaultBrowserType": "chromium" }, "Nexus 7": { - "userAgent": "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 7 Build/MOB30X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 7 Build/MOB30X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Safari/537.36", "viewport": { "width": 600, "height": 960 @@ -917,7 +917,7 @@ "defaultBrowserType": "chromium" }, "Nexus 7 landscape": { - "userAgent": "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 7 Build/MOB30X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 7 Build/MOB30X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Safari/537.36", "viewport": { "width": 960, "height": 600 @@ -972,7 +972,7 @@ "defaultBrowserType": "webkit" }, "Pixel 2": { - "userAgent": "Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Mobile Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36", "viewport": { "width": 411, "height": 731 @@ -983,7 +983,7 @@ "defaultBrowserType": "chromium" }, "Pixel 2 landscape": { - "userAgent": "Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Mobile Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36", "viewport": { "width": 731, "height": 411 @@ -994,7 +994,7 @@ "defaultBrowserType": "chromium" }, "Pixel 2 XL": { - "userAgent": "Mozilla/5.0 (Linux; Android 8.0.0; Pixel 2 XL Build/OPD1.170816.004) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Mobile Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 8.0.0; Pixel 2 XL Build/OPD1.170816.004) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36", "viewport": { "width": 411, "height": 823 @@ -1005,7 +1005,7 @@ "defaultBrowserType": "chromium" }, "Pixel 2 XL landscape": { - "userAgent": "Mozilla/5.0 (Linux; Android 8.0.0; Pixel 2 XL Build/OPD1.170816.004) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Mobile Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 8.0.0; Pixel 2 XL Build/OPD1.170816.004) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36", "viewport": { "width": 823, "height": 411 @@ -1016,7 +1016,7 @@ "defaultBrowserType": "chromium" }, "Pixel 3": { - "userAgent": "Mozilla/5.0 (Linux; Android 9; Pixel 3 Build/PQ1A.181105.017.A1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Mobile Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 9; Pixel 3 Build/PQ1A.181105.017.A1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36", "viewport": { "width": 393, "height": 786 @@ -1027,7 +1027,7 @@ "defaultBrowserType": "chromium" }, "Pixel 3 landscape": { - "userAgent": "Mozilla/5.0 (Linux; Android 9; Pixel 3 Build/PQ1A.181105.017.A1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Mobile Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 9; Pixel 3 Build/PQ1A.181105.017.A1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36", "viewport": { "width": 786, "height": 393 @@ -1038,7 +1038,7 @@ "defaultBrowserType": "chromium" }, "Pixel 4": { - "userAgent": "Mozilla/5.0 (Linux; Android 10; Pixel 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Mobile Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 10; Pixel 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36", "viewport": { "width": 353, "height": 745 @@ -1049,7 +1049,7 @@ "defaultBrowserType": "chromium" }, "Pixel 4 landscape": { - "userAgent": "Mozilla/5.0 (Linux; Android 10; Pixel 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Mobile Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 10; Pixel 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36", "viewport": { "width": 745, "height": 353 @@ -1060,7 +1060,7 @@ "defaultBrowserType": "chromium" }, "Pixel 4a (5G)": { - "userAgent": "Mozilla/5.0 (Linux; Android 11; Pixel 4a (5G)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Mobile Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 11; Pixel 4a (5G)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36", "screen": { "width": 412, "height": 892 @@ -1075,7 +1075,7 @@ "defaultBrowserType": "chromium" }, "Pixel 4a (5G) landscape": { - "userAgent": "Mozilla/5.0 (Linux; Android 11; Pixel 4a (5G)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Mobile Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 11; Pixel 4a (5G)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36", "screen": { "height": 892, "width": 412 @@ -1090,7 +1090,7 @@ "defaultBrowserType": "chromium" }, "Pixel 5": { - "userAgent": "Mozilla/5.0 (Linux; Android 11; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Mobile Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 11; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36", "screen": { "width": 393, "height": 851 @@ -1105,7 +1105,7 @@ "defaultBrowserType": "chromium" }, "Pixel 5 landscape": { - "userAgent": "Mozilla/5.0 (Linux; Android 11; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Mobile Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 11; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36", "screen": { "width": 851, "height": 393 @@ -1120,7 +1120,7 @@ "defaultBrowserType": "chromium" }, "Moto G4": { - "userAgent": "Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Mobile Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36", "viewport": { "width": 360, "height": 640 @@ -1131,7 +1131,7 @@ "defaultBrowserType": "chromium" }, "Moto G4 landscape": { - "userAgent": "Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Mobile Safari/537.36", + "userAgent": "Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36", "viewport": { "width": 640, "height": 360 @@ -1142,7 +1142,7 @@ "defaultBrowserType": "chromium" }, "Desktop Chrome HiDPI": { - "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Safari/537.36", + "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Safari/537.36", "screen": { "width": 1792, "height": 1120 @@ -1157,7 +1157,7 @@ "defaultBrowserType": "chromium" }, "Desktop Edge HiDPI": { - "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Safari/537.36 Edg/93.0.4576.0", + "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Safari/537.36 Edg/94.0.4595.0", "screen": { "width": 1792, "height": 1120 @@ -1202,7 +1202,7 @@ "defaultBrowserType": "webkit" }, "Desktop Chrome": { - "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Safari/537.36", + "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Safari/537.36", "screen": { "width": 1920, "height": 1080 @@ -1217,7 +1217,7 @@ "defaultBrowserType": "chromium" }, "Dekstop Edge": { - "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4576.0 Safari/537.36 Edg/93.0.4576.0", + "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Safari/537.36 Edg/94.0.4595.0", "screen": { "width": 1920, "height": 1080 diff --git a/tests/browsercontext-add-cookies.spec.ts b/tests/browsercontext-add-cookies.spec.ts index 808fecc936..f43a1536dc 100644 --- a/tests/browsercontext-add-cookies.spec.ts +++ b/tests/browsercontext-add-cookies.spec.ts @@ -36,7 +36,7 @@ it('should work with expires=-1', async ({context, page}) => { expires: -1, httpOnly: false, secure: false, - sameSite: 'None', + sameSite: 'Lax', }]); await page.route('**/*', route => { route.fulfill({ body: '' }).catch(() => {}); @@ -202,11 +202,11 @@ it('should have |expires| set to |-1| for session cookies', async ({context, ser expect(cookies[0].expires).toBe(-1); }); -it('should set cookie with reasonable defaults', async ({context, server}) => { +it('should set cookie with reasonable defaults', async ({context, server, browserName}) => { await context.addCookies([{ url: server.EMPTY_PAGE, name: 'defaults', - value: '123456' + value: '123456', }]); const cookies = await context.cookies(); expect(cookies.sort((a, b) => a.name.localeCompare(b.name))).toEqual([{ @@ -217,7 +217,7 @@ it('should set cookie with reasonable defaults', async ({context, server}) => { expires: -1, httpOnly: false, secure: false, - sameSite: 'None', + sameSite: browserName === 'chromium' ? 'Lax' : 'None', }]); }); @@ -228,6 +228,7 @@ it('should set a cookie with a path', async ({context, page, server}) => { path: '/grid.html', name: 'gridcookie', value: 'GRID', + sameSite: 'Lax', }]); expect(await context.cookies()).toEqual([{ name: 'gridcookie', @@ -237,7 +238,7 @@ it('should set a cookie with a path', async ({context, page, server}) => { expires: -1, httpOnly: false, secure: false, - sameSite: 'None', + sameSite: 'Lax', }]); expect(await page.evaluate('document.cookie')).toBe('gridcookie=GRID'); await page.goto(server.EMPTY_PAGE); @@ -301,6 +302,7 @@ it('should set a cookie on a different domain', async ({context, page, server}) url: 'https://www.example.com', name: 'example-cookie', value: 'best', + sameSite: 'Lax', }]); expect(await page.evaluate('document.cookie')).toBe(''); expect(await context.cookies('https://www.example.com')).toEqual([{ @@ -311,7 +313,7 @@ it('should set a cookie on a different domain', async ({context, page, server}) expires: -1, httpOnly: false, secure: true, - sameSite: 'None', + sameSite: 'Lax', }]); }); @@ -346,7 +348,7 @@ it('should(not) block third party cookies', async ({context, page, server, brows }, server.CROSS_PROCESS_PREFIX + '/grid.html'); await page.frames()[1].evaluate(`document.cookie = 'username=John Doe'`); await page.waitForTimeout(2000); - const allowsThirdParty = browserName === 'chromium' || browserName === 'firefox'; + const allowsThirdParty = browserName === 'firefox'; const cookies = await context.cookies(server.CROSS_PROCESS_PREFIX + '/grid.html'); if (allowsThirdParty) { expect(cookies).toEqual([ diff --git a/tests/browsercontext-cookies.spec.ts b/tests/browsercontext-cookies.spec.ts index c2443e4e30..b0fcd551c2 100644 --- a/tests/browsercontext-cookies.spec.ts +++ b/tests/browsercontext-cookies.spec.ts @@ -21,7 +21,7 @@ it('should return no cookies in pristine browser context', async ({context, page expect(await context.cookies()).toEqual([]); }); -it('should get a cookie', async ({context, page, server}) => { +it('should get a cookie', async ({context, page, server, browserName}) => { await page.goto(server.EMPTY_PAGE); const documentCookie = await page.evaluate(() => { document.cookie = 'username=John Doe'; @@ -36,11 +36,11 @@ it('should get a cookie', async ({context, page, server}) => { expires: -1, httpOnly: false, secure: false, - sameSite: 'None', + sameSite: browserName === 'chromium' ? 'Lax' : 'None', }]); }); -it('should get a non-session cookie', async ({context, page, server}) => { +it('should get a non-session cookie', async ({context, page, server, browserName}) => { await page.goto(server.EMPTY_PAGE); // @see https://en.wikipedia.org/wiki/Year_2038_problem const date = +(new Date('1/1/2038')); @@ -58,7 +58,7 @@ it('should get a non-session cookie', async ({context, page, server}) => { expires: date / 1000, httpOnly: false, secure: false, - sameSite: 'None', + sameSite: browserName === 'chromium' ? 'Lax' : 'None', }]); }); @@ -99,7 +99,7 @@ it('should properly report "Lax" sameSite cookie', async ({context, page, server expect(cookies[0].sameSite).toBe('Lax'); }); -it('should get multiple cookies', async ({context, page, server}) => { +it('should get multiple cookies', async ({context, page, server, browserName}) => { await page.goto(server.EMPTY_PAGE); const documentCookie = await page.evaluate(() => { document.cookie = 'username=John Doe'; @@ -117,7 +117,7 @@ it('should get multiple cookies', async ({context, page, server}) => { expires: -1, httpOnly: false, secure: false, - sameSite: 'None', + sameSite: browserName === 'chromium' ? 'Lax' : 'None', }, { name: 'username', @@ -127,7 +127,7 @@ it('should get multiple cookies', async ({context, page, server}) => { expires: -1, httpOnly: false, secure: false, - sameSite: 'None', + sameSite: browserName === 'chromium' ? 'Lax' : 'None', }, ])); }); @@ -137,14 +137,17 @@ it('should get cookies from multiple urls', async ({context}) => { url: 'https://foo.com', name: 'doggo', value: 'woofs', + sameSite: 'None', }, { url: 'https://bar.com', name: 'catto', value: 'purrs', + sameSite: 'Lax', }, { url: 'https://baz.com', name: 'birdo', value: 'tweets', + sameSite: 'Lax', }]); const cookies = new Set(await context.cookies(['https://foo.com', 'https://baz.com'])); expect(cookies).toEqual(new Set([{ @@ -155,7 +158,7 @@ it('should get cookies from multiple urls', async ({context}) => { expires: -1, httpOnly: false, secure: true, - sameSite: 'None', + sameSite: 'Lax', }, { name: 'doggo', value: 'woofs', @@ -174,6 +177,7 @@ it('should work with subdomain cookie', async ({context, page, server}) => { path: '/', name: 'doggo', value: 'woofs', + sameSite: 'Lax', secure: true }]); expect(await context.cookies('https://foo.com')).toEqual([{ @@ -184,7 +188,7 @@ it('should work with subdomain cookie', async ({context, page, server}) => { expires: -1, httpOnly: false, secure: true, - sameSite: 'None', + sameSite: 'Lax', }]); expect(await context.cookies('https://sub.foo.com')).toEqual([{ name: 'doggo', @@ -194,7 +198,7 @@ it('should work with subdomain cookie', async ({context, page, server}) => { expires: -1, httpOnly: false, secure: true, - sameSite: 'None', + sameSite: 'Lax', }]); }); @@ -213,11 +217,13 @@ it('should return secure cookies based on HTTP(S) protocol', async ({context}) = url: 'https://foo.com', name: 'doggo', value: 'woofs', + sameSite: 'Lax', secure: true }, { url: 'http://foo.com', name: 'catto', value: 'purrs', + sameSite: 'Lax', secure: false }]); const cookies = new Set(await context.cookies('https://foo.com')); @@ -229,7 +235,7 @@ it('should return secure cookies based on HTTP(S) protocol', async ({context}) = expires: -1, httpOnly: false, secure: false, - sameSite: 'None', + sameSite: 'Lax', }, { name: 'doggo', value: 'woofs', @@ -238,7 +244,7 @@ it('should return secure cookies based on HTTP(S) protocol', async ({context}) = expires: -1, httpOnly: false, secure: true, - sameSite: 'None', + sameSite: 'Lax', }])); expect(await context.cookies('http://foo.com/')).toEqual([{ name: 'catto', @@ -248,6 +254,6 @@ it('should return secure cookies based on HTTP(S) protocol', async ({context}) = expires: -1, httpOnly: false, secure: false, - sameSite: 'None', + sameSite: 'Lax', }]); }); diff --git a/tests/browsercontext-route.spec.ts b/tests/browsercontext-route.spec.ts index 4d6f8a801f..7582af30d8 100644 --- a/tests/browsercontext-route.spec.ts +++ b/tests/browsercontext-route.spec.ts @@ -124,7 +124,7 @@ it('should support Set-Cookie header', async ({contextFactory, server, browserNa }); await page.goto('https://example.com'); expect(await context.cookies()).toEqual([{ - sameSite: 'None', + sameSite: browserName === 'chromium' ? 'Lax' : 'None', name: 'name', value: 'value', domain: '.example.com', @@ -170,7 +170,7 @@ it('should use Set-Cookie header in future requests', async ({contextFactory, se }); await page.goto(server.EMPTY_PAGE); expect(await context.cookies()).toEqual([{ - sameSite: 'None', + sameSite: browserName === 'chromium' ? 'Lax' : 'None', name: 'name', value: 'value', domain: 'localhost', diff --git a/tests/defaultbrowsercontext-1.spec.ts b/tests/defaultbrowsercontext-1.spec.ts index 703b8dbd64..10d5c0b446 100644 --- a/tests/defaultbrowsercontext-1.spec.ts +++ b/tests/defaultbrowsercontext-1.spec.ts @@ -19,7 +19,7 @@ import { playwrightTest as it, expect } from './config/browserTest'; import { verifyViewport } from './config/utils'; import fs from 'fs'; -it('context.cookies() should work', async ({server, launchPersistent}) => { +it('context.cookies() should work', async ({server, launchPersistent, browserName}) => { const {page} = await launchPersistent(); await page.goto(server.EMPTY_PAGE); const documentCookie = await page.evaluate(() => { @@ -35,7 +35,7 @@ it('context.cookies() should work', async ({server, launchPersistent}) => { expires: -1, httpOnly: false, secure: false, - sameSite: 'None', + sameSite: browserName === 'chromium' ? 'Lax' : 'None', }]); }); @@ -45,7 +45,8 @@ it('context.addCookies() should work', async ({server, launchPersistent}) => { await page.context().addCookies([{ url: server.EMPTY_PAGE, name: 'username', - value: 'John Doe' + value: 'John Doe', + sameSite: 'Lax', }]); expect(await page.evaluate(() => document.cookie)).toBe('username=John Doe'); expect(await page.context().cookies()).toEqual([{ @@ -56,7 +57,7 @@ it('context.addCookies() should work', async ({server, launchPersistent}) => { expires: -1, httpOnly: false, secure: false, - sameSite: 'None', + sameSite: 'Lax', }]); }); @@ -96,7 +97,7 @@ it('should(not) block third party cookies', async ({server, launchPersistent, br return document.cookie; }); await page.waitForTimeout(2000); - const allowsThirdParty = browserName === 'chromium' || browserName === 'firefox'; + const allowsThirdParty = browserName === 'firefox'; expect(documentCookie).toBe(allowsThirdParty ? 'username=John Doe' : ''); const cookies = await context.cookies(server.CROSS_PROCESS_PREFIX + '/grid.html'); if (allowsThirdParty) { diff --git a/tests/headful.spec.ts b/tests/headful.spec.ts index d2ea9dce5e..c6a7a00964 100644 --- a/tests/headful.spec.ts +++ b/tests/headful.spec.ts @@ -85,7 +85,7 @@ it('should(not) block third party cookies', async ({browserType, browserOptions, return document.cookie; }); await page.waitForTimeout(2000); - const allowsThirdParty = browserName === 'chromium' || browserName === 'firefox'; + const allowsThirdParty = browserName === 'firefox'; expect(documentCookie).toBe(allowsThirdParty ? 'username=John Doe' : ''); const cookies = await page.context().cookies(server.CROSS_PROCESS_PREFIX + '/grid.html'); if (allowsThirdParty) { diff --git a/types/protocol.d.ts b/types/protocol.d.ts index 9bc8814fc5..7305991c9a 100644 --- a/types/protocol.d.ts +++ b/types/protocol.d.ts @@ -5938,6 +5938,10 @@ text, HTML markup or any other data. } export interface DragData { items: DragDataItem[]; + /** + * List of filenames that should be included when dropping + */ + files?: string[]; /** * Bit field representing allowed drag operations. Copy = 1, Link = 2, Move = 16 */ @@ -6064,6 +6068,35 @@ for example an emoji keyboard or an IME. } export type insertTextReturnValue = { } + /** + * This method sets the current candidate text for ime. +Use imeCommitComposition to commit the final text. +Use imeSetComposition with empty string as text to cancel composition. + */ + export type imeSetCompositionParameters = { + /** + * The text to insert + */ + text: string; + /** + * selection start + */ + selectionStart: number; + /** + * selection end + */ + selectionEnd: number; + /** + * replacement start + */ + replacementStart?: number; + /** + * replacement end + */ + replacementEnd?: number; + } + export type imeSetCompositionReturnValue = { + } /** * Dispatches a mouse event to the page. */ @@ -8368,6 +8401,11 @@ are represented by the invalid cookie line string instead of a proper cookie. established the connection, so we can't send it in `requestWillBeSentExtraInfo`. */ resourceIPAddressSpace: IPAddressSpace; + /** + * The status code of the response. This is useful in cases the request failed and no responseReceived +event is triggered, which is the case for, e.g., CORS errors. + */ + statusCode: number; /** * Raw response header text as it was received over the wire. The raw text may not always be available, such as in the case of HTTP/2 or QUIC. @@ -9800,7 +9838,7 @@ Backend then generates 'inspectNodeRequested' event upon element selection. * All Permissions Policy features. This enum should match the one defined in third_party/blink/renderer/core/permissions_policy/permissions_policy_features.json5. */ - export type PermissionsPolicyFeature = "accelerometer"|"ambient-light-sensor"|"attribution-reporting"|"autoplay"|"camera"|"ch-dpr"|"ch-device-memory"|"ch-downlink"|"ch-ect"|"ch-lang"|"ch-prefers-color-scheme"|"ch-rtt"|"ch-ua"|"ch-ua-arch"|"ch-ua-bitness"|"ch-ua-platform"|"ch-ua-model"|"ch-ua-mobile"|"ch-ua-full-version"|"ch-ua-platform-version"|"ch-viewport-width"|"ch-width"|"clipboard-read"|"clipboard-write"|"cross-origin-isolated"|"direct-sockets"|"display-capture"|"document-domain"|"encrypted-media"|"execution-while-out-of-viewport"|"execution-while-not-rendered"|"focus-without-user-activation"|"fullscreen"|"frobulate"|"gamepad"|"geolocation"|"gyroscope"|"hid"|"idle-detection"|"interest-cohort"|"magnetometer"|"microphone"|"midi"|"otp-credentials"|"payment"|"picture-in-picture"|"publickey-credentials-get"|"screen-wake-lock"|"serial"|"shared-autofill"|"storage-access-api"|"sync-xhr"|"trust-token-redemption"|"usb"|"vertical-scroll"|"web-share"|"window-placement"|"xr-spatial-tracking"; + export type PermissionsPolicyFeature = "accelerometer"|"ambient-light-sensor"|"attribution-reporting"|"autoplay"|"camera"|"ch-dpr"|"ch-device-memory"|"ch-downlink"|"ch-ect"|"ch-lang"|"ch-prefers-color-scheme"|"ch-rtt"|"ch-ua"|"ch-ua-arch"|"ch-ua-bitness"|"ch-ua-platform"|"ch-ua-model"|"ch-ua-mobile"|"ch-ua-full-version"|"ch-ua-platform-version"|"ch-ua-reduced"|"ch-viewport-width"|"ch-width"|"clipboard-read"|"clipboard-write"|"cross-origin-isolated"|"direct-sockets"|"display-capture"|"document-domain"|"encrypted-media"|"execution-while-out-of-viewport"|"execution-while-not-rendered"|"focus-without-user-activation"|"fullscreen"|"frobulate"|"gamepad"|"geolocation"|"gyroscope"|"hid"|"idle-detection"|"interest-cohort"|"magnetometer"|"microphone"|"midi"|"otp-credentials"|"payment"|"picture-in-picture"|"publickey-credentials-get"|"screen-wake-lock"|"serial"|"shared-autofill"|"storage-access-api"|"sync-xhr"|"trust-token-redemption"|"usb"|"vertical-scroll"|"web-share"|"window-placement"|"xr-spatial-tracking"; /** * Reason for a permissions policy feature to be disabled. */ @@ -10256,7 +10294,7 @@ Example URLs: http://www.google.com/file.html -> "google.com" /** * List of not restored reasons for back-forward cache. */ - export type BackForwardCacheNotRestoredReason = "NotMainFrame"|"BackForwardCacheDisabled"|"RelatedActiveContentsExist"|"HTTPStatusNotOK"|"SchemeNotHTTPOrHTTPS"|"Loading"|"WasGrantedMediaAccess"|"DisableForRenderFrameHostCalled"|"DomainNotAllowed"|"HTTPMethodNotGET"|"SubframeIsNavigating"|"Timeout"|"CacheLimit"|"JavaScriptExecution"|"RendererProcessKilled"|"RendererProcessCrashed"|"GrantedMediaStreamAccess"|"SchedulerTrackedFeatureUsed"|"ConflictingBrowsingInstance"|"CacheFlushed"|"ServiceWorkerVersionActivation"|"SessionRestored"|"ServiceWorkerPostMessage"|"EnteredBackForwardCacheBeforeServiceWorkerHostAdded"|"RenderFrameHostReused_SameSite"|"RenderFrameHostReused_CrossSite"|"ServiceWorkerClaim"|"IgnoreEventAndEvict"|"HaveInnerContents"|"TimeoutPuttingInCache"|"BackForwardCacheDisabledByLowMemory"|"BackForwardCacheDisabledByCommandLine"|"NetworkRequestDatapipeDrainedAsBytesConsumer"|"NetworkRequestRedirected"|"NetworkRequestTimeout"|"NetworkExceedsBufferLimit"|"NavigationCancelledWhileRestoring"|"NotMostRecentNavigationEntry"|"BackForwardCacheDisabledForPrerender"|"UserAgentOverrideDiffers"|"ForegroundCacheLimit"|"BrowsingInstanceNotSwapped"|"BackForwardCacheDisabledForDelegate"|"OptInUnloadHeaderNotPresent"|"UnloadHandlerExistsInSubFrame"|"ServiceWorkerUnregistration"|"CacheControlNoStore"|"CacheControlNoStoreCookieModified"|"CacheControlNoStoreHTTPOnlyCookieModified"|"WebSocket"|"WebRTC"|"MainResourceHasCacheControlNoStore"|"MainResourceHasCacheControlNoCache"|"SubresourceHasCacheControlNoStore"|"SubresourceHasCacheControlNoCache"|"ContainsPlugins"|"DocumentLoaded"|"DedicatedWorkerOrWorklet"|"OutstandingNetworkRequestOthers"|"OutstandingIndexedDBTransaction"|"RequestedNotificationsPermission"|"RequestedMIDIPermission"|"RequestedAudioCapturePermission"|"RequestedVideoCapturePermission"|"RequestedBackForwardCacheBlockedSensors"|"RequestedBackgroundWorkPermission"|"BroadcastChannel"|"IndexedDBConnection"|"WebXR"|"SharedWorker"|"WebLocks"|"WebHID"|"WebShare"|"RequestedStorageAccessGrant"|"WebNfc"|"WebFileSystem"|"OutstandingNetworkRequestFetch"|"OutstandingNetworkRequestXHR"|"AppBanner"|"Printing"|"WebDatabase"|"PictureInPicture"|"Portal"|"SpeechRecognizer"|"IdleManager"|"PaymentManager"|"SpeechSynthesis"|"KeyboardLock"|"WebOTPService"|"OutstandingNetworkRequestDirectSocket"|"IsolatedWorldScript"|"InjectedStyleSheet"|"MediaSessionImplOnServiceCreated"|"Unknown"; + export type BackForwardCacheNotRestoredReason = "NotMainFrame"|"BackForwardCacheDisabled"|"RelatedActiveContentsExist"|"HTTPStatusNotOK"|"SchemeNotHTTPOrHTTPS"|"Loading"|"WasGrantedMediaAccess"|"DisableForRenderFrameHostCalled"|"DomainNotAllowed"|"HTTPMethodNotGET"|"SubframeIsNavigating"|"Timeout"|"CacheLimit"|"JavaScriptExecution"|"RendererProcessKilled"|"RendererProcessCrashed"|"GrantedMediaStreamAccess"|"SchedulerTrackedFeatureUsed"|"ConflictingBrowsingInstance"|"CacheFlushed"|"ServiceWorkerVersionActivation"|"SessionRestored"|"ServiceWorkerPostMessage"|"EnteredBackForwardCacheBeforeServiceWorkerHostAdded"|"RenderFrameHostReused_SameSite"|"RenderFrameHostReused_CrossSite"|"ServiceWorkerClaim"|"IgnoreEventAndEvict"|"HaveInnerContents"|"TimeoutPuttingInCache"|"BackForwardCacheDisabledByLowMemory"|"BackForwardCacheDisabledByCommandLine"|"NetworkRequestDatapipeDrainedAsBytesConsumer"|"NetworkRequestRedirected"|"NetworkRequestTimeout"|"NetworkExceedsBufferLimit"|"NavigationCancelledWhileRestoring"|"NotMostRecentNavigationEntry"|"BackForwardCacheDisabledForPrerender"|"UserAgentOverrideDiffers"|"ForegroundCacheLimit"|"BrowsingInstanceNotSwapped"|"BackForwardCacheDisabledForDelegate"|"OptInUnloadHeaderNotPresent"|"UnloadHandlerExistsInSubFrame"|"ServiceWorkerUnregistration"|"CacheControlNoStore"|"CacheControlNoStoreCookieModified"|"CacheControlNoStoreHTTPOnlyCookieModified"|"NoResponseHead"|"WebSocket"|"WebRTC"|"MainResourceHasCacheControlNoStore"|"MainResourceHasCacheControlNoCache"|"SubresourceHasCacheControlNoStore"|"SubresourceHasCacheControlNoCache"|"ContainsPlugins"|"DocumentLoaded"|"DedicatedWorkerOrWorklet"|"OutstandingNetworkRequestOthers"|"OutstandingIndexedDBTransaction"|"RequestedNotificationsPermission"|"RequestedMIDIPermission"|"RequestedAudioCapturePermission"|"RequestedVideoCapturePermission"|"RequestedBackForwardCacheBlockedSensors"|"RequestedBackgroundWorkPermission"|"BroadcastChannel"|"IndexedDBConnection"|"WebXR"|"SharedWorker"|"WebLocks"|"WebHID"|"WebShare"|"RequestedStorageAccessGrant"|"WebNfc"|"WebFileSystem"|"OutstandingNetworkRequestFetch"|"OutstandingNetworkRequestXHR"|"AppBanner"|"Printing"|"WebDatabase"|"PictureInPicture"|"Portal"|"SpeechRecognizer"|"IdleManager"|"PaymentManager"|"SpeechSynthesis"|"KeyboardLock"|"WebOTPService"|"OutstandingNetworkRequestDirectSocket"|"IsolatedWorldScript"|"InjectedStyleSheet"|"MediaSessionImplOnServiceCreated"|"Unknown"; /** * Types of not restored reasons for back-forward cache. */ @@ -16067,6 +16105,10 @@ call). export type inspectRequestedPayload = { object: RemoteObject; hints: { [key: string]: string }; + /** + * Identifier of the context where the call was made. + */ + executionContextId?: ExecutionContextId; } /** @@ -16957,6 +16999,7 @@ unsubscribes current runtime agent from Runtime.bindingCalled notifications. "Input.dispatchDragEvent": Input.dispatchDragEventParameters; "Input.dispatchKeyEvent": Input.dispatchKeyEventParameters; "Input.insertText": Input.insertTextParameters; + "Input.imeSetComposition": Input.imeSetCompositionParameters; "Input.dispatchMouseEvent": Input.dispatchMouseEventParameters; "Input.dispatchTouchEvent": Input.dispatchTouchEventParameters; "Input.emulateTouchFromMouseEvent": Input.emulateTouchFromMouseEventParameters; @@ -17476,6 +17519,7 @@ unsubscribes current runtime agent from Runtime.bindingCalled notifications. "Input.dispatchDragEvent": Input.dispatchDragEventReturnValue; "Input.dispatchKeyEvent": Input.dispatchKeyEventReturnValue; "Input.insertText": Input.insertTextReturnValue; + "Input.imeSetComposition": Input.imeSetCompositionReturnValue; "Input.dispatchMouseEvent": Input.dispatchMouseEventReturnValue; "Input.dispatchTouchEvent": Input.dispatchTouchEventReturnValue; "Input.emulateTouchFromMouseEvent": Input.emulateTouchFromMouseEventReturnValue;