Skip to content

Instantly share code, notes, and snippets.

@WesleiRamos
Last active January 14, 2018 15:58
Show Gist options
  • Save WesleiRamos/282922cd2743519fc035557ed4b48d7d to your computer and use it in GitHub Desktop.
Save WesleiRamos/282922cd2743519fc035557ed4b48d7d to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @include *://mail.google.com/*
// @grant none
// ==/UserScript==
(function() {
function DetectImagem(element) {
for (var x in element) {
if (element[x] === undefined || element[x] === null) continue;
if (element[x].tagName == "IMG") return true;
}
return false;
}
var f = document.getElementsByName("t");
for (var i in f) {
if (f[i] === undefined || f[i].parentNode == undefined) continue;
if (!DetectImagem(f[i].parentElement.childNodes)) {
f[i].checked = true;
}
}
var s = document.getElementsByName("nvp_a_tr")[0];
if (!s) s = document.getElementsByName("nvp_a_dl")[0];
s.click();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment