File tree Expand file tree Collapse file tree 1 file changed +46
-1
lines changed Expand file tree Collapse file tree 1 file changed +46
-1
lines changed Original file line number Diff line number Diff line change 11// ==UserScript==
2- // @version 2.6.98.937
2+ // @version 2.6.910.1130
33// @author Write
44// @name OphirofoxScript
55// @grant GM.getValue
168168// @include https://investir.lesechos.fr/*
169169// @include https://www.jeuneafrique.com/*
170170// @include https://www.leberry.fr/*
171+ // @include https://www.economist.com/*
171172//
172173// @run -at document-start
173174//
45354536 }
45364537 ` ) ;
45374538 }
4539+
4540+ if ( match ( hostname , "https://www.economist.com/*" ) ) {
4541+
4542+ window . addEventListener ( "load" , function ( event ) {
4543+ function extractKeywords ( ) {
4544+ return document
4545+ . querySelector ( "meta[property='og:title']" )
4546+ . getAttribute ( "content" ) ;
4547+ }
4548+
4549+ async function createLink ( ) {
4550+ const a = await ophirofoxEuropresseLink ( extractKeywords ( ) ) ;
4551+ return a ;
4552+ }
4553+
4554+ function findPremiumBanner ( ) {
4555+ const anchor = document . querySelector ( '#regwall-container' ) ;
4556+ if ( ! anchor ) {
4557+ return ;
4558+ }
4559+ return anchor ;
4560+ }
4561+
4562+ async function onLoad ( ) {
4563+ const premiumBanner = findPremiumBanner ( ) ;
4564+ if ( ! premiumBanner ) return ;
4565+ premiumBanner . parentElement . before ( await createLink ( ) ) ;
4566+ document . querySelector ( 'h1' ) . after ( await createLink ( ) )
4567+ }
4568+
4569+ onLoad ( ) . catch ( console . error ) ;
4570+ } ) ;
4571+
4572+ pasteStyle ( `
4573+ .ophirofox-europresse{
4574+ background: #1f2e7a;
4575+ color: #fff;
4576+ border: 0.125rem solid transparent;
4577+ border-radius: 1.25rem;
4578+ align-items: center;
4579+ padding: 0.375rem 1rem;
4580+ }
4581+ ` ) ;
4582+ }
45384583} ) ( ) ;
You can’t perform that action at this time.
0 commit comments