Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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