WebKit Bugzilla
Attachment 341326 Details for
Bug 184897
: Web Inspector: Annotate Same-Site cookies
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch and layout test
bug-184897-20180525141646.patch (text/plain), 47.59 KB, created by
Daniel Bates
on 2018-05-25 14:16:46 PDT
(
hide
)
Description:
Patch and layout test
Filename:
MIME Type:
Creator:
Daniel Bates
Created:
2018-05-25 14:16:46 PDT
Size:
47.59 KB
patch
obsolete
>Subversion Revision: 232196 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index d213b1b79848c99344f2576d6cfdad5767216fca..fa6be1d4332d16afc4bfe18134e64ce7958ca4a4 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,15 @@ >+2018-05-25 Daniel Bates <dabates@apple.com> >+ >+ Web Inspector: Annotate Same-Site cookies >+ https://bugs.webkit.org/show_bug.cgi?id=184897 >+ <rdar://problem/35178209> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Update protocol to include cookie Same-Site policy. >+ >+ * inspector/protocol/Page.json: >+ > 2018-05-25 Saam Barati <sbarati@apple.com> > > Have a memory test where we can validate JSCs mini memory mode >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 6932229c93af1bbfe4cf578a7362d62a8bbfcb87..b2ed857dc0c5e67c175937655628552889d6c3b3 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,26 @@ >+2018-05-25 Daniel Bates <dabates@apple.com> >+ >+ Web Inspector: Annotate Same-Site cookies >+ https://bugs.webkit.org/show_bug.cgi?id=184897 >+ <rdar://problem/35178209> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Store and retrieve the Same-Site cookie policy from CFNetwork. >+ >+ * inspector/agents/InspectorPageAgent.cpp: >+ (WebCore::cookieSameSitePolicyJSON): Added. >+ (WebCore::buildObjectForCookie): Modified to include cookie Same-Site policy. >+ * platform/Cookie.h: >+ (WebCore::Cookie::encode const): Encode Same-Site policy. >+ (WebCore::Cookie::decode): Decode Same-Site policy. >+ * platform/network/cocoa/CookieCocoa.mm: >+ (WebCore::portStringFromVector): >+ (WebCore::coreSameSitePolicy): >+ (WebCore::nsSameSitePolicy): >+ (WebCore::Cookie::operator NSHTTPCookie * _Nullable const): >+ (WebCore::Cookie::operator NSHTTPCookie * const): Deleted. >+ > 2018-05-24 Dean Jackson <dino@apple.com> > > Need to provide a way to feature detect support for system preview >diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 7ef7991b67133eb0b07e37024b446bd8fbb30be8..69f2a803e6c31373a08479b99692b6f9a17bec47 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,38 @@ >+2018-05-25 Daniel Bates <dabates@apple.com> >+ >+ Web Inspector: Annotate Same-Site cookies >+ https://bugs.webkit.org/show_bug.cgi?id=184897 >+ <rdar://problem/35178209> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add a new column for the value of the Same-Site cookie attribute to the resource cookie content >+ view (shown for a resource under the Network tab) and cookie storage content view (shown under >+ the Storage tab). >+ >+ The SameSite column in the resource cookie content view reflects the parsing of the Same-Site >+ attribute from the HTTP response by Web Inspector. This parsing is materially consistent with >+ the parsing of the SameSite atttribute in CFNetwork. The Same-Site column in the cookie storage >+ content view reflects the Same-Site cookie policy associated with the cookies provided by the >+ network stack, if supported. This column will be blank on systems whose network stack does not >+ support Same-Site cookies (e.g libsoup). >+ >+ * Localizations/en.lproj/localizedStrings.js: >+ * UserInterface/Controllers/HARBuilder.js: >+ (WI.HARBuilder.cookies): >+ * UserInterface/Models/Cookie.js: >+ (WI.Cookie): >+ (WI.Cookie.displayNameForSameSiteType): >+ (WI.Cookie.parseSameSiteAttributeValue): >+ (WI.Cookie.parseSetCookieResponseHeader): >+ * UserInterface/Views/CookieStorageContentView.js: >+ (WI.CookieStorageContentView.prototype._rebuildTable): >+ (WI.CookieStorageContentView.prototype._sortDataGrid): >+ * UserInterface/Views/ResourceCookiesContentView.js: >+ (WI.ResourceCookiesContentView.prototype.tablePopulateCell): >+ (WI.ResourceCookiesContentView.prototype._generateSortComparator): >+ (WI.ResourceCookiesContentView.prototype._refreshResponseCookiesSection): >+ > 2018-05-25 Matt Baker <mattbaker@apple.com> > > Web Inspector: Popover dismissed while attempting to move cursor inside >diff --git a/Source/JavaScriptCore/inspector/protocol/Page.json b/Source/JavaScriptCore/inspector/protocol/Page.json >index 8f22c5315ca45db8d5a3f1a964fc12eae4135786..2aa488ef65c86cbaf790e37983ab95d39098727b 100644 >--- a/Source/JavaScriptCore/inspector/protocol/Page.json >+++ b/Source/JavaScriptCore/inspector/protocol/Page.json >@@ -15,6 +15,12 @@ > "enum": ["Viewport", "Page"], > "description": "Coordinate system used by supplied coordinates." > }, >+ { >+ "id": "CookieSameSitePolicy", >+ "type": "string", >+ "enum": ["None", "Lax", "Strict"], >+ "description": "Same-Site policy of a cookie." >+ }, > { > "id": "Frame", > "type": "object", >@@ -76,7 +82,8 @@ > { "name": "size", "type": "integer", "description": "Cookie size." }, > { "name": "httpOnly", "type": "boolean", "description": "True if cookie is http-only." }, > { "name": "secure", "type": "boolean", "description": "True if cookie is secure." }, >- { "name": "session", "type": "boolean", "description": "True in case of session cookie." } >+ { "name": "session", "type": "boolean", "description": "True in case of session cookie." }, >+ { "name": "sameSite", "$ref": "CookieSameSitePolicy", "description": "Cookie Same-Site policy." } > ] > } > ], >diff --git a/Source/WebCore/inspector/agents/InspectorPageAgent.cpp b/Source/WebCore/inspector/agents/InspectorPageAgent.cpp >index 58b7b6e441946ff840cbecb579061c3e30bd2db7..2352161a82eda7186f31c61baaef1608457fa47e 100644 >--- a/Source/WebCore/inspector/agents/InspectorPageAgent.cpp >+++ b/Source/WebCore/inspector/agents/InspectorPageAgent.cpp >@@ -335,6 +335,20 @@ void InspectorPageAgent::navigate(ErrorString&, const String& url) > frame.loader().changeLocation(WTFMove(frameLoadRequest)); > } > >+static Inspector::Protocol::Page::CookieSameSitePolicy cookieSameSitePolicyJSON(Cookie::SameSitePolicy policy) >+{ >+ switch (policy) { >+ case Cookie::SameSitePolicy::None: >+ return Inspector::Protocol::Page::CookieSameSitePolicy::None; >+ case Cookie::SameSitePolicy::Lax: >+ return Inspector::Protocol::Page::CookieSameSitePolicy::Lax; >+ case Cookie::SameSitePolicy::Strict: >+ return Inspector::Protocol::Page::CookieSameSitePolicy::Strict; >+ } >+ ASSERT_NOT_REACHED(); >+ return Inspector::Protocol::Page::CookieSameSitePolicy::None; >+} >+ > static Ref<Inspector::Protocol::Page::Cookie> buildObjectForCookie(const Cookie& cookie) > { > return Inspector::Protocol::Page::Cookie::create() >@@ -347,6 +361,7 @@ static Ref<Inspector::Protocol::Page::Cookie> buildObjectForCookie(const Cookie& > .setHttpOnly(cookie.httpOnly) > .setSecure(cookie.secure) > .setSession(cookie.session) >+ .setSameSite(cookieSameSitePolicyJSON(cookie.sameSite)) > .release(); > } > >diff --git a/Source/WebCore/platform/Cookie.h b/Source/WebCore/platform/Cookie.h >index 67d227c6e148382d316be4675ace007905c955ad..b21224f1cb9a0da9af586ab9b04f3912576ecd94 100644 >--- a/Source/WebCore/platform/Cookie.h >+++ b/Source/WebCore/platform/Cookie.h >@@ -1,6 +1,6 @@ > /* > * Copyright (C) 2009 Joseph Pecoraro. All rights reserved. >- * Copyright (C) 2017 Apple Inc. All rights reserved. >+ * Copyright (C) 2017-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -27,6 +27,7 @@ > #pragma once > > #include "URL.h" >+#include <wtf/EnumTraits.h> > #include <wtf/text/StringHash.h> > #include <wtf/text/WTFString.h> > >@@ -85,6 +86,9 @@ struct Cookie { > String comment; > URL commentURL; > Vector<uint16_t> ports; >+ >+ enum class SameSitePolicy { None, Lax, Strict }; >+ SameSitePolicy sameSite { SameSitePolicy::None }; > }; > > struct CookieHash { >@@ -115,6 +119,7 @@ void Cookie::encode(Encoder& encoder) const > encoder << comment; > encoder << commentURL; > encoder << ports; >+ encoder << sameSite; > } > > template<class Decoder> >@@ -145,6 +150,8 @@ std::optional<Cookie> Cookie::decode(Decoder& decoder) > return std::nullopt; > if (!decoder.decode(cookie.ports)) > return std::nullopt; >+ if (!decoder.decode(cookie.sameSite)) >+ return std::nullopt; > return cookie; > } > >@@ -160,4 +167,12 @@ namespace WTF { > static void constructDeletedValue(WebCore::Cookie& slot) { slot = WebCore::Cookie(WTF::HashTableDeletedValue); } > static bool isDeletedValue(const WebCore::Cookie& slot) { return slot.name.isHashTableDeletedValue(); } > }; >+ template<> struct EnumTraits<WebCore::Cookie::SameSitePolicy> { >+ using values = EnumValues< >+ WebCore::Cookie::SameSitePolicy, >+ WebCore::Cookie::SameSitePolicy::None, >+ WebCore::Cookie::SameSitePolicy::Lax, >+ WebCore::Cookie::SameSitePolicy::Strict >+ >; >+}; > } >diff --git a/Source/WebCore/platform/network/cocoa/CookieCocoa.mm b/Source/WebCore/platform/network/cocoa/CookieCocoa.mm >index 44173f4d982afa112934ccccd864abe38b6d0494..174c7842537835835c4559183ecbaa0d9610a839 100644 >--- a/Source/WebCore/platform/network/cocoa/CookieCocoa.mm >+++ b/Source/WebCore/platform/network/cocoa/CookieCocoa.mm >@@ -26,6 +26,19 @@ > #import "config.h" > #import "Cookie.h" > >+// FIXME: Remove NS_ASSUME_NONNULL_BEGIN/END and all _Nullable annotations once we remove the NSHTTPCookie forward declaration below. >+NS_ASSUME_NONNULL_BEGIN >+ >+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 && __MAC_OS_X_VERSION_MAX_ALLOWED < 101500) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000 && __IPHONE_OS_VERSION_MAX_ALLOWED < 130000) >+typedef NSString * NSHTTPCookieStringPolicy; >+@interface NSHTTPCookie (Staging) >+@property (nullable, readonly, copy) NSHTTPCookieStringPolicy sameSitePolicy; >+@end >+ >+static NSString * const NSHTTPCookieSameSiteLax = @"lax"; >+static NSString * const NSHTTPCookieSameSiteStrict = @"strict"; >+#endif >+ > namespace WebCore { > > static Vector<uint16_t> portVectorFromList(NSArray<NSNumber *> *portList) >@@ -39,7 +52,7 @@ static Vector<uint16_t> portVectorFromList(NSArray<NSNumber *> *portList) > return ports; > } > >-static NSString *portStringFromVector(const Vector<uint16_t>& ports) >+static NSString * _Nullable portStringFromVector(const Vector<uint16_t>& ports) > { > if (ports.isEmpty()) > return nil; >@@ -71,6 +84,32 @@ static double cookieCreated(NSHTTPCookie *cookie) > return 0; > } > >+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000) >+static Cookie::SameSitePolicy coreSameSitePolicy(NSHTTPCookieStringPolicy _Nullable policy) >+{ >+ if (!policy) >+ return Cookie::SameSitePolicy::None; >+ if ([policy isEqualToString:NSHTTPCookieSameSiteLax]) >+ return Cookie::SameSitePolicy::Lax; >+ if ([policy isEqualToString:NSHTTPCookieSameSiteStrict]) >+ return Cookie::SameSitePolicy::Strict; >+ ASSERT_NOT_REACHED(); >+ return Cookie::SameSitePolicy::None; >+} >+ >+static NSHTTPCookieStringPolicy _Nullable nsSameSitePolicy(Cookie::SameSitePolicy policy) >+{ >+ switch (policy) { >+ case Cookie::SameSitePolicy::None: >+ return nil; >+ case Cookie::SameSitePolicy::Lax: >+ return NSHTTPCookieSameSiteLax; >+ case Cookie::SameSitePolicy::Strict: >+ return NSHTTPCookieSameSiteStrict; >+ } >+} >+#endif >+ > Cookie::Cookie(NSHTTPCookie *cookie) > : name { cookie.name } > , value { cookie.value } >@@ -85,14 +124,18 @@ Cookie::Cookie(NSHTTPCookie *cookie) > , commentURL { cookie.commentURL } > , ports { portVectorFromList(cookie.portList) } > { >+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000) >+ if ([cookie respondsToSelector:@selector(sameSitePolicy)]) >+ sameSite = coreSameSitePolicy(cookie.sameSitePolicy); >+#endif > } > >-Cookie::operator NSHTTPCookie *() const >+Cookie::operator NSHTTPCookie * _Nullable () const > { > if (isNull()) > return nil; > >- NSMutableDictionary *properties = [NSMutableDictionary dictionaryWithCapacity:13]; >+ NSMutableDictionary *properties = [NSMutableDictionary dictionaryWithCapacity:14]; > > if (!comment.isNull()) > [properties setObject:(NSString *)comment forKey:NSHTTPCookieComment]; >@@ -134,6 +177,11 @@ Cookie::operator NSHTTPCookie *() const > if (httpOnly) > [properties setObject:@YES forKey:@"HttpOnly"]; > >+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000) >+ if (auto* sameSitePolicy = nsSameSitePolicy(sameSite)) >+ [properties setObject:sameSitePolicy forKey:@"SameSite"]; >+#endif >+ > [properties setObject:@"1" forKey:NSHTTPCookieVersion]; > > return [NSHTTPCookie cookieWithProperties:properties]; >@@ -156,4 +204,6 @@ unsigned Cookie::hash() const > return static_cast<NSHTTPCookie *>(*this).hash; > } > >+NS_ASSUME_NONNULL_END >+ > } // namespace WebCore >diff --git a/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js b/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >index 0dace4f5911fe1108055a00221a76df7516be3b4..77e742002f491ccb5c0cf05d44f6abc210820e5a 100644 >--- a/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >+++ b/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >@@ -811,6 +811,7 @@ localizedStrings["Reveal in Sources Tab"] = "Reveal in Sources Tab"; > localizedStrings["Right"] = "Right"; > localizedStrings["Role"] = "Role"; > localizedStrings["Rule"] = "Rule"; >+localizedStrings["Same-Site"] = "Same-Site"; > localizedStrings["Samples"] = "Samples"; > localizedStrings["Save File"] = "Save File"; > localizedStrings["Save Selected"] = "Save Selected"; >diff --git a/Source/WebInspectorUI/UserInterface/Controllers/HARBuilder.js b/Source/WebInspectorUI/UserInterface/Controllers/HARBuilder.js >index c3d4054b13744ea7e95f5dcda64996d2e1c7ce20..af6ea6a756446c78f4fec884daa1fc3ff04f3bb7 100644 >--- a/Source/WebInspectorUI/UserInterface/Controllers/HARBuilder.js >+++ b/Source/WebInspectorUI/UserInterface/Controllers/HARBuilder.js >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2017 Apple Inc. All rights reserved. >+ * Copyright (C) 2017-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -177,6 +177,8 @@ WI.HARBuilder = class HARBuilder > json.expires = HARBuilder.date(cookie.expirationDate(requestSentDate)); > json.httpOnly = cookie.httpOnly; > json.secure = cookie.secure; >+ if (cookie.sameSite !== WI.Cookie.SameSiteType.None) >+ json.sameSite = cookie.sameSite; > } > > result.push(json); >diff --git a/Source/WebInspectorUI/UserInterface/Models/Cookie.js b/Source/WebInspectorUI/UserInterface/Models/Cookie.js >index 84c1a102244c29fb03fd954d119f0f74daa00d3d..cd2ad4e026ea6f4928f54d07b5e7f6cd850314b9 100644 >--- a/Source/WebInspectorUI/UserInterface/Models/Cookie.js >+++ b/Source/WebInspectorUI/UserInterface/Models/Cookie.js >@@ -25,7 +25,7 @@ > > WI.Cookie = class Cookie > { >- constructor(type, name, value, raw, expires, maxAge, path, domain, secure, httpOnly) >+ constructor(type, name, value, raw, expires, maxAge, path, domain, secure, httpOnly, sameSite) > { > console.assert(Object.values(WI.Cookie.Type).includes(type)); > console.assert(typeof name === "string"); >@@ -37,6 +37,7 @@ WI.Cookie = class Cookie > console.assert(!domain || typeof domain === "string"); > console.assert(!secure || typeof secure === "boolean"); > console.assert(!httpOnly || typeof httpOnly === "boolean"); >+ console.assert(!sameSite || Object.values(WI.Cookie.SameSiteType).includes(sameSite)); > > this.type = type; > this.name = name || ""; >@@ -50,6 +51,7 @@ WI.Cookie = class Cookie > this.domain = domain || null; > this.secure = secure || false; > this.httpOnly = httpOnly || false; >+ this.sameSite = sameSite || WI.Cookie.SameSiteType.None; > } > } > >@@ -99,6 +101,35 @@ WI.Cookie = class Cookie > return cookies; > } > >+ static displayNameForSameSiteType(sameSiteType) >+ { >+ switch (sameSiteType) { >+ case WI.Cookie.SameSiteType.None: >+ return WI.unlocalizedString("None"); >+ case WI.Cookie.SameSiteType.Lax: >+ return WI.unlocalizedString("Lax"); >+ case WI.Cookie.SameSiteType.Strict: >+ return WI.unlocalizedString("Strict"); >+ default: >+ console.error("Invalid SameSite type", sameSiteType); >+ return sameSiteType; >+ } >+ } >+ >+ // Derived from <https://tools.ietf.org/html/draft-west-first-party-cookies-06#section-3.2>. >+ static parseSameSiteAttributeValue(attributeValue) >+ { >+ if (!attributeValue) >+ return WI.Cookie.SameSiteType.Strict; >+ switch (attributeValue.toLowerCase()) { >+ case "lax": >+ return WI.Cookie.SameSiteType.Lax; >+ case "strict": >+ default: >+ return WI.Cookie.SameSiteType.Strict; >+ } >+ } >+ > static parseSetCookieResponseHeader(header) > { > if (!header) >@@ -122,6 +153,7 @@ WI.Cookie = class Cookie > let domain = null; > let secure = false; > let httpOnly = false; >+ let sameSite = WI.Cookie.SameSiteType.None; > > // Parse Attributes > let remaining = header.substr(nameValueMatch[0].length); >@@ -171,13 +203,16 @@ WI.Cookie = class Cookie > console.assert(!attributeValue); > httpOnly = true; > break; >+ case "samesite": >+ sameSite = WI.Cookie.parseSameSiteAttributeValue(attributeValue); >+ break; > default: > console.warn("Unknown Cookie attribute:", attribute); > break; > } > } > >- return new WI.Cookie(WI.Cookie.Type.Response, name, value, header, expires, maxAge, path, domain, secure, httpOnly); >+ return new WI.Cookie(WI.Cookie.Type.Response, name, value, header, expires, maxAge, path, domain, secure, httpOnly, sameSite); > } > } > >@@ -185,3 +220,10 @@ WI.Cookie.Type = { > Request: "request", > Response: "response", > }; >+ >+// Keep these in sync with the "CookieSameSitePolicy" enum defined by the "Page" domain. >+WI.Cookie.SameSiteType = { >+ None: "None", >+ Lax: "Lax", >+ Strict: "Strict", >+}; >diff --git a/Source/WebInspectorUI/UserInterface/Views/CookieStorageContentView.js b/Source/WebInspectorUI/UserInterface/Views/CookieStorageContentView.js >index 337540477a5323cf08dd5d693fcd40f493fb673b..8bec9a9e151f640561767ff0d445dd80e5df8991 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/CookieStorageContentView.js >+++ b/Source/WebInspectorUI/UserInterface/Views/CookieStorageContentView.js >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2013, 2015 Apple Inc. All rights reserved. >+ * Copyright (C) 2013, 2015, 2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -73,7 +73,7 @@ WI.CookieStorageContentView = class CookieStorageContentView extends WI.ContentV > { > // FIXME <https://webkit.org/b/151400>: If there are no cookies, add placeholder explanatory text. > if (!this._dataGrid) { >- var columns = {name: {}, value: {}, domain: {}, path: {}, expires: {}, size: {}, http: {}, secure: {}}; >+ var columns = {name: {}, value: {}, domain: {}, path: {}, expires: {}, size: {}, http: {}, secure: {}, sameSite: {} }; > > columns.name.title = WI.UIString("Name"); > columns.name.sortable = true; >@@ -87,30 +87,34 @@ WI.CookieStorageContentView = class CookieStorageContentView extends WI.ContentV > > columns.domain.title = WI.UIString("Domain"); > columns.domain.sortable = true; >- columns.domain.width = "7%"; >+ columns.domain.width = "6%"; > > columns.path.title = WI.UIString("Path"); > columns.path.sortable = true; >- columns.path.width = "7%"; >+ columns.path.width = "6%"; > > columns.expires.title = WI.UIString("Expires"); > columns.expires.sortable = true; >- columns.expires.width = "7%"; >+ columns.expires.width = "6%"; > > columns.size.title = WI.UIString("Size"); > columns.size.aligned = "right"; > columns.size.sortable = true; >- columns.size.width = "7%"; >+ columns.size.width = "6%"; > > columns.http.title = WI.UIString("HTTP"); > columns.http.aligned = "centered"; > columns.http.sortable = true; >- columns.http.width = "7%"; >+ columns.http.width = "6%"; > > columns.secure.title = WI.UIString("Secure"); > columns.secure.aligned = "centered"; > columns.secure.sortable = true; >- columns.secure.width = "7%"; >+ columns.secure.width = "6%"; >+ >+ columns.sameSite.title = WI.UIString("Same-Site"); >+ columns.sameSite.sortable = true; >+ columns.sameSite.width = "6%"; > > this._dataGrid = new WI.DataGrid(columns, null, this._deleteCallback.bind(this)); > this._dataGrid.columnChooserEnabled = true; >@@ -125,7 +129,7 @@ WI.CookieStorageContentView = class CookieStorageContentView extends WI.ContentV > console.assert(this._dataGrid); > this._dataGrid.removeChildren(); > >- for (var cookie of this._cookies) { >+ for (let cookie of this._cookies) { > const checkmark = "\u2713"; > var data = { > name: cookie.name, >@@ -136,6 +140,7 @@ WI.CookieStorageContentView = class CookieStorageContentView extends WI.ContentV > size: Number.bytesToString(cookie.size), > http: cookie.httpOnly ? checkmark : "", > secure: cookie.secure ? checkmark : "", >+ sameSite: cookie.sameSite ? WI.Cookie.displayNameForSameSiteType(WI.Cookie.parseSameSiteAttributeValue(cookie.sameSite)) : "", > }; > > if (cookie.type !== WI.CookieType.Request) >@@ -203,6 +208,7 @@ WI.CookieStorageContentView = class CookieStorageContentView extends WI.ContentV > case "size": comparator = numberCompare.bind(this, "size"); break; > case "http": comparator = localeCompare.bind(this, "http"); break; > case "secure": comparator = localeCompare.bind(this, "secure"); break; >+ case "sameSite": comparator = localeCompare.bind(this, "sameSite"); break; > case "name": > default: comparator = localeCompare.bind(this, "name"); break; > } >diff --git a/Source/WebInspectorUI/UserInterface/Views/ResourceCookiesContentView.js b/Source/WebInspectorUI/UserInterface/Views/ResourceCookiesContentView.js >index b1e1b39cc1fa617d6d07ebf6c272dc307663c944..5ee044bbce7a0122da31a0a1c1598b24b79975b8 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/ResourceCookiesContentView.js >+++ b/Source/WebInspectorUI/UserInterface/Views/ResourceCookiesContentView.js >@@ -89,6 +89,9 @@ WI.ResourceCookiesContentView = class ResourceCookiesContentView extends WI.Cont > case "httpOnly": > cell.textContent = cookie.httpOnly ? checkmark : zeroWidthSpace; > break; >+ case "sameSite": >+ cell.textContent = cookie.sameSite === WI.Cookie.SameSiteType.None ? emDash : WI.Cookie.displayNameForSameSiteType(cookie.sameSite); >+ break; > } > > return cell; >@@ -146,6 +149,7 @@ WI.ResourceCookiesContentView = class ResourceCookiesContentView extends WI.Cont > case "value": > case "domain": > case "path": >+ case "sameSite": > // String. > comparator = (a, b) => (a[sortColumnIdentifier] || "").extendedLocaleCompare(b[sortColumnIdentifier] || ""); > break; >@@ -248,6 +252,7 @@ WI.ResourceCookiesContentView = class ResourceCookiesContentView extends WI.Cont > this._responseCookiesTable.addColumn(new WI.TableColumn("maxAge", WI.unlocalizedString("Max-Age"), {maxWidth: 90, align: "right"})); > this._responseCookiesTable.addColumn(new WI.TableColumn("secure", WI.unlocalizedString("Secure"), {minWidth: 55, maxWidth: 65, align: "center"})); > this._responseCookiesTable.addColumn(new WI.TableColumn("httpOnly", WI.unlocalizedString("HttpOnly"), {minWidth: 55, maxWidth: 65, align: "center"})); >+ this._responseCookiesTable.addColumn(new WI.TableColumn("sameSite", WI.unlocalizedString("SameSite"), {minWidth: 55, maxWidth: 65})); > if (!this._responseCookiesTable.sortColumnIdentifier) { > this._responseCookiesTable.sortOrder = WI.Table.SortOrder.Ascending; > this._responseCookiesTable.sortColumnIdentifier = "name"; >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index fe69ff9064fb7272c833247192347d32868aef0c..228fa8a5783f208f528b13cc6c89bc8ab71506ff 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,16 @@ >+2018-05-25 Daniel Bates <dabates@apple.com> >+ >+ Web Inspector: Annotate Same-Site cookies >+ https://bugs.webkit.org/show_bug.cgi?id=184897 >+ <rdar://problem/35178209> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Update an existing test to ensure we include cookie details in the HTTP Archive (HAR) report. >+ >+ * http/tests/inspector/network/har/har-page-expected.txt: >+ * http/tests/inspector/network/har/har-page.html: >+ > 2018-05-25 Antoine Quint <graouts@apple.com> > > [Web Animations] WebAnimation objects never get destroyed >diff --git a/LayoutTests/http/tests/inspector/network/har/har-page-expected.txt b/LayoutTests/http/tests/inspector/network/har/har-page-expected.txt >index 22292ac1600db28eb4b10f59360d1b32e92a5c31..b0dc45a97245d999d2745b64424d97ac2adb5cde 100644 >--- a/LayoutTests/http/tests/inspector/network/har/har-page-expected.txt >+++ b/LayoutTests/http/tests/inspector/network/har/har-page-expected.txt >@@ -103,6 +103,641 @@ HAR Page Test. > "wait": "<filtered>", > "receive": "<filtered>" > } >+ }, >+ { >+ "pageref": "page_0", >+ "startedDateTime": "<filtered>", >+ "time": "<filtered>", >+ "request": { >+ "method": "GET", >+ "url": "http://127.0.0.1:8000/cookies/resources/cookie-utilities.js", >+ "httpVersion": "<filtered>", >+ "cookies": [], >+ "headers": "<filtered>", >+ "queryString": [], >+ "headersSize": "<filtered>", >+ "bodySize": "<filtered>" >+ }, >+ "response": { >+ "status": 200, >+ "statusText": "OK", >+ "httpVersion": "<filtered>", >+ "cookies": [], >+ "headers": "<filtered>", >+ "content": { >+ "size": "<filtered>", >+ "compression": 0, >+ "mimeType": "application/x-javascript", >+ "text": "<filtered>" >+ }, >+ "redirectURL": "", >+ "headersSize": "<filtered>", >+ "bodySize": "<filtered>" >+ }, >+ "cache": {}, >+ "timings": { >+ "blocked": "<filtered>", >+ "dns": "<filtered>", >+ "connect": "<filtered>", >+ "ssl": -1, >+ "send": "<filtered>", >+ "wait": "<filtered>", >+ "receive": "<filtered>" >+ } >+ }, >+ { >+ "pageref": "page_0", >+ "startedDateTime": "<filtered>", >+ "time": "<filtered>", >+ "request": { >+ "method": "GET", >+ "url": "http://127.0.0.1:8000/cookies/resources/setCookies.cgi", >+ "httpVersion": "<filtered>", >+ "cookies": [], >+ "headers": "<filtered>", >+ "queryString": [], >+ "headersSize": "<filtered>", >+ "bodySize": "<filtered>" >+ }, >+ "response": { >+ "status": 200, >+ "statusText": "OK", >+ "httpVersion": "<filtered>", >+ "cookies": [ >+ { >+ "name": "simple", >+ "value": "simple", >+ "expires": "", >+ "httpOnly": false, >+ "secure": false >+ } >+ ], >+ "headers": "<filtered>", >+ "content": { >+ "size": "<filtered>", >+ "compression": 0, >+ "mimeType": "text/plain" >+ }, >+ "redirectURL": "", >+ "headersSize": "<filtered>", >+ "bodySize": "<filtered>" >+ }, >+ "cache": {}, >+ "timings": { >+ "blocked": "<filtered>", >+ "dns": "<filtered>", >+ "connect": "<filtered>", >+ "ssl": -1, >+ "send": "<filtered>", >+ "wait": "<filtered>", >+ "receive": "<filtered>" >+ } >+ }, >+ { >+ "pageref": "page_0", >+ "startedDateTime": "<filtered>", >+ "time": "<filtered>", >+ "request": { >+ "method": "GET", >+ "url": "http://127.0.0.1:8000/cookies/resources/setCookies.cgi", >+ "httpVersion": "<filtered>", >+ "cookies": [ >+ { >+ "name": "simple", >+ "value": "simple" >+ } >+ ], >+ "headers": "<filtered>", >+ "queryString": [], >+ "headersSize": "<filtered>", >+ "bodySize": "<filtered>" >+ }, >+ "response": { >+ "status": 200, >+ "statusText": "OK", >+ "httpVersion": "<filtered>", >+ "cookies": [ >+ { >+ "name": "path", >+ "value": "path", >+ "path": "/A/B/C", >+ "expires": "", >+ "httpOnly": false, >+ "secure": false >+ } >+ ], >+ "headers": "<filtered>", >+ "content": { >+ "size": "<filtered>", >+ "compression": 0, >+ "mimeType": "text/plain" >+ }, >+ "redirectURL": "", >+ "headersSize": "<filtered>", >+ "bodySize": "<filtered>" >+ }, >+ "cache": {}, >+ "timings": { >+ "blocked": "<filtered>", >+ "dns": "<filtered>", >+ "connect": "<filtered>", >+ "ssl": -1, >+ "send": "<filtered>", >+ "wait": "<filtered>", >+ "receive": "<filtered>" >+ } >+ }, >+ { >+ "pageref": "page_0", >+ "startedDateTime": "<filtered>", >+ "time": "<filtered>", >+ "request": { >+ "method": "GET", >+ "url": "http://127.0.0.1:8000/cookies/resources/setCookies.cgi", >+ "httpVersion": "<filtered>", >+ "cookies": [ >+ { >+ "name": "simple", >+ "value": "simple" >+ } >+ ], >+ "headers": "<filtered>", >+ "queryString": [], >+ "headersSize": "<filtered>", >+ "bodySize": "<filtered>" >+ }, >+ "response": { >+ "status": 200, >+ "statusText": "OK", >+ "httpVersion": "<filtered>", >+ "cookies": [ >+ { >+ "name": "secure", >+ "value": "secure", >+ "expires": "", >+ "httpOnly": false, >+ "secure": true >+ } >+ ], >+ "headers": "<filtered>", >+ "content": { >+ "size": "<filtered>", >+ "compression": 0, >+ "mimeType": "text/plain" >+ }, >+ "redirectURL": "", >+ "headersSize": "<filtered>", >+ "bodySize": "<filtered>" >+ }, >+ "cache": {}, >+ "timings": { >+ "blocked": "<filtered>", >+ "dns": "<filtered>", >+ "connect": "<filtered>", >+ "ssl": -1, >+ "send": "<filtered>", >+ "wait": "<filtered>", >+ "receive": "<filtered>" >+ } >+ }, >+ { >+ "pageref": "page_0", >+ "startedDateTime": "<filtered>", >+ "time": "<filtered>", >+ "request": { >+ "method": "GET", >+ "url": "http://127.0.0.1:8000/cookies/resources/setCookies.cgi", >+ "httpVersion": "<filtered>", >+ "cookies": [ >+ { >+ "name": "simple", >+ "value": "simple" >+ } >+ ], >+ "headers": "<filtered>", >+ "queryString": [], >+ "headersSize": "<filtered>", >+ "bodySize": "<filtered>" >+ }, >+ "response": { >+ "status": 200, >+ "statusText": "OK", >+ "httpVersion": "<filtered>", >+ "cookies": [ >+ { >+ "name": "secure-and-http-only", >+ "value": "secure-and-http-only", >+ "expires": "", >+ "httpOnly": true, >+ "secure": true >+ } >+ ], >+ "headers": "<filtered>", >+ "content": { >+ "size": "<filtered>", >+ "compression": 0, >+ "mimeType": "text/plain" >+ }, >+ "redirectURL": "", >+ "headersSize": "<filtered>", >+ "bodySize": "<filtered>" >+ }, >+ "cache": {}, >+ "timings": { >+ "blocked": "<filtered>", >+ "dns": "<filtered>", >+ "connect": "<filtered>", >+ "ssl": -1, >+ "send": "<filtered>", >+ "wait": "<filtered>", >+ "receive": "<filtered>" >+ } >+ }, >+ { >+ "pageref": "page_0", >+ "startedDateTime": "<filtered>", >+ "time": "<filtered>", >+ "request": { >+ "method": "GET", >+ "url": "http://127.0.0.1:8000/cookies/resources/setCookies.cgi", >+ "httpVersion": "<filtered>", >+ "cookies": [ >+ { >+ "name": "simple", >+ "value": "simple" >+ } >+ ], >+ "headers": "<filtered>", >+ "queryString": [], >+ "headersSize": "<filtered>", >+ "bodySize": "<filtered>" >+ }, >+ "response": { >+ "status": 200, >+ "statusText": "OK", >+ "httpVersion": "<filtered>", >+ "cookies": [ >+ { >+ "name": "with-expiration", >+ "value": "with-expiration", >+ "expires": "5000-01-04T08:00:00.000Z", >+ "httpOnly": false, >+ "secure": false >+ } >+ ], >+ "headers": "<filtered>", >+ "content": { >+ "size": "<filtered>", >+ "compression": 0, >+ "mimeType": "text/plain" >+ }, >+ "redirectURL": "", >+ "headersSize": "<filtered>", >+ "bodySize": "<filtered>" >+ }, >+ "cache": {}, >+ "timings": { >+ "blocked": "<filtered>", >+ "dns": "<filtered>", >+ "connect": "<filtered>", >+ "ssl": -1, >+ "send": "<filtered>", >+ "wait": "<filtered>", >+ "receive": "<filtered>" >+ } >+ }, >+ { >+ "pageref": "page_0", >+ "startedDateTime": "<filtered>", >+ "time": "<filtered>", >+ "request": { >+ "method": "GET", >+ "url": "http://127.0.0.1:8000/cookies/resources/setCookies.cgi", >+ "httpVersion": "<filtered>", >+ "cookies": [ >+ { >+ "name": "simple", >+ "value": "simple" >+ }, >+ { >+ "name": "with-expiration", >+ "value": "with-expiration" >+ } >+ ], >+ "headers": "<filtered>", >+ "queryString": [], >+ "headersSize": "<filtered>", >+ "bodySize": "<filtered>" >+ }, >+ "response": { >+ "status": 200, >+ "statusText": "OK", >+ "httpVersion": "<filtered>", >+ "cookies": [ >+ { >+ "name": "http-only", >+ "value": "http-only", >+ "expires": "", >+ "httpOnly": true, >+ "secure": false >+ } >+ ], >+ "headers": "<filtered>", >+ "content": { >+ "size": "<filtered>", >+ "compression": 0, >+ "mimeType": "text/plain" >+ }, >+ "redirectURL": "", >+ "headersSize": "<filtered>", >+ "bodySize": "<filtered>" >+ }, >+ "cache": {}, >+ "timings": { >+ "blocked": "<filtered>", >+ "dns": "<filtered>", >+ "connect": "<filtered>", >+ "ssl": -1, >+ "send": "<filtered>", >+ "wait": "<filtered>", >+ "receive": "<filtered>" >+ } >+ }, >+ { >+ "pageref": "page_0", >+ "startedDateTime": "<filtered>", >+ "time": "<filtered>", >+ "request": { >+ "method": "GET", >+ "url": "http://127.0.0.1:8000/cookies/resources/setCookies.cgi", >+ "httpVersion": "<filtered>", >+ "cookies": [ >+ { >+ "name": "http-only", >+ "value": "http-only" >+ }, >+ { >+ "name": "simple", >+ "value": "simple" >+ }, >+ { >+ "name": "with-expiration", >+ "value": "with-expiration" >+ } >+ ], >+ "headers": "<filtered>", >+ "queryString": [], >+ "headersSize": "<filtered>", >+ "bodySize": "<filtered>" >+ }, >+ "response": { >+ "status": 200, >+ "statusText": "OK", >+ "httpVersion": "<filtered>", >+ "cookies": [ >+ { >+ "name": "same-site-strict", >+ "value": "same-site-strict", >+ "path": "/", >+ "expires": "", >+ "httpOnly": false, >+ "secure": false, >+ "sameSite": "Strict" >+ } >+ ], >+ "headers": "<filtered>", >+ "content": { >+ "size": "<filtered>", >+ "compression": 0, >+ "mimeType": "text/plain" >+ }, >+ "redirectURL": "", >+ "headersSize": "<filtered>", >+ "bodySize": "<filtered>" >+ }, >+ "cache": {}, >+ "timings": { >+ "blocked": "<filtered>", >+ "dns": "<filtered>", >+ "connect": "<filtered>", >+ "ssl": -1, >+ "send": "<filtered>", >+ "wait": "<filtered>", >+ "receive": "<filtered>" >+ } >+ }, >+ { >+ "pageref": "page_0", >+ "startedDateTime": "<filtered>", >+ "time": "<filtered>", >+ "request": { >+ "method": "GET", >+ "url": "http://127.0.0.1:8000/cookies/resources/setCookies.cgi", >+ "httpVersion": "<filtered>", >+ "cookies": [ >+ { >+ "name": "http-only", >+ "value": "http-only" >+ }, >+ { >+ "name": "simple", >+ "value": "simple" >+ }, >+ { >+ "name": "with-expiration", >+ "value": "with-expiration" >+ }, >+ { >+ "name": "same-site-strict", >+ "value": "same-site-strict" >+ } >+ ], >+ "headers": "<filtered>", >+ "queryString": [], >+ "headersSize": "<filtered>", >+ "bodySize": "<filtered>" >+ }, >+ "response": { >+ "status": 200, >+ "statusText": "OK", >+ "httpVersion": "<filtered>", >+ "cookies": [ >+ { >+ "name": "same-site-implicit-strict", >+ "value": "same-site-implicit-strict", >+ "path": "/", >+ "expires": "", >+ "httpOnly": false, >+ "secure": false, >+ "sameSite": "Strict" >+ } >+ ], >+ "headers": "<filtered>", >+ "content": { >+ "size": "<filtered>", >+ "compression": 0, >+ "mimeType": "text/plain" >+ }, >+ "redirectURL": "", >+ "headersSize": "<filtered>", >+ "bodySize": "<filtered>" >+ }, >+ "cache": {}, >+ "timings": { >+ "blocked": "<filtered>", >+ "dns": "<filtered>", >+ "connect": "<filtered>", >+ "ssl": -1, >+ "send": "<filtered>", >+ "wait": "<filtered>", >+ "receive": "<filtered>" >+ } >+ }, >+ { >+ "pageref": "page_0", >+ "startedDateTime": "<filtered>", >+ "time": "<filtered>", >+ "request": { >+ "method": "GET", >+ "url": "http://127.0.0.1:8000/cookies/resources/setCookies.cgi", >+ "httpVersion": "<filtered>", >+ "cookies": [ >+ { >+ "name": "http-only", >+ "value": "http-only" >+ }, >+ { >+ "name": "simple", >+ "value": "simple" >+ }, >+ { >+ "name": "with-expiration", >+ "value": "with-expiration" >+ }, >+ { >+ "name": "same-site-implicit-strict", >+ "value": "same-site-implicit-strict" >+ }, >+ { >+ "name": "same-site-strict", >+ "value": "same-site-strict" >+ } >+ ], >+ "headers": "<filtered>", >+ "queryString": [], >+ "headersSize": "<filtered>", >+ "bodySize": "<filtered>" >+ }, >+ "response": { >+ "status": 200, >+ "statusText": "OK", >+ "httpVersion": "<filtered>", >+ "cookies": [ >+ { >+ "name": "same-site-strict-because-invalid-SameSite-value", >+ "value": "same-site-strict-because-invalid-SameSite-value", >+ "path": "/", >+ "expires": "", >+ "httpOnly": false, >+ "secure": false, >+ "sameSite": "Strict" >+ } >+ ], >+ "headers": "<filtered>", >+ "content": { >+ "size": "<filtered>", >+ "compression": 0, >+ "mimeType": "text/plain" >+ }, >+ "redirectURL": "", >+ "headersSize": "<filtered>", >+ "bodySize": "<filtered>" >+ }, >+ "cache": {}, >+ "timings": { >+ "blocked": "<filtered>", >+ "dns": "<filtered>", >+ "connect": "<filtered>", >+ "ssl": -1, >+ "send": "<filtered>", >+ "wait": "<filtered>", >+ "receive": "<filtered>" >+ } >+ }, >+ { >+ "pageref": "page_0", >+ "startedDateTime": "<filtered>", >+ "time": "<filtered>", >+ "request": { >+ "method": "GET", >+ "url": "http://127.0.0.1:8000/cookies/resources/setCookies.cgi", >+ "httpVersion": "<filtered>", >+ "cookies": [ >+ { >+ "name": "http-only", >+ "value": "http-only" >+ }, >+ { >+ "name": "simple", >+ "value": "simple" >+ }, >+ { >+ "name": "with-expiration", >+ "value": "with-expiration" >+ }, >+ { >+ "name": "same-site-implicit-strict", >+ "value": "same-site-implicit-strict" >+ }, >+ { >+ "name": "same-site-strict", >+ "value": "same-site-strict" >+ }, >+ { >+ "name": "same-site-strict-because-invalid-SameSite-value", >+ "value": "same-site-strict-because-invalid-SameSite-value" >+ } >+ ], >+ "headers": "<filtered>", >+ "queryString": [], >+ "headersSize": "<filtered>", >+ "bodySize": "<filtered>" >+ }, >+ "response": { >+ "status": 200, >+ "statusText": "OK", >+ "httpVersion": "<filtered>", >+ "cookies": [ >+ { >+ "name": "same-site-lax", >+ "value": "same-site-lax", >+ "path": "/", >+ "expires": "", >+ "httpOnly": false, >+ "secure": false, >+ "sameSite": "Lax" >+ } >+ ], >+ "headers": "<filtered>", >+ "content": { >+ "size": "<filtered>", >+ "compression": 0, >+ "mimeType": "text/plain" >+ }, >+ "redirectURL": "", >+ "headersSize": "<filtered>", >+ "bodySize": "<filtered>" >+ }, >+ "cache": {}, >+ "timings": { >+ "blocked": "<filtered>", >+ "dns": "<filtered>", >+ "connect": "<filtered>", >+ "ssl": -1, >+ "send": "<filtered>", >+ "wait": "<filtered>", >+ "receive": "<filtered>" >+ } > } > ] > } >diff --git a/LayoutTests/http/tests/inspector/network/har/har-page.html b/LayoutTests/http/tests/inspector/network/har/har-page.html >index 37694792f0dd49a960af1711f57bd6b82e363194..2258c5728f4c6f0634d94fc08da4d3775dbacac5 100644 >--- a/LayoutTests/http/tests/inspector/network/har/har-page.html >+++ b/LayoutTests/http/tests/inspector/network/har/har-page.html >@@ -3,6 +3,7 @@ > <head> > <meta charset="utf-8"> > <script src="../../resources/inspector-test.js"></script> >+<script src="../../../cookies/resources/cookie-utilities.js"></script> > <script> > function test() > { >@@ -49,6 +50,10 @@ function test() > return "<filtered>"; > } > >+ // Sort cookies by name to make cookie order deterministic between test runs. >+ if (key === "cookies") >+ value.sort((a, b) => { return a.name - b.name; }); >+ > // Since cache may or may not be used, timing data may be variable. > // NOTE: SSL should always be -1 for this test case. > if (key === "time") >@@ -77,10 +82,14 @@ function test() > async test() { > InspectorTest.reloadPage({ignoreCache: true}); > await InspectorTest.awaitEvent("LoadComplete"); >+ InspectorTest.evaluateInPage("setup()"); >+ await InspectorTest.awaitEvent("SetupComplete"); > > let resources = [WI.frameResourceManager.mainFrame.mainResource, ...WI.frameResourceManager.mainFrame.resourceCollection]; > let har = await WI.HARBuilder.buildArchive(resources); > InspectorTest.json(har, HARJSONFilter); >+ InspectorTest.evaluateInPage("cleanup()"); >+ await InspectorTest.awaitEvent("CleanComplete"); > } > }); > >@@ -91,6 +100,31 @@ function test() > <body onload="runTest()"> > <p>HAR Page Test.</p> > <script> >+async function setup() >+{ >+ await resetCookies(); >+ await setCookie("simple", "simple"); >+ await setCookie("path", "path", {"path": "/A/B/C"}); // This cookie will not be sent in subsequent requests from this page. >+ >+ // Secure cookies will only be sent in subsequent requests from this page if the page was served over HTTPS. >+ await setCookie("secure", "secure", {"secure": null}); >+ await setCookie("secure-and-http-only", "secure-and-http-only", {"secure": null, "HttpOnly": null}); >+ >+ await setCookie("with-expiration", "with-expiration", {"Expires": new Date("01/04/5000").toGMTString()}); >+ await setCookie("http-only", "http-only", {"HttpOnly": null}); >+ await setCookie("same-site-strict", "same-site-strict", {"SameSite": "Strict", "path": "/"}); >+ await setCookie("same-site-implicit-strict", "same-site-implicit-strict", {"SameSite": null, "path": "/"}); >+ await setCookie("same-site-strict-because-invalid-SameSite-value", "same-site-strict-because-invalid-SameSite-value", {"SameSite": "invalid", "path": "/"}); >+ await setCookie("same-site-lax", "same-site-lax", {"SameSite": "Lax", "path": "/"}); >+ TestPage.dispatchEventToFrontend("SetupComplete"); >+} >+ >+async function cleanup() >+{ >+ await resetCookies(); >+ TestPage.dispatchEventToFrontend("CleanComplete"); >+} >+ > window.addEventListener("load", () => { > TestPage.dispatchEventToFrontend("LoadComplete"); > });
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 184897
:
341307
|
341309
| 341326