Decrypt cookies from browsers.
Inspired from browser-cookie3, but written in Java.
Tested on Linux with GNOME, Chrome 108.
maven
<dependency>
<groupId>com.remisiki</groupId>
<artifactId>browser-cookies</artifactId>
<version>0.1.1</version>
</dependency>
sbt
libraryDependencies += "com.remisiki" % "browser-cookies" % "0.1.0"
Get a list of cookies using Chrome::getCookies
. Fetch all cookies when domain is not specified.
import com.remisiki.cookies.Chrome;
public class Main {
public static void main(String[] args) throws Exception {
Chrome chrome = new Chrome();
chrome.connect();
System.out.println(chrome.getCookies().size());
System.out.println(chrome.getCookies("github.com"));
chrome.close();
}
}
BSD 3-Clause