Skip to content

Instantly share code, notes, and snippets.

@forsvunnet
Last active August 3, 2020 14:42
Show Gist options
  • Save forsvunnet/6ed858eb9b5232b1426f030447e4d5bc to your computer and use it in GitHub Desktop.
Save forsvunnet/6ed858eb9b5232b1426f030447e4d5bc to your computer and use it in GitHub Desktop.
Bank ID userscript
// ==UserScript==
// @name Bank ID
// @namespace http://tampermonkey.net/
// @version 0.1
// @description no more username pass for bankid
// @author eivin
// @match https://csfe.bankid.no/*
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js
// @grant none
// ==/UserScript==
/* globals jQuery */
(function() {
'use strict';
const SSN = 00000000000;
const PASSWORD = '*************';
var stage = 0;
jQuery(function($) {
function recurring() {
let label = $('label');
let title = $('label').text();
let input = $('.input_wrapper input');
if (stage === 0 && (title.match(/selsnummer/) || title.match(/User ID/))) {
input.val(SSN).change().submit();
stage++;
}
if (stage < 2 && (title.match(/ngangskode/) || title.match(/One Time Code/))) {
stage = 1;
if (input.val().length === 6) {
input.submit();
stage = 2;
}
}
if (stage === 2 && (title.match(/ersonlig passord/) || title.match(/Personal password/))) {
input.val(PASSWORD).change().submit();
stage++;
}
}
setInterval(recurring, 100);
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment