Coletar dados do Navegador
Campos importantes:
Objetivo:
Script de coleta:
<div style="display: none;">
<iframe id="cardinal_collection_iframe" name="collectionIframe" height="1" width="1"></iframe>
<form id="cardinal_collection_form" method="POST" target="collectionIframe">
<input id="cardinal_collection_form_input" type="text" name="JWT" value="">
</form>
</div>
<script>
const collectUrl = '<collectUrl>';
const token = '<token>';
const docFormCardinal = document.getElementById('cardinal_collection_form');
const docInputCardinal = document.getElementById('cardinal_collection_form_input');
docFormCardinal.action = collectUrl;
docInputCardinal.value = token;
docFormCardinal.submit();
window.addEventListener("message", function (event) {
const origin = new URL(collectUrl).origin;
if (event.origin === origin) {
const data = JSON.parse(event.data);
console.log('COLETA FINALIZADA:', data);
}
});
</script>
Observação:
Last updated
Was this helpful?

