/cookie-scanner

Capture cookies HTTP and JS set and read requests trough webpages navigation

Primary LanguageJavaScript

Usage

node scan.js example.playscript.js > result.json
cat result.json | node convert.js --format html > result.html
cat result.json | node save.js -user "user@example.com" -password "password" -domain 1234 -category 1234

node scan.js -v example.playscript.js | jq 'map(.name)'

NOTICE: it's possible that some cookies are missing from the scan vs the browser cookiestore (diff of 2 console tags). This came from some issues with the Devtool protocol.

Exeample of cookies could be missed:

┌────────────────────────┬─────────────────────────────┬────────────────────┬───────────┬──────────────┬──────────┐
│          name          │            host             │        path        │ isSession │ isThirdParty │ lifeSpan │
├────────────────────────┼─────────────────────────────┼────────────────────┼───────────┼──────────────┼──────────┤
│         'NID'          │        'google.com'         │        '/'         │   false   │     true     │   183    │
│       'CONSENT'        │        'google.com'         │        '/'         │   false   │     true     │   6686   │
│       '__io_cid'       │         'bfmio.com'         │        '/'         │   false   │     true     │   365    │
│       '_cc_aud'        │       'crwdcntrl.net'       │        '/'         │   false   │     true     │   270    │
│        '_cc_cc'        │       'crwdcntrl.net'       │        '/'         │   false   │     true     │   270    │
│        '_cc_dc'        │       'crwdcntrl.net'       │        '/'         │   false   │     true     │   270    │
│        '_cc_id'        │       'crwdcntrl.net'       │        '/'         │   false   │     true     │   270    │
│          'c'           │   'creative-serving.com'    │        '/'         │   false   │     true     │   390    │
│  'done_redirects104'   │      'onaudience.com'       │        '/'         │   false   │     true     │    1     │
│  'done_redirects154'   │      'onaudience.com'       │        '/'         │   false   │     true     │    1     │
│        'tuuid'         │   'creative-serving.com'    │        '/'         │   false   │     true     │   390    │
│       'tuuid_lu'       │   'creative-serving.com'    │        '/'         │   false   │     true     │   390    │
│   'digitalAudience'    │ 'target.digitalaudience.io' │        '/'         │   false   │     true     │   3653   │
└────────────────────────┴─────────────────────────────┴────────────────────┴───────────┴──────────────┴──────────┘

chrome://net-export/ with "Include cookies and credentials" option https://netlog-viewer.appspot.com/#events

TODO

Support WPT script: Scripting - WebPagetest Documentation

Some implementation notes