Created
October 21, 2020 23:41
-
-
Save viniciuscsouza/4897fd32082482fc11990bc94d79f97c to your computer and use it in GitHub Desktop.
Bookmarklet que exibe opções disponíveis nas caixas de seleção.
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
javascript:(function() { | |
var frames = document.querySelectorAll('iframe'); | |
var listaDeParcelas; | |
var valores; | |
for(let frm of frames){ | |
if(frm.contentWindow.document.body.querySelectorAll('select').length > 0){ | |
valores = []; | |
valores.push("Opções disponíveis: \n"); | |
listaDeParcelas = frm.contentWindow.document.body.querySelectorAll('option'); | |
listaDeParcelas.forEach((item) => { | |
if(item.textContent.length > 3 && item.textContent !== null){ | |
valores.push(item.getAttribute('label')); | |
}; | |
}); | |
}; | |
}; | |
for (var i = 0; i < valores.length; i++){ | |
if(valores[i]=== null){ | |
valores.splice(i, 2) | |
}; | |
valores[i] = valores[i]+ "\n"; | |
}; | |
alert(valores); | |
} | |
)(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment