Skip to content

Commit

Permalink
Ajout de Corse Matin, La Tribune, L'Opinion, Nice-Matin, L'Orient-Le …
Browse files Browse the repository at this point in the history
…Jour (#184)

* Réparation bouton Le Point

* Ajout de Corse Matin, La Tribune, L'Opinion, Nice-Matin

* Rectification du formatage du code

* Ajout L'Orient-Le Jour
  • Loading branch information
fmoncomble authored Jan 12, 2024
1 parent f3a240c commit c5c47c5
Show file tree
Hide file tree
Showing 13 changed files with 222 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ ophirofox.zip
.DS_Store
ophirofox.crx
ophirofox.pem
ophirofox-*.zip
ophirofox-*.zip
.vscode
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,30 @@ Si votre université n'est pas dans la liste, vous pouvez [l'ajouter](#comment-a
- [L'Express](https://www.lexpress.fr/)
- [L'Humanité](https://www.humanite.fr)
- [L'Obs](https://www.nouvelobs.com/)
- [L'Opinion](https://www.lopinion.fr/)
- [La Croix](https://www.la-croix.com)
- [La Tribune](https://www.latribune.fr)
- [Le Figaro](https://www.lefigaro.fr/)
- [Le Monde Diplomatique](https://www.www.monde-diplomatique.fr)
- [Le Monde](https://www.lemonde.fr/)
- [Le Point](https://www.lepoint.fr)
- [Libération](https://www.liberation.fr/)

### Presse régionale
- [Corse Matin](https://www.corsematin.com/)
- [L'Est républicain](https://www.estrepublicain.fr/)
- [La Dépêche du Midi](https://www.ladepeche.fr/)
- [La Montagne](https://www.lamontagne.fr)
- [La Provence](https://www.laprovence.com/)
- [La Voix du Nord](https://www.lavoixdunord.fr/)
- [Le Parisien](https://www.leparisien.fr/)
- [Nice-Matin](https://www.nicematin.com/)
- [Ouest France](https://www.ouest-france.fr/)
- [Sud Ouest](https://www.sudouest.fr/)

### Presse étrangère
- [Courrier international](https://www.courrierinternational.com)
- [L'Orient-Le Jour (Liban)](https://www.lorientlejour.com/)
- [La Libre Belgique](https://www.lalibre.be/)
- [Le Soir (Belgique)](https://www.lesoir.be)
- [Le Temps (Suisse)](https://www.letemps.ch/)
Expand Down
10 changes: 10 additions & 0 deletions ophirofox/content_scripts/corse-matin.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.ophirofox-europresse {
background-color: #ffc612;
font-family: "Roboto", sans-serif;
padding: 2px 1em;
font-size: 1.4rem;
font-weight: 700;
border-radius: 24px;
margin-left: 1rem;
display: inline-block;
}
19 changes: 19 additions & 0 deletions ophirofox/content_scripts/corse-matin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
async function createLink() {
const a = await ophirofoxEuropresseLink();
a.classList.add();
return a;
}

function findPremiumBanner() {
const title = document.querySelector('div.ml-2');
if (!title) return null;
return title;
}

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

onLoad().catch(console.error);
9 changes: 9 additions & 0 deletions ophirofox/content_scripts/la-tribune.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.ophirofox-europresse {
background-color: #ffc612;
font-family: "Roboto",sans-serif;
padding: 2px 1rem;
font-size: 15px;
color: #163860;
border-radius: 1px;
display: inline-block;
}
20 changes: 20 additions & 0 deletions ophirofox/content_scripts/la-tribune.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
async function createLink() {
const a = await ophirofoxEuropresseLink();
a.classList.add();
return a;
}

function findPremiumBanner() {
const title = document.querySelector('.facade-container');
if (!title) return null;
const elems = title.querySelectorAll('span');
return [...elems].find((d) => d.textContent === 'Réservé aux abonnés');
}

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

onLoad().catch(console.error);
11 changes: 11 additions & 0 deletions ophirofox/content_scripts/lopinion.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.ophirofox-europresse {
background-color: #ffc612;
font-family: serif;
padding: 0.5rem 1.3rem;
font-size: 1.3rem;
font-weight: bold;
vertical-align: middle;
text-align: center;
border-radius: 5px;
display: inline-block;
}
20 changes: 20 additions & 0 deletions ophirofox/content_scripts/lopinion.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
async function createLink() {
const a = await ophirofoxEuropresseLink();
a.classList.add();
return a;
}

function findPremiumBanner() {
const title = document.querySelector('div.paywall');
if (!title) return null;
return title;
}

async function onLoad() {
const premiumBanner = findPremiumBanner();
if (!premiumBanner) return;
const anchor = document.querySelector('.Article-date');
anchor.after(await createLink());
}

onLoad().catch(console.error);
16 changes: 16 additions & 0 deletions ophirofox/content_scripts/lorient-lejour.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.ophirofox-europresse {
font-size: 10px;
font-family: "AktivGrotesk-Medium", Helvetica, Arial, sans-serif;
text-transform: uppercase;
color: #8f7f54;
width: auto;
height: 26px;
padding-left: 8px;
padding-right: 8px;
background-color: #ffdf8a;
display: inline-block;
text-align: center;
vertical-align: middle;
margin: 0 0 0 10px;
line-height: 26px;
}
20 changes: 20 additions & 0 deletions ophirofox/content_scripts/lorient-lejour.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
async function createLink() {
const a = await ophirofoxEuropresseLink();
a.classList.add();
return a;
}

function findPremiumBanner() {
const title = document.querySelector('article.main.premium');
if (!title) return null;
return title;
}

async function onLoad() {
const premiumBanner = findPremiumBanner();
if (!premiumBanner) return;
const anchor = premiumBanner.querySelector('h1');
anchor.appendChild(await createLink());
}

onLoad().catch(console.error);
10 changes: 10 additions & 0 deletions ophirofox/content_scripts/nice-matin.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.ophirofox-europresse {
background-color: #faec70;
font-family: "Raleway", Arial, Helvetica, sans-serif;
margin-left: 2em;
padding: 2px 1em;
font-size: 1.4rem;
font-weight: bold;
border-radius: 24px;
display: inline-block;
}
19 changes: 19 additions & 0 deletions ophirofox/content_scripts/nice-matin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
async function createLink() {
const a = await ophirofoxEuropresseLink();
a.classList.add();
return a;
}

function findPremiumBanner() {
const title = document.querySelector('div.header-subscriber');
if (!title) return null;
return title;
}

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

onLoad().catch(console.error);
60 changes: 60 additions & 0 deletions ophirofox/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,66 @@
"css": [
"content_scripts/est-republicain.css"
]
},
{
"matches": [
"https://www.latribune.fr/*"
],
"js": [
"content_scripts/config.js",
"content_scripts/la-tribune.js"
],
"css": [
"content_scripts/la-tribune.css"
]
},
{
"matches": [
"https://www.lopinion.fr/*"
],
"js": [
"content_scripts/config.js",
"content_scripts/lopinion.js"
],
"css": [
"content_scripts/lopinion.css"
]
},
{
"matches": [
"https://www.nicematin.com/*"
],
"js": [
"content_scripts/config.js",
"content_scripts/nice-matin.js"
],
"css": [
"content_scripts/nice-matin.css"
]
},
{
"matches": [
"https://www.corsematin.com/*"
],
"js": [
"content_scripts/config.js",
"content_scripts/corse-matin.js"
],
"css": [
"content_scripts/corse-matin.css"
]
},
{
"matches": [
"https://www.lorientlejour.com/*"
],
"js": [
"content_scripts/config.js",
"content_scripts/lorient-lejour.js"
],
"css": [
"content_scripts/lorient-lejour.css"
]
}
],
"browser_specific_settings": {
Expand Down

0 comments on commit c5c47c5

Please sign in to comment.