const category = "Categoria:Immagini protette non libere - EDP";

const links = $("a");

for (let i = 0; i < links.length; i++) {
    let params = {
        action: 'query',
        titles: decodeURIComponent(links.attributes.href.value.replace("https://wikines.com/it/", "")),
        prop: 'categories',
        format: 'json'
    };
    let api = new mw.Api();

    api.get(params).done(function (data) {
        if (Object.values(data.query.pages).categories?.some(obj => obj.title === category)) {
            $(links).css({
                'border': '2.5px solid red',
                'height': '100%',
                'display': 'block'
            });
        }
    });
}