Skip to content

Instantly share code, notes, and snippets.

@sergiolopes
Created October 30, 2015 13:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sergiolopes/807ccdf8795648bf7235 to your computer and use it in GitHub Desktop.
Save sergiolopes/807ccdf8795648bf7235 to your computer and use it in GitHub Desktop.
Bookmarklet pra colar codigo de boleto no home banking do santander
javascript:void(function(){
var boleto = prompt();
var partes = boleto.trim().split(/[^\d]+/);
var iframe = document.querySelector('[name="Principal"]').contentWindow.document.querySelector('[name="Corpo"]').contentWindow.document.querySelector('#iframePrinc').contentWindow;
var inputs = iframe.document.querySelectorAll('.lista input');
for (var i = 0; i < inputs.length; i++) {
inputs[i].value = partes[i];
inputs[i].dispatchEvent(new Event('blur'));
}
iframe.onCompleta(partes[partes.length-1]);
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment