diff --git a/ophirofox/content_scripts/lsa-conso.css b/ophirofox/content_scripts/lsa-conso.css new file mode 100644 index 0000000..1352b44 --- /dev/null +++ b/ophirofox/content_scripts/lsa-conso.css @@ -0,0 +1,24 @@ +.ophirofox-europresse { + background-color: rgb(254, 194, 45); + box-sizing: border-box; + color: rgb(0, 0, 0); + display: block; + font-family: robotoslab-bold, Arial, Helvetica, sans-serif; + font-size: 16px; + height: 38px; + line-height: 18.4px; + padding-bottom: 10px; + padding-left: 10px; + padding-right: 10px; + padding-top: 10px; + text-align: center; + width: 190px; + -webkit-user-drag: auto; + -webkit-user-select: text; + text-decoration: none; + margin-bottom: 10px; +} + +.ophirofox-europresse:hover { + color: #ffffff; +} \ No newline at end of file diff --git a/ophirofox/content_scripts/lsa-conso.js b/ophirofox/content_scripts/lsa-conso.js new file mode 100644 index 0000000..1f536f4 --- /dev/null +++ b/ophirofox/content_scripts/lsa-conso.js @@ -0,0 +1,26 @@ +function extractKeywords() { + return document + .querySelector("meta[property='og:title']") + .getAttribute("content"); +} + +async function createLink() { + const a = await ophirofoxEuropresseLink(extractKeywords()); + return a; +} + +function findPremiumBanner() { + const anchor = document.querySelector('div.epMetaData__head-open'); + if (!anchor) { + return; + } + return anchor; +} + +async function onLoad() { + const premiumBanner = findPremiumBanner(); + if (!premiumBanner) return; + premiumBanner.parentElement.before(await createLink()); +} + +onLoad().catch(console.error); \ No newline at end of file diff --git a/ophirofox/manifest.json b/ophirofox/manifest.json index a5bb125..39f6a3f 100644 --- a/ophirofox/manifest.json +++ b/ophirofox/manifest.json @@ -476,6 +476,18 @@ "css": [ "content_scripts/le-telegramme.css" ] + }, + { + "matches": [ + "https://www.lsa-conso.fr/*" + ], + "js": [ + "content_scripts/config.js", + "content_scripts/lsa-conso.js" + ], + "css": [ + "content_scripts/lsa-conso.css" + ] } ], "browser_specific_settings": {