Fix wording and formatting inconsistencies in cookies.set documentation#43107
Fix wording and formatting inconsistencies in cookies.set documentation#43107
Conversation
| - : A `string` representing the domain the cookie belongs to (e.g., "www.google.com" or "example.com"). | ||
| - `expirationDate` {{optional_inline}} | ||
| - : A `number` representing the expiration date of the cookie as the seconds after the UNIX epoch. Includes milliseconds in the fractional part. Not provided for session cookies. | ||
| - : A `number` representing the expiration date of the cookie as the seconds after the UNIX epoch.It can include milliseconds in the fractional part.If omitted, the cookie becomes a session cookie. |
There was a problem hiding this comment.
The last
| - : A `number` representing the expiration date of the cookie as the seconds after the UNIX epoch.It can include milliseconds in the fractional part.If omitted, the cookie becomes a session cookie. | |
| - : A `number` representing the expiration date of the cookie as the seconds after the UNIX epoch. It can include milliseconds in the fractional part. Not provided for session cookies. |
This type describes the return value of various cookie APIs. The last fragment was copied from the cookies.set description, where "becomes" makes sense because the method creates or updates a cookie. When a cookie is read, "becomes" feels odd, because the cookie does not become anything, its state is returned as is.
There was a problem hiding this comment.
thankyou for the feedback I will revise it
There was a problem hiding this comment.
Hello Maintainers,
I referred to your feedback and understood that set method is responsible to make a cookie session cookie not cookies.cookie() object and have made changes with respect to the same reference.Waiting for review
| - : A `string` representing the domain the cookie belongs to (e.g., "www.google.com" or "example.com"). | ||
| - `expirationDate` {{optional_inline}} | ||
| - : A `number` representing the expiration date of the cookie as the seconds after the UNIX epoch. Includes milliseconds in the fractional part. Not provided for session cookies. | ||
| - : A `number` representing the expiration date of the cookie as the seconds after the UNIX epoch.Can include milliseconds in the fractional part.Not provided for session cookies. |
There was a problem hiding this comment.
| - : A `number` representing the expiration date of the cookie as the seconds after the UNIX epoch.Can include milliseconds in the fractional part.Not provided for session cookies. | |
| - : A `number` representing the expiration date of the cookie as the seconds after the UNIX epoch. Includes milliseconds in the fractional part. Not provided for session cookies. |
The fractional part always includes the milliseconds value from the expiration date.
There was a problem hiding this comment.
I understood the fact and revised it waiting for review.
| - : A `boolean`, `true` if the cookie is marked as HttpOnly (i.e., the cookie is inaccessible to client-side scripts), or false otherwise. | ||
| - `name` | ||
| - : A `string` representing the name of the cookie. | ||
| - : A `string` representing the name of the cookie.If omitted, this is empty by default. |
There was a problem hiding this comment.
| - : A `string` representing the name of the cookie.If omitted, this is empty by default. | |
| - : A `string` representing the name of the cookie. |
As this is the return value of the cookie name can't be "omitted".
There was a problem hiding this comment.
I understood that whatever is returned as an object cannot be omitted and made the changes.
| - : A `boolean`, `true` if the cookie is a host-only cookie (i.e., the request's host must exactly match the domain of the cookie), or `false` otherwise. | ||
| - `httpOnly` | ||
| - : A `boolean`, `true` if the cookie is marked as HttpOnly (i.e., the cookie is inaccessible to client-side scripts), or `false` otherwise. | ||
| - : A `boolean`, `true` if the cookie is marked as HttpOnly (i.e., the cookie is inaccessible to client-side scripts), or false otherwise. |
There was a problem hiding this comment.
| - : A `boolean`, `true` if the cookie is marked as HttpOnly (i.e., the cookie is inaccessible to client-side scripts), or false otherwise. | |
| - : A `boolean`, `true` if the cookie is marked as HttpOnly (i.e., the cookie is inaccessible to client-side scripts), or `false` otherwise. |
As true and false are returned values they should both be in code format.
There was a problem hiding this comment.
I have included both in code format.Waiting for review.
| - : A `string` representing the path of the cookie. | ||
| - `secure` | ||
| - : A `boolean`, `true` if the cookie is marked as secure (i.e., its scope is limited to secure channels, typically HTTPS), or `false` otherwise. | ||
| - : A `boolean`, `true` if the cookie is marked as secure (i.e., its scope is limited to secure channels, typically HTTPS), or false otherwise. |
There was a problem hiding this comment.
| - : A `boolean`, `true` if the cookie is marked as secure (i.e., its scope is limited to secure channels, typically HTTPS), or false otherwise. | |
| - : A `boolean`, `true` if the cookie is marked as secure (i.e., its scope is limited to secure channels, typically HTTPS), or `false` otherwise. |
There was a problem hiding this comment.
I made suggested changes.
| - : A `string` representing the ID of the cookie store containing this cookie, as provided by {{WebExtAPIRef("cookies.getAllCookieStores()")}}. | ||
| - `value` | ||
| - : A `string` representing the value of the cookie. | ||
| - : A `string` representing the value of the cookie. If omitted, this is empty by default. |
There was a problem hiding this comment.
| - : A `string` representing the value of the cookie. If omitted, this is empty by default. | |
| - : A `string` representing the value of the cookie. |
| - : A `string` representing the domain of the cookie. If omitted, the cookie becomes a host-only cookie. | ||
| - `expirationDate` {{optional_inline}} | ||
| - : A `number` that represents the expiration date of the cookie as the seconds after the UNIX epoch. Can include milliseconds in the fractional part. If omitted, the cookie becomes a session cookie. | ||
| - : A `number` that represents the expiration date of the cookie as the seconds after the UNIX epoch.It can include milliseconds in the fractional part.If omitted, the cookie becomes a session cookie. |
There was a problem hiding this comment.
| - : A `number` that represents the expiration date of the cookie as the seconds after the UNIX epoch.It can include milliseconds in the fractional part.If omitted, the cookie becomes a session cookie. | |
| - : A `number` that represents the expiration date of the cookie as the seconds after the UNIX epoch. It can include milliseconds in the fractional part. If omitted, the cookie becomes a session cookie. |
| - : A `boolean` that specifies whether the cookie is marked as HttpOnly (`true`), or not (`false`). If omitted, it defaults to `false`. | ||
| - `name` {{optional_inline}} | ||
| - : A `string` representing the name of the cookie. If omitted, this is empty by default. | ||
| - : A `string` representing the name of the cookie.If omitted, the name defaults to an empty string (`""`). |
There was a problem hiding this comment.
| - : A `string` representing the name of the cookie.If omitted, the name defaults to an empty string (`""`). | |
| - : A `string` representing the name of the cookie. If omitted, the name defaults to an empty string (`""`). |
There was a problem hiding this comment.
Hello maintainers,
I have made all changes suggested.waiting for review.
files/en-us/mozilla/add-ons/webextensions/api/cookies/cookie/index.md
Outdated
Show resolved
Hide resolved
The necessary changes have now been made
|
Preview URLs (1 page) |
Description
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/cookies/set#expirationdate
The above link redirects to expirationdate of cookie the statement was grammatically incorrect it started with can include milliseconds' there was no pronoun prior to it making it sound subordinate.
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/cookies/set#httponly
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/cookies/set#secure
The above links followed
truein<code>not following same forfalsemaking it inconsistent so I includedfalseas well in<code>to maintain the consistency.https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/cookies/set#name
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/cookies/set#value
The meaning to the line in above links (if omitted, this is empty by default) was unclear to make it sound the clear I replaced it with the below line:
If omitted, the value defaults to an empty string (
"").Motivation
I like to read documentation that carry clarity and easy to understand so this made me make these changes which get rid of ambiguity readers faced for while.
Additional details
Related issues and pull requests
Fixes #42988