// ==UserScript== // @name Platesmania Lookup Toolbox // @version 1.11.1 // @description Shows lookup buttons on Platesmania upload pages. // @match https://platesmania.com/*/add* // @grant GM_setValue // @grant GM_getValue // @grant GM_xmlhttpRequest // @connect opendata.rdw.nl // @connect motonet.fi // @license MIT // @namespace https://greasyfork.org/users/976031 // @downloadURL none // ==/UserScript== (function () { 'use strict'; // --- Settings: Button Size Mode (Large/Small) --- const SIZE_KEY = 'lookup_button_size_mode'; function getSizeMode() { try { if (typeof GM_getValue === 'function') { return GM_getValue(SIZE_KEY, 'Large') || 'Large'; } } catch {} return 'Large'; } function setSizeMode(mode) { try { if (typeof GM_setValue === 'function') GM_setValue(SIZE_KEY, mode); } catch {} // re-render after saving to apply immediately render(); } function getFaviconForUrl(urlStr) { try { const u = new URL(urlStr); const domain = u.hostname; return `https://www.google.com/s2/favicons?sz=64&domain=${domain}`; } catch { return ''; } } function getFaviconCandidatesForUrl(urlStr) { try { const u = new URL(urlStr); const s2 = `https://www.google.com/s2/favicons?sz=64&domain=${u.hostname}`; const ico = `${u.origin}/favicon.ico`; return [s2, ico]; } catch { return []; } } const lookupSites = { nl: [ { name: 'Finnik', base: 'https://finnik.nl/kenteken/' }, { name: 'Autoweek', base: 'https://www.autoweek.nl/kentekencheck/' }, { name: 'voertuig.net', base: 'https://voertuig.net/kenteken/' }, { name: 'Centraal Beheer', base: 'https://centraalbeheer.finnik.nl/kenteken/' }, { name: 'Kentekencheck.info', base: 'https://www.kentekencheck.info/kenteken/' }, { name: 'Kentekencheck.nu', base: 'https://www.kentekencheck.nu/kenteken/' }, { name: 'Qenteken', base: 'https://www.qenteken.nl/kentekencheck/' }, { name: 'RDW (Website)', base: 'https://www.rdwdata.nl/kenteken/' }, ], se: [ { name: 'car.info', base: 'https://www.car.info/?s=' }, { name: 'biluppgifter.se', base: 'https://biluppgifter.se/fordon/' }, { name: 'transportstyrelsen', base: 'https://fordon-fu-regnr.transportstyrelsen.se/?ts-regnr-sok=' }, ], ua: [ { name: 'carplates.app', base: 'https://ua.carplates.app/en/number/' }, { name: 'baza-gai.com.ua', base: 'https://baza-gai.com.ua/nomer/' }, { name: 'auto-inform.com.ua', base: 'https://auto-inform.com.ua/search/' }, ], uk: [ { name: 'checkcardetails.co.uk', base: 'https://www.checkcardetails.co.uk/cardetails/' }, { name: 'totalcarcheck.co.uk', base: 'https://totalcarcheck.co.uk/FreeCheck?regno=' }, { name: 'checkhistory.co.uk', base: 'https://checkhistory.uk/vehicle/' }, ], dk: [ { name: 'digitalservicebog.dk', base: 'https://app.digitalservicebog.dk/search?country=dk&Registration=' }, { name: 'esyn.dk', base: 'https://findsynsrapport.esyn.dk/result?registration=' }, ], no: [{ name: 'vegvesen.no', base: 'https://www.vegvesen.no/en/vehicles/buy-and-sell/vehicle-information/check-vehicle-information/?registreringsnummer=' }, { name: 'regnr.info', base: 'https://regnr.info/' } ], fr: [ { name: 'immatriculation-auto.info', base: 'https://immatriculation-auto.info/vehicle/' }, { name: 'carter-cash.com', base: 'https://www.carter-cash.com/?plate=', needsHyphen: true }, ], es: [ { name: 'carter-cash.es', base: 'https://www.carter-cash.es/piezas-auto/?plate=' }, ], fi: [ { name: 'Biltema', base: 'https://www.biltema.fi/sv-fi/rekosok-bil/' }, { name: 'Motonet (in new tab)', base: 'https://www.motonet.fi/api/vehicleInfo/registrationNumber/FI?locale=fi®istrationNumber=' }, ], cz: [{ name: 'uniqa.cz', base: 'https://www.uniqa.cz/online/pojisteni-vozidla/#ecvId=' }], sk: [{ name: 'overenie.digital', base: 'https://overenie.digital/over/sk/ecv/' }, { name: 'stkonline', base: 'https://www.stkonline.sk/spz/' } ], ie: [{ name: 'cartell.ie', base: 'https://www.cartell.ie/ssl/servlet/beginStarLookup?registration=' }, { name: 'motorcheck.ie', base: 'https://www.motorcheck.ie/free-car-check/?vrm=' } ], is: [{ name: 'island.is', base: 'https://island.is/uppfletting-i-oekutaekjaskra?vq=' }], }; const url = window.location.href; const isPage = (code) => url.includes(`platesmania.com/${code}/add`); const supportedCodes = ['nl','ua','no','dk','fr','uk','fi','pl','lt','cz','se','es', 'sk', 'us', 'ie', 'is']; // Platesmania US: mapping of