Skip to content

Commit

Permalink
Ajoute support de lsa-conso.fr (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
Write authored Feb 2, 2024
1 parent 4cc5ef3 commit bd78a43
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
24 changes: 24 additions & 0 deletions ophirofox/content_scripts/lsa-conso.css
Original file line number Diff line number Diff line change
@@ -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;
}
26 changes: 26 additions & 0 deletions ophirofox/content_scripts/lsa-conso.js
Original file line number Diff line number Diff line change
@@ -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);
12 changes: 12 additions & 0 deletions ophirofox/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit bd78a43

Please sign in to comment.