[Webkit-unassigned] [Bug 32160] Web Inspector: Allow retrieval of all transmitted cookies

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Dec 7 08:01:14 PST 2009


https://bugs.webkit.org/show_bug.cgi?id=32160





--- Comment #4 from Alexander Pavlov (apavlov) <apavlov at chromium.org>  2009-12-07 08:01:13 PST ---
(In reply to comment #3)
> (From update of attachment 44318 [details])
> > +        for (var c = 0; c < allCookies.length; ++c) {
> 
> c is a strange index name.

i now

> > +            for (var id in WebInspector.resources) {
> > +                var resource = WebInspector.resources[id];
> > +                var match = resource.documentURL.match(WebInspector.URLRegExp);
> 
> You don't need to do matching numCookeis x numResources times. It is easier to
> go though resources and store their domains into a set first (numResources
> steps), then you can get all cookies for given frame within numCookies x
> numDomains steps.

We should store full URLs rather than domains (since the cookies are matched
using the protocol, hostname, port, and path.) I have changed the impl, so we
can gain some benefit when there are several cookie domains in the page.

> >  
> > +WebInspector.Cookies.cookieMatchesResourceURL = function(cookie, resourceURL)
> > +{
> 
> I don't see this method used.

Thanks for the catch. For some reason I was invoking domain matching rather
than full matching.

> > +
> > +WebInspector.Cookies.cookieDomainMatchesResourceDomain = function(cookieDomain, resourceDomain)
> > +{
> > +    if (cookieDomain.charAt(0) !== '.')
> > +        return resourceDomain === cookieDomain;
> > +    return !!resourceDomain.match(new RegExp("^([^\\.]+\\.)?" + cookieDomain.substring(1).escapeForRegExp() + "$"), "i");
> 
> A test for this would be nice. You need to do a inspector test that would match
> a bunch of URLs against given domain on the frontend side.

Done.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list