Skip to content

Instantly share code, notes, and snippets.

@viniciuscsouza
Created October 21, 2020 23:41
Show Gist options
  • Save viniciuscsouza/4897fd32082482fc11990bc94d79f97c to your computer and use it in GitHub Desktop.
Save viniciuscsouza/4897fd32082482fc11990bc94d79f97c to your computer and use it in GitHub Desktop.
Bookmarklet que exibe opções disponíveis nas caixas de seleção.
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