Skip to content

Commit

Permalink
WIP ajout usine nouvelle (#299)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremieGiffard authored Feb 16, 2025
1 parent 5b56435 commit ceee3d2
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Voici la liste triée par ordre alphabétique :
- [Les Échos](https://www.lesechos.fr)
- [Mediapart (nécessite un abonnement BNF)](https://www.mediapart.fr/)
- [Télérama (Magazine en PDF)](https://www.telerama.fr/kiosque/telerama)
- [L'Usine Nouvelle](https://www.usinenouvelle.com/)

### Presse régionale
- [Corse Matin](https://www.corsematin.com/)
Expand Down
25 changes: 25 additions & 0 deletions ophirofox/content_scripts/usineNouvelle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
function extractKeywords() {
return document.querySelector(".editoSocialBar__item[data-title]").dataset.title
}

async function createLink() {
const a = await ophirofoxEuropresseLink(extractKeywords());
a.style = 'font-family: "arimo-bold",Arial,Helvetica,sans-serif; border-bottom: 2px solid #000; margin-left : 1rem'
return a;
}

function findPremiumBanner() {
const div = document.querySelector(".epPayWallTop");
if (!div) return null;
console.log('all div', div)
console.log('last child', div.lastElementChild)
return elem = div.lastElementChild;
}

async function onLoad() {
const premiumBanner = findPremiumBanner();
if (!premiumBanner) return;
premiumBanner.after(await createLink());
}

onLoad().catch(console.error);
9 changes: 9 additions & 0 deletions ophirofox/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,15 @@
"css": [
"content_scripts/pressreader.css"
]
},
{
"matches": [
"https://www.usinenouvelle.com/*"
],
"js": [
"content_scripts/config.js",
"content_scripts/usineNouvelle.js"
]
}
],
"browser_specific_settings": {
Expand Down

0 comments on commit ceee3d2

Please sign in to comment.