Last active
October 6, 2021 16:37
-
-
Save fabienhinault/4cdaa6db9332e987728bbdc733822b64 to your computer and use it in GitHub Desktop.
timer on keycloak's auth page
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
// @match https://*/auth/realms/myrealm/protocol/openid-connect/auth* | |
(function() { | |
'use strict'; | |
var divDuration = document.createElement("div"); | |
divDuration.setAttribute('id', 'userscript_duration'); | |
document.getElementById('kc-header-wrapper').after(divDuration); | |
const start = Date.now(); | |
function update_userscript_duration() { | |
document.getElementById('userscript_duration').innerHTML = ((Date.now() - start) / 1000 / 60).toFixed(1); | |
setTimeout(update_userscript_duration, 6000); | |
} | |
update_userscript_duration(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment