Implement Network.getCookies
Categories
(Remote Protocol :: CDP, task, P1)
Tracking
(firefox73 fixed)
Tracking | Status | |
---|---|---|
firefox73 | --- | fixed |
People
(Reporter: whimboo, Assigned: whimboo)
References
()
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.
Updated•5 years ago
|
Assignee | ||
Comment 1•5 years ago
•
|
||
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
Assignee | ||
Comment 2•5 years ago
|
||
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.
Comment 3•5 years ago
|
||
Yes I am still interested, sorry I hadn't enough free time last week. I will be on irc later.
Assignee | ||
Comment 4•5 years ago
|
||
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.
Assignee | ||
Comment 5•5 years ago
|
||
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:
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.
Assignee | ||
Comment 6•5 years ago
|
||
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.
Assignee | ||
Comment 7•5 years ago
|
||
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.
Comment 8•5 years ago
|
||
Hey, sorry i dont have enough free time to work on this one..You are free to pick it up.
Assignee | ||
Comment 9•5 years ago
|
||
Thanks for letting us know!
Assignee | ||
Comment 10•5 years ago
|
||
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.
Updated•5 years ago
|
Assignee | ||
Comment 11•5 years ago
|
||
Assignee | ||
Comment 12•5 years ago
|
||
(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:
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
Assignee | ||
Comment 14•5 years ago
|
||
Great! That is good information. Running it individually let me trigger some failures. I will investigate.
Updated•5 years ago
|
Comment 15•5 years ago
|
||
Comment 16•5 years ago
|
||
bugherder |
Updated•4 years ago
|
Description
•