11// ==UserScript==
2- // @version 2.4.26540.15142
2+ // @version 2.4.26546.33907
33// @author Write
44// @name OphirofoxScript
55// @grant GM.getValue
150150// @include https://www.challenges.fr/*
151151// @include https://www.arretsurimages.net/*
152152// @include https://www.pressreader.com/*
153+ // @include https://www.usinenouvelle.com/*
153154//
154155// @run -at document-start
155156//
35853586 }
35863587 ` ) ;
35873588 }
3589+
3590+ if ( "https://www.usinenouvelle.com/*" . includes ( hostname ) ) {
3591+
3592+ window . addEventListener ( "load" , function ( event ) {
3593+ function extractKeywords ( ) {
3594+ return document . querySelector ( ".editoSocialBar__item[data-title]" ) . dataset . title
3595+ }
3596+
3597+ async function createLink ( ) {
3598+ const a = await ophirofoxEuropresseLink ( extractKeywords ( ) ) ;
3599+ a . style = 'font-family: "arimo-bold",Arial,Helvetica,sans-serif; border-bottom: 2px solid #000; margin-left : 1rem'
3600+ return a ;
3601+ }
3602+
3603+ function findPremiumBanner ( ) {
3604+ const div = document . querySelector ( ".epPayWallTop" ) ;
3605+ if ( ! div ) return null ;
3606+ console . log ( 'all div' , div )
3607+ console . log ( 'last child' , div . lastElementChild )
3608+ return elem = div . lastElementChild ;
3609+ }
3610+
3611+ async function onLoad ( ) {
3612+ const premiumBanner = findPremiumBanner ( ) ;
3613+ if ( ! premiumBanner ) return ;
3614+ premiumBanner . after ( await createLink ( ) ) ;
3615+ }
3616+
3617+ onLoad ( ) . catch ( console . error ) ;
3618+ } ) ;
3619+
3620+ pasteStyle ( `
3621+ .ophirofox-europresse {
3622+ visibility: visible !important;
3623+ position: fixed;
3624+ text-align: center;
3625+ width: 100%;
3626+ top: 0px;
3627+ left: 0px;
3628+ z-index: 50;
3629+ }
3630+ .ophirofox-europresse > a {
3631+ color: #fff !important;
3632+ padding: 1px 20px;
3633+ font-weight: 600;
3634+ background-color: #2bc48c;
3635+ border-radius: 25px;
3636+ }
3637+ ` ) ;
3638+ }
35883639} ) ( ) ;
0 commit comments