Closed Bug 1590098 Opened 5 years ago Closed 4 years ago

Implement Network.getCookies

Categories

(Remote Protocol :: CDP, task, P1)

task

Tracking

(firefox73 fixed)

RESOLVED FIXED
Firefox 73
Tracking Status
firefox73 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

(Blocks 1 open bug, )

Details

(Whiteboard: [puppeteer-beta-mvp] [lang=js])

Attachments

(1 file)

For Puppeteer support it is necessary to get the Network.getCookies domain implemented. It's specification can be found at:

https://chromedevtools.github.io/devtools-protocol/tot/Network#method-getCookies

The implementation can be similar to what we currently have in Marionette:
https://searchfox.org/mozilla-central/rev/d7537a9cd2974efa45141d974e5fc7c727f1a78f/testing/marionette/cookie.js#229

getCookiesFromHost() returns an enumerator, and entries would have to be mapped to the Cookie type as defined by CDP.

Note that the list of cookies needs to be filtered by the path property, given that only cookies from the current URL and not the host have to be returned.

Priority: -- → P3

Oh, and the necessary code has to be added to the Network class in:
https://searchfox.org/mozilla-central/source/remote/domains/parent/Network.jsm

And also some tests would be necessary. All of them should be added to a file called browser_getCookies.js in:
https://searchfox.org/mozilla-central/source/remote/test/browser/network

Hi Thomas. You showed interest in this bug about a week ago, and I'm wondering if that is still the case. If yes, please let me know how I can help. Thanks a lot.

Flags: needinfo?(thomas510111)

Yes I am still interested, sorry I hadn't enough free time last week. I will be on irc later.

Flags: needinfo?(thomas510111)

Thomas, please note that whenever someone else comes up and wants to help with this bug I can no longer block this specific one for you, unless you will be able to have a patch ready soon. Thanks.

We made a bit of progress with Thomas today on IRC, and one thing which remains to be answered is how to run a specific Puppeteer test. So far I was only able to accomplish that by commenting out any test in this following list which is not needed:

https://searchfox.org/mozilla-central/rev/0678172d5b5c681061b904c776b668489e3355b0/remote/test/puppeteer/test/puppeteer.spec.js#131-176

Note that whenever you do a hg update you will have to comment it out again. Also don't forget to revert it before committing the changes.

Also for the implementation have a look at:
https://github.com/puppeteer/juggler/blob/master/testing/juggler/BrowserContextManager.js#L142-L171

This was some code from Google for a PoC that could be re-used here.

Thomas, it's been 10 days already since we spoke last time. Are you still working on this bug? Otherwise one of us might pick it up soon given that it somewhat causes a lot of test failures in the puppeteer unit tests. Thanks.

Flags: needinfo?(thomas510111)

Hey, sorry i dont have enough free time to work on this one..You are free to pick it up.

Flags: needinfo?(thomas510111)

Thanks for letting us know!

Blocks: 1602829

While waiting on reviews for other important APIs I'm going to pick-up this one now given that it would make us more shiny in the Puppeteer unit tests.

Assignee: nobody → hskupin
Mentor: hskupin
Status: NEW → ASSIGNED
Priority: P3 → P1
Whiteboard: [lang=js] → [puppeteer-beta-mvp] [lang=js]

(In reply to Henrik Skupin (:whimboo) [⌚️UTC+1] from comment #5)

We made a bit of progress with Thomas today on IRC, and one thing which remains to be answered is how to run a specific Puppeteer test. So far I was only able to accomplish that by commenting out any test in this following list which is not needed:

https://searchfox.org/mozilla-central/rev/0678172d5b5c681061b904c776b668489e3355b0/remote/test/puppeteer/test/puppeteer.spec.js#131-176

Note that whenever you do a hg update you will have to comment it out again. Also don't forget to revert it before committing the changes.

I just noticed this question. You can run a specific Puppeteer unit test by replacing it function with with fit. See https://github.com/puppeteer/puppeteer/blob/master/CONTRIBUTING.md#running--writing-tests

Great! That is good information. Running it individually let me trigger some failures. I will investigate.

Blocks: 1605061
Blocks: 1605355
Blocks: 1605362
Blocks: 1605365
Attachment #9116665 - Attachment description: Bug 1590098 - [remote] Implement Network.getCookies. r=#remote! → Bug 1590098 - [remote] Implement basic support for Network.getCookies. r=#remote!
Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5f7ccbf95e92
[remote] Implement basic support for Network.getCookies. r=remote-protocol-reviewers,ato,maja_zf
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 73
Regressions: 1605568
Depends on: 1605650
Component: CDP: Network → CDP
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: