feat: expose the sameSite value for cookies (#22789)
* feat: expose the sameSite value for cookies * Apply suggestions from code review Co-Authored-By: Charles Kerr <ckerr@github.com> * Apply suggestions from code review Align with cookie samesite values for the extensions API https://developer.chrome.com/extensions/cookies#type-SameSiteStatus * chore: add tests for sameSite cookies get/set * chore: update docs parser * chore: update docs for MessageChannel and MessagePort to have correct process information * chore: remove LOG warning * chore: throw error if the string->samesite conversion fails Co-authored-by: Charles Kerr <ckerr@github.com>
This commit is contained in:
parent
2ce8dff175
commit
1d158399a6
9 changed files with 260 additions and 33 deletions
|
@ -96,6 +96,7 @@ the response.
|
|||
* `expirationDate` Double (optional) - The expiration date of the cookie as the number of
|
||||
seconds since the UNIX epoch. If omitted then the cookie becomes a session
|
||||
cookie and will not be retained between sessions.
|
||||
* `sameSite` String (optional) - The [Same Site](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#SameSite_cookies) policy to apply to this cookie. Can be `unspecified`, `no_restriction`, `lax` or `strict`. Default is `no_restriction`.
|
||||
|
||||
Returns `Promise<void>` - A promise which resolves when the cookie has been set
|
||||
|
||||
|
|
|
@ -9,6 +9,8 @@ channel messaging.
|
|||
|
||||
## Class: MessageChannelMain
|
||||
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
Example:
|
||||
```js
|
||||
const { port1, port2 } = new MessageChannelMain()
|
||||
|
|
|
@ -14,6 +14,8 @@ channel messaging.
|
|||
|
||||
## Class: MessagePortMain
|
||||
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
### Instance Methods
|
||||
|
||||
#### `port.postMessage(message, [transfer])`
|
||||
|
|
|
@ -12,3 +12,4 @@
|
|||
* `expirationDate` Double (optional) - The expiration date of the cookie as
|
||||
the number of seconds since the UNIX epoch. Not provided for session
|
||||
cookies.
|
||||
* `sameSite` String - The [Same Site](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#SameSite_cookies) policy applied to this cookie. Can be `unspecified`, `no_restriction`, `lax` or `strict`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue