Skip to content

Instantly share code, notes, and snippets.

@royalgarter
Last active June 25, 2017 16:29
Show Gist options
  • Save royalgarter/768ce00866d0f6e9159dfd5beaf292b9 to your computer and use it in GitHub Desktop.
Save royalgarter/768ce00866d0f6e9159dfd5beaf292b9 to your computer and use it in GitHub Desktop.
Remove quote for Gmail reply
var fnMain = function () {
// console.log('fnMain', window.location.href, document.querySelectorAll('.amn').length);
if (!(/mail.google.com.*mail.*inbox\/\S{16}/).test(window.location.href) || !document.querySelector('.amn'))
return setTimeout(fnMain, 500);
console.log('Reply box appeared');
document.querySelector('.amn span[class="ams bkI"]').onclick =
document.querySelector('.amn span[class="ams bkH"]').onclick =
function () {
console.log('Reply clicked');
var delay = 100;
var fnCheck = function () {
console.log('...checking quotes');
var trimmedDot = document.querySelectorAll('.iN .ajR')[0];
if (!trimmedDot) return (delay*=2) & setTimeout(fnCheck, delay);
trimmedDot.onclick = function () {
document.querySelectorAll('.iN .gmail_extra')[0].remove();
}
var ev = document.createEvent('MouseEvent');
ev.initMouseEvent( 'click', true , true , window);
trimmedDot.dispatchEvent(ev);
};
setTimeout(fnCheck, delay);
};
}
window.onload = fnMain;
window.addEventListener('popstate', fnMain);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment