Skip to content

Instantly share code, notes, and snippets.

@stefanschmidt
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stefanschmidt/11067780 to your computer and use it in GitHub Desktop.
Save stefanschmidt/11067780 to your computer and use it in GitHub Desktop.
Disable annoying Quora login request in Safari
/* approach from browser extension by Ameya Lokare */
/* for use with e.g. http://canisbos.com/quickscript */
function containsShare(url) {
return /[&\?]share=1/.test(url);
}
function addShare(url) {
if (url.indexOf('?') < 0) {
url += "?share=1";
} else {
url += "&share=1";
}
return url;
}
var url = document.location.href;
if (!containsShare(url)) {
history.pushState('data', '', addShare(url));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment