Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

chrome-extension: grab all cross domain cookies under the url tab?

I am only able to grab cookies with the same domain, but when you view the cookies in the chrome dev tool, you can see a bunch of cookies with different domain values under the same url tree tab on the right like below. The circled cookie is from a different domain for example but show up under developer.chrome.com.

enter image description here

My question is how do you pull all the cookies from that domain tab with different domain values?

    chrome.cookies.getAll({'url': "http://developer.chrome.com"}, function (cookies) {
        if (cookies) {
            console.log(cookies); //will only pull cookies with domain value developer.chrome.com
        }
    });
like image 258
user299709 Avatar asked Jan 25 '26 04:01

user299709


1 Answers

You need to inspect the requests being made on a tab to see which are making requests for cross-domain cookies.

In order to access the network api, you need to make a DevTools extension [info].

From there you need to make the following request:

chrome.devtools.network.getHAR()

This will log json regarding the network requests being made. In that json, you can access a cookie object. The json is based on the HAR spec. [info]

like image 156
cdosborn Avatar answered Jan 27 '26 18:01

cdosborn