Skip to content

Instantly share code, notes, and snippets.

@niikoo
Last active July 7, 2021 21:17
Show Gist options
  • Save niikoo/5948a7d0a2d1bee2f0cfc1321ee6e7d9 to your computer and use it in GitHub Desktop.
Save niikoo/5948a7d0a2d1bee2f0cfc1321ee6e7d9 to your computer and use it in GitHub Desktop.
Prevent clicking entries in 'skattelisten'
// ==UserScript==
// @name Prevent clicking search results in "Skattelisten".
// @namespace http://tampermonkey.net/
// @version 0.3.3
// @author niikoo
// @match https://tjenester.skatteetaten.no/personsok
// @grant none
// @downloadURL https://gist.github.com/niikoo/5948a7d0a2d1bee2f0cfc1321ee6e7d9/raw/skattelisten.clickdrop.user.js
// @updateURL https://gist.github.com/niikoo/5948a7d0a2d1bee2f0cfc1321ee6e7d9/raw/skattelisten.clickdrop.user.js
// @icon https://icons.duckduckgo.com/ip2/skatteetaten.no.ico
// ==/UserScript==
/* global $ */
/* eslint-disable no-multi-spaces, curly */
/*
0.3 - Show a person's age.
0.2 - Add update url
0.1 - Initial release
*/
$(function() {
'use strict';
$("#personSearch").find('a').each(function() {
let $this = $(this);
$this.children().off();
$this.off();
let $parent = $this.parent();
$parent.html($this.text());
$parent.css({pointerEvents: 'none', });
});
const currentYear = new Date().getFullYear();
$("#personSearch").find("tr").each(function() {
let $this = $(this);
let $year = $this.find('td:eq(2)');
let year = parseInt($year.text());
let age = currentYear - year;
$year.text(year + ' (' + age + ' år gammel i ' + currentYear + ')');
});
});
@niikoo
Copy link
Author

niikoo commented Nov 14, 2020

Tested using Tampermonkey on Google Chrome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment