Skip to content

Instantly share code, notes, and snippets.

@drewsberry
Created December 20, 2016 18:28
Show Gist options
  • Save drewsberry/578fc6e414ff7ea93e0234fd8898f8f3 to your computer and use it in GitHub Desktop.
Save drewsberry/578fc6e414ff7ea93e0234fd8898f8f3 to your computer and use it in GitHub Desktop.
Set referrer header in JS.
// See https://stackoverflow.com/a/23434948
function setReferrerHeader(referrerName) {
Object.defineProperty(document, "referrer", {
get: function () { return referrerName; },
});
}
@andyrojasc
Copy link

Ir works for all browser?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment