Skip to content

Instantly share code, notes, and snippets.

@fellypsantos
Last active February 18, 2022 17:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fellypsantos/c10515c430a8e1ac6ad7c19c17ed93e4 to your computer and use it in GitHub Desktop.
Save fellypsantos/c10515c430a8e1ac6ad7c19c17ed93e4 to your computer and use it in GitHub Desktop.
Script para desabilitar expiração de sessão do CadSUSWeb, assim o operador fica sempre logado aumentando a produtividade pois não terá de fazer logins demorados consantemente.
// ==UserScript==
// @name CADSUS Web - Sessão Ilimitada
// @namespace cadsusweb#fellypsantos2011@gmail.com
// @version 1.0
// @description Mantém sessão cadsusweb ativada até que o navegador seja fechado.
// @author fellypsantos2011@gmail.com
// @match https://cadastro.saude.gov.br/novocartao/restrito/usuarioConsulta.jsp*
// @match https://cadastro.saude.gov.br/novocartao/restrito/usuarioCadastro.jsp*
// @downloadURL https://gist.github.com/fellypsantos/c10515c430a8e1ac6ad7c19c17ed93e4/raw/68ad0c130b195aeedddfa674f8252214e67997aa/CadSUSWebNoExpire.user.js
// @updateURL https://gist.github.com/fellypsantos/c10515c430a8e1ac6ad7c19c17ed93e4/raw/68ad0c130b195aeedddfa674f8252214e67997aa/CadSUSWebNoExpire.user.js
// @icon https://www.google.com/s2/favicons?domain=gov.br
// @grant none
// ==/UserScript==
var timeoutDialog;
window.$.idleTimeout(
timeoutDialog,
"div.ui-dialog-buttonpane button:first",
{
titleMessage: "",
idleAfter: 9999,
pollingInterval: 9999,
keepAliveURL: window.context + "restrito/manterSessaoAtiva.form",
serverResponseEquals: "OK",
onTimeout: () => {},
onIdle: () => {},
onCountdown: () => {},
}
);
setInterval(() => {
window.$.ajax('https://cadastro.saude.gov.br/novocartao/restrito/manterSessaoAtiva.form')
.then(response => {console.log('manterSessaoAtiva: ', response)});
}, 30*1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment