Closed Bug 1256251 Opened 6 years ago Closed 6 years ago

Update browser.cookies.onChanged to match Chrome's behaviour when overwriting a cookie

Categories

(WebExtensions :: Untriaged, defect)

defect
Not set
normal

Tracking

(firefox48 fixed)

RESOLVED FIXED
mozilla48
Iteration:
48.1 - Mar 21
Tracking Status
firefox48 --- fixed

People

(Reporter: bsilverberg, Assigned: bsilverberg)

Details

Attachments

(1 file)

As per the docs [1]:

`As a special case, note that updating a cookie's properties is implemented as a two step process: the cookie to be updated is first removed entirely, generating a notification with "cause" of "overwrite" . Afterwards, a new cookie is written with the updated values, generating a second notification with "cause" "explicit".`

However, we do not currently do this with the API. We fire an event with removed: "false" and cause: "overwrite", which does not match the above behaviour. This bug to to change that so that when we receive notification that a cookie has been updated we fire both of the above-mentioned events, rather than the single event that we currently fire.

Kris/Andy, do you agree that we should make this change?

[1] https://developer.chrome.com/extensions/cookies#event-onChanged
Iteration: --- → 48.1 - Mar 21
Flags: needinfo?(kmaglione+bmo)
Flags: needinfo?(amckay)
Flags: blocking-webextensions+
As long as we don't inherit a huge technical debt (its a few lines of code) then lets copy Chrome.
Flags: needinfo?(amckay)
Note that I did check Chrome and confirmed that the documented behaviour matches the actual behaviour.
Comment on attachment 8730147 [details]
MozReview Request: Bug 1256251 - Update browser.cookies.onChanged to match Chrome's behaviour when overwriting a cookie, r?kmag

https://reviewboard.mozilla.org/r/39701/#review36351

Hm. This is a strange API...
Attachment #8730147 - Flags: review?(kmaglione+bmo) → review+
Flags: needinfo?(kmaglione+bmo)
Assignee: nobody → bob.silverberg
Status: NEW → ASSIGNED
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/c492b319e0c0
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.