diff --git a/ophirofox/content_scripts/lobs.css b/ophirofox/content_scripts/lobs.css index bd7a3b7..3bc2900 100644 --- a/ophirofox/content_scripts/lobs.css +++ b/ophirofox/content_scripts/lobs.css @@ -9,11 +9,14 @@ font-family: "Karla",ff-karla,sans-serif; font-weight: 700; text-align: center; - margin-bottom: 2rem!important; - + display: block; + width: 200px; + margin-top: 1rem; + margin-bottom: 1rem; + } .ophirofox-europresse:hover, .ophirofox-europresse:active { - background-color: #000000; - color: #ffffff; + background-color: #000000; + color: #ffffff; } \ No newline at end of file diff --git a/ophirofox/content_scripts/lobs.js b/ophirofox/content_scripts/lobs.js index 95343d9..f92b389 100644 --- a/ophirofox/content_scripts/lobs.js +++ b/ophirofox/content_scripts/lobs.js @@ -1,14 +1,19 @@ -function findPremiumBanner() { - const title = document.querySelector(".article-page-header"); - if (!title) return null; - const elems = title.parentElement.querySelectorAll("a"); - return [...elems].find(d => d.href.includes("ph-abo")) +function extractKeywords() { + return document.querySelector("h1").textContent; } +const isPremium = () => { + const metaElement = document.querySelector('meta[name="ad:teaser"]'); + if (metaElement) { + if (metaElement.content === 'true') + return true; + } + return false; +}; + async function onLoad() { - const head = findPremiumBanner(); - if (!head) return; - head.after(await ophirofoxEuropresseLink()); + if (!isPremium()) return; + document.querySelector("h1").after(await ophirofoxEuropresseLink(extractKeywords())); } onLoad().catch(console.error); \ No newline at end of file