-
-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ajoute support de lsa-conso.fr (#202)
- Loading branch information
Showing
3 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters