|
1 | 1 | // ==UserScript== |
2 | | -// @version 2.5.250318.2132 |
| 2 | +// @version 2.5.250319.1643 |
3 | 3 | // @author Write |
4 | 4 | // @name OphirofoxScript |
5 | 5 | // @grant GM.getValue |
|
104 | 104 | // @include https://www.lemonde.fr/* |
105 | 105 | // @include https://www.liberation.fr/* |
106 | 106 | // @include https://next.liberation.fr/* |
107 | | -// @include https://*.lefigaro.fr/* |
| 107 | +// @include https://www.lefigaro.fr/* |
| 108 | +// @include https://leparticulier.lefigaro.fr/* |
108 | 109 | // @include https://www.monde-diplomatique.fr/* |
109 | 110 | // @include https://www.courrierdesmaires.fr/* |
110 | 111 | // @include https://www.la-croix.com/* |
|
1242 | 1243 | `); |
1243 | 1244 | } |
1244 | 1245 |
|
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/*")) { |
1246 | 1284 |
|
1247 | 1285 | window.addEventListener("load", function(event) { |
1248 | 1286 | function extractKeywords() { |
|
1276 | 1314 | .ophirofox-europresse { |
1277 | 1315 | margin-left: 10px; |
1278 | 1316 | } |
1279 | | - |
1280 | | - .appconsent_noscroll { |
1281 | | - overflow: unset !important; |
1282 | | - } |
1283 | 1317 | `); |
1284 | 1318 | } |
1285 | 1319 |
|
|
1323 | 1357 | .ophirofox-europresse { |
1324 | 1358 | margin-left: 10px; |
1325 | 1359 | } |
1326 | | - |
1327 | | - .appconsent_noscroll { |
1328 | | - overflow: unset !important; |
1329 | | - } |
1330 | 1360 | `); |
1331 | 1361 | } |
1332 | 1362 |
|
|
0 commit comments