Created
June 30, 2021 07:26
-
-
Save lixin9311/0c250b48a3369dd4282b6ac9a5d7e5b6 to your computer and use it in GitHub Desktop.
Tampermokey script overriding document.referrer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Referrer override | |
// @namespace https://example.com | |
// @description Override the document.referrer | |
// @author Lucas Li | |
// @match https://example.com/* | |
// @icon https://www.google.com/s2/favicons?domain=example.com | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const domain = "https://google.com" | |
console.log("overriding the document.referrer to " + domain); | |
delete window.document.referrer; | |
window.document.__defineGetter__('referrer', function () { | |
return domain; | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment