Skip to content

Instantly share code, notes, and snippets.

@iigmir
Created September 23, 2020 13:13
Show Gist options
  • Save iigmir/c05ce2b0f077e5120a7f9292b2824910 to your computer and use it in GitHub Desktop.
Save iigmir/c05ce2b0f077e5120a7f9292b2824910 to your computer and use it in GitHub Desktop.
Block Quora Login screen by Greasemonkey
// ==UserScript==
// @name Block Quora Login screen
// @version 3
// @grant none
// @match *://*.quora.com/*
// @author iigmir
// ==/UserScript==
/**
* The reason why Quora shows up the login popup after clicking a link is because of the referrer header.
* Therefore, if block referrer headers, the site will never show the login popup again.
* Luckily, the <a> element has an attribute called "referrer-policy".
*/
(function () {
"use strict";
console.log( "GMonkey: Quora Script" );
const domInsertionObserver = new MutationObserver(function(mutation){
[ ...document.querySelectorAll("a") ].forEach( dom => dom.referrerPolicy = "no-referrer" );
});
domInsertionObserver.observe( document.body.firstChild, { childList: true, subtree:true });
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment