File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ settings . register ( {
2+ name : 'Disable version toast' ,
3+ key : 'underscript.season.disable' ,
4+ refresh : ( ) => onPage ( '' ) ,
5+ } ) ;
6+
7+ onPage ( '' , function patches ( ) {
8+ if ( settings . value ( 'underscript.season.disable' ) ) return ;
9+ eventManager . on ( 'loaded' , ( ) => {
10+ document . querySelectorAll ( '.infoIndex' ) . forEach ( ( el ) => {
11+ const text = $el . html . get ( el ) ;
12+ const index = text . indexOf ( ' - ' ) ;
13+ const version = text . substring ( 0 , index ) ;
14+ if ( ! version ) return ;
15+ el . remove ( ) ;
16+ const key = `underscript.season.${ version } .dismissed` ;
17+ if ( settings . value ( key ) ) return ;
18+ fn . dismissable ( {
19+ key,
20+ title : version ,
21+ text : text . substring ( index + 3 ) ,
22+ } ) ;
23+ } ) ;
24+ } ) ;
25+ } ) ;
Original file line number Diff line number Diff line change @@ -37,6 +37,9 @@ const $el = (() => {
3737 el . innerHTML = text ;
3838 return el ;
3939 }
40+ function getHTML ( el ) {
41+ return el . innerHTML ;
42+ }
4043 return {
4144 text : {
4245 contains : containsText ,
@@ -46,6 +49,7 @@ const $el = (() => {
4649 html : {
4750 contains : containsHTML ,
4851 set : setHTML ,
52+ get : getHTML ,
4953 } ,
5054 } ;
5155} ) ( ) ;
You can’t perform that action at this time.
0 commit comments