Created
October 30, 2015 13:24
-
-
Save sergiolopes/807ccdf8795648bf7235 to your computer and use it in GitHub Desktop.
Bookmarklet pra colar codigo de boleto no home banking do santander
This file contains hidden or 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: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