Last active
August 29, 2015 14:00
-
-
Save stefanschmidt/11067780 to your computer and use it in GitHub Desktop.
Disable annoying Quora login request in Safari
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
/* 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