Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save janekptacijarabaci/837d5d816cb247309daeaba63c388d27 to your computer and use it in GitHub Desktop.
Save janekptacijarabaci/837d5d816cb247309daeaba63c388d27 to your computer and use it in GitHub Desktop.
Greasemonkey issue #2235: GM_xmlhttpRequest overwrite cookie in headers parameter
// ==UserScript==
// @name Greasemonkey - issue - 2235
// @include http://www.html-kit.com/tools/cookietester/
// @noframes
// @grant GM_log
// @grant GM_xmlhttpRequest
// ==/UserScript==
var anonymous = false;
if (confirm("Anonymous?")) {
anonymous = true;
}
GM_xmlhttpRequest({
"url": "http://www.html-kit.com/tools/cookietester/",
"method": "GET",
// "mozAnon": anonymous,
"anonymous": anonymous,
"headers": {
"cookie": "name1=value1; name2=value2;" // + " " + document.cookie // cookies not HttpOnly
},
"onload": function (response) {
alert(response.responseText);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment