Skip to content

Commit 265a03c

Browse files
author
github-actions
committed
Release from Ophirofox v2.5.250319.1643
1 parent 46f03a3 commit 265a03c

File tree

1 file changed

+41
-11
lines changed

1 file changed

+41
-11
lines changed

ophirofox.user.js

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// ==UserScript==
2-
// @version 2.5.250318.2132
2+
// @version 2.5.250319.1643
33
// @author Write
44
// @name OphirofoxScript
55
// @grant GM.getValue
@@ -104,7 +104,8 @@
104104
// @include https://www.lemonde.fr/*
105105
// @include https://www.liberation.fr/*
106106
// @include https://next.liberation.fr/*
107-
// @include https://*.lefigaro.fr/*
107+
// @include https://www.lefigaro.fr/*
108+
// @include https://leparticulier.lefigaro.fr/*
108109
// @include https://www.monde-diplomatique.fr/*
109110
// @include https://www.courrierdesmaires.fr/*
110111
// @include https://www.la-croix.com/*
@@ -1242,7 +1243,44 @@
12421243
`);
12431244
}
12441245

1245-
if (match(hostname, "https://*.lefigaro.fr/*")) {
1246+
if (match(hostname, "https://www.lefigaro.fr/*")) {
1247+
1248+
window.addEventListener("load", function(event) {
1249+
function extractKeywords() {
1250+
return document.querySelector("h1").textContent;
1251+
}
1252+
1253+
async function createLink() {
1254+
const a = await ophirofoxEuropresseLink(extractKeywords());
1255+
a.classList.add("fig-premium-mark-article__text");
1256+
return a;
1257+
}
1258+
1259+
1260+
function findPremiumBanner() {
1261+
const title = document.querySelector("h1");
1262+
if (!title) return null;
1263+
const elems = title.parentElement.querySelectorAll("span");
1264+
return [...elems].find(d => d.textContent.includes("Réservé aux abonnés"))
1265+
}
1266+
1267+
async function onLoad() {
1268+
const premiumBanner = findPremiumBanner();
1269+
if (!premiumBanner) return;
1270+
premiumBanner.after(await createLink());
1271+
}
1272+
1273+
onLoad().catch(console.error);
1274+
});
1275+
1276+
pasteStyle(`
1277+
.ophirofox-europresse {
1278+
margin-left: 10px;
1279+
}
1280+
`);
1281+
}
1282+
1283+
if (match(hostname, "https://leparticulier.lefigaro.fr/*")) {
12461284

12471285
window.addEventListener("load", function(event) {
12481286
function extractKeywords() {
@@ -1276,10 +1314,6 @@
12761314
.ophirofox-europresse {
12771315
margin-left: 10px;
12781316
}
1279-
1280-
.appconsent_noscroll {
1281-
overflow: unset !important;
1282-
}
12831317
`);
12841318
}
12851319

@@ -1323,10 +1357,6 @@
13231357
.ophirofox-europresse {
13241358
margin-left: 10px;
13251359
}
1326-
1327-
.appconsent_noscroll {
1328-
overflow: unset !important;
1329-
}
13301360
`);
13311361
}
13321362

0 commit comments

Comments
 (0)