forked from rolandas-valantinas/gists
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mortgage.user.js
27 lines (25 loc) · 864 Bytes
/
mortgage.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// ==UserScript==
// @name Filter mortgage
// @namespace #
// @version 1.0
// @description Filters mortgages on money supermarket
// @author Rolandas Valantinas
// @supportURL #
// @include *moneysavingexpert.com/mortgages/best-buys*
// @run-at document-start
// @grant none
// ==/UserScript==
(function() {
setInterval(filterMortgages, 2000);
function filterMortgages() {
var feeBlock = document.querySelectorAll("[data-popup='popupMortgageFees']");
var fee;
for (var i = 1; i < feeBlock.length; i++) {
fee = feeBlock[i].parentNode.getElementsByClassName("mainval");
fee = fee[0].innerHTML.replace("£", '').replace(",", '');
if (fee > 550) {
feeBlock[i].parentNode.parentNode.parentNode.remove();
}
}
}
})();