In WebExtensions, SameSiteStatus cannot ever be "unspecified"
Categories
(WebExtensions :: Frontend, defect)
Tracking
(Not tracked)
People
(Reporter: z, Unassigned)
Details
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0
Steps to reproduce:
In a WebExtension:
chrome.cookies.set({ name: 'foo', value: 'val', sameSite: 'unspecified' })
chrome.cookies.set({ name: 'bar', value: 'val' })
chrome.cookies.getAll()
Actual results:
The first line will throw an Error:
Type error for parameter details (Error processing sameSite: Invalid enumeration value "unspecified") for cookies.set.
The second line will set the cookie, but will set the sameSite
prop to no_restriction
, not unspecified
.
Expected results:
It should behave like Chrome's WebExtension API, which allows a 4th unspecified
value to indicate there is no SameSite status for this cookie.
Both of the calls to chrome.cookies.set
should set sameSite: 'unspecified'
. no_restriction
should not be the default value for sameSite
, unspecified
should be. And unspecified
should be a permitted enum value for SameSiteStatus.
For reference:
- Chrome SameSiteStatus enum: https://developer.chrome.com/extensions/cookies#type-SameSiteStatus
- Chrome's default value for
sameSite
: https://developer.chrome.com/extensions/cookies#method-set - Firefox's SameSiteStatus enum: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/cookies/SameSiteStatus
- Firefox's default value for
sameSite
: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/cookies/set
Please let me know if this bug report is misguided, I just noticed this discrepancy while trying to work with cross-browser WebExtension automation and was not sure if Chrome's or Firefox's approach is correct here.
Comment 1•5 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Updated•5 years ago
|
Description
•