Closed Bug 1376991 Opened 7 years ago Closed 7 years ago

Extend browsingData to support removing cookies by host

Categories

(WebExtensions :: General, enhancement)

enhancement
Not set
normal

Tracking

(firefox56 fixed)

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: wisniewskit, Assigned: wisniewskit)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-complete)

Attachments

(1 file, 3 obsolete files)

This was split off from bug 1340511, in the interest of getting support for cookies implemented separately from localStorage and indexedDB.
I had some time today, so here's a patch containing just the cookie-related bits from my patch in the original bug, cleaned up and now with test cases.
Assignee: nobody → wisniewskit
Status: NEW → ASSIGNED
Attachment #8882027 - Flags: review?(mixedpuppy)
Sorry for the churn, but looking at the patch again today with fresh eyes I see that the logic when both "hostnames" and "since" are provided was not doing what one would probably expect (that is, to clear just those cookies "since" the time for the listed "hostnames"). Here's a new version of the patch which does that (including a related test).
Attachment #8882027 - Attachment is obsolete: true
Attachment #8882027 - Flags: review?(mixedpuppy)
Attachment #8882206 - Flags: review?(mixedpuppy)
Any chance you can push to reviewboard?
Flags: needinfo?(wisniewskit)
Comment on attachment 8882206 [details] [diff] [review] 1376991-extend_browsingData_to_restrict_removing_cookies_to_given_hostnames.diff Sure! It's at https://reviewboard.mozilla.org/r/153540
Attachment #8882206 - Attachment is obsolete: true
Flags: needinfo?(wisniewskit)
Attachment #8882206 - Flags: review?(mixedpuppy)
Comment on attachment 8882414 [details] Bug 1376991 - Extend browsingData to restrict removing cookies to a give list of hostnames; https://reviewboard.mozilla.org/r/153540/#review158710
Attachment #8882414 - Flags: review?(mixedpuppy) → review+
Thanks for the review. I'm doing a try-run before requesting check-in: https://treeherder.mozilla.org/#/jobs?repo=try&revision=bb0e95d91b4fe293b33c452f6c0ccec6f5517aaa
I pushed 2 small tweaks to make it pass try. A new run seems fine: https://treeherder.mozilla.org/#/jobs?repo=try&revision=e8dfdbc4bb7f18f329f83e8f8854f4cd0bff99f4
Comment on attachment 8882540 [details] Fixes for try run failures https://reviewboard.mozilla.org/r/153656/#review159628 this is fine, just roll it into the original patch
Attachment #8882540 - Flags: review+
Comment on attachment 8882414 [details] Bug 1376991 - Extend browsingData to restrict removing cookies to a give list of hostnames; https://reviewboard.mozilla.org/r/153540/#review159658 Carrying over r+.
Attachment #8882414 - Flags: review+
Comment on attachment 8882414 [details] Bug 1376991 - Extend browsingData to restrict removing cookies to a give list of hostnames; https://reviewboard.mozilla.org/r/153540/#review158710 I just made a couple of minor tweaks to account for straightforward failures on the try-run (an eslint fix and clearing the cookies before tests). A new try-run seems fine: https://treeherder.mozilla.org/#/jobs?repo=try&revision=e8dfdbc4bb7f18f329f83e8f8854f4cd0bff99f4
Attachment #8882540 - Attachment is obsolete: true
Alright, I've folded my follow-up patch into the original after getting the go-ahead from :mixedpuppy on IRC. Carrying over r+ and requesting checkin for the final patch.
Keywords: checkin-needed
MozReview is still showing your fix-up commit (and Autoland wants to push it as a result). Please try to clean that up.
Keywords: checkin-needed
>MozReview is still showing your fix-up commit (and Autoland wants to push it as a result). Please try to clean that up. Sorry to bug you about it, but how would I do that? I've twice "finished the review" and "discarded" it, but I don't see any "drop this patch" type of option in MozReview, so I'm stuck (and no one seems to be on #mozreview right now). Is there someone else I should ping to find out?
Flags: needinfo?(ryanvm)
Maybe Mark does.
Flags: needinfo?(ryanvm) → needinfo?(mcote)
Hi Thomas, you need to rebase your commits to merge them together (it doesn't look like the first commit includes the fixes in the second commit). There are a few ways to do this; probably the easiest is "hg histedit <parent>" where <parent> is the commit you based your first patch on ("hg log --graph" should show this clearly). Then you can change the second commit from "pick" to "fold", and it will be combined into the first one. Then push it up for review again (MozReview will understand that the second commit has been dropped and will remove the patch accordingly).
Flags: needinfo?(mcote)
Thanks, mcote! It looks like that did the trick. Re-requesting checkin.
Keywords: checkin-needed
Pushed by cbook@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5394bfb80035 Extend browsingData to restrict removing cookies to a give list of hostnames; r=mixedpuppy
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
Flags: needinfo?(wisniewskit)
Looks good, thanks, but two additional things might be worth mentioning in advance: 1. You must pass in *just* a hostname for every array element, no protocol/etc (for example, having an element "http://www.google.com" will throw an exception; use just "www.google.com" instead). This code snippet may help with that: hostname = new URL(rawUrl).hostname 2. Passing in a top-level domain like "google.com" will not remove sub-domain cookies as well (like those from "www.google.com"). You must explicitly list all of the domains.
Flags: needinfo?(wisniewskit)
Thanks, that's very good info to add. I've updated the page. I'm marking this dev-doc-complete, but please let me know if there's anything else needed.
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: