File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -3,8 +3,6 @@ import { scriptVersion } from '../utils/1.variables';
3
3
import { getPageName } from '../utils/onPage' ;
4
4
5
5
function loaded ( ) {
6
- // TODO: needs to do this faster, due to new script builder, impossible to make this go last (without a bunch of work)
7
- eventManager . singleton . emit ( ':ready' ) ;
8
6
eventManager . singleton . emit ( ':loaded' ) ;
9
7
eventManager . singleton . emit ( `:loaded:${ getPageName ( ) } ` ) ;
10
8
}
@@ -13,8 +11,13 @@ function done() {
13
11
eventManager . singleton . emit ( `:load:${ getPageName ( ) } ` ) ;
14
12
}
15
13
16
- if ( location . host . includes ( 'undercards.net' ) && document . title . includes ( 'Undercards' ) ) {
14
+ if ( location . host . includes ( 'undercards.net' ) ) {
17
15
console . log ( `UnderScript(v${ scriptVersion } ): Loaded` ) ; // eslint-disable-line no-console
16
+ if ( document . title . includes ( 'Undercards' ) ) {
17
+ register ( ) ;
18
+ }
19
+ }
20
+ function register ( ) {
18
21
document . addEventListener ( 'DOMContentLoaded' , loaded ) ;
19
22
window . addEventListener ( 'load' , done ) ;
20
23
const COMPLETE = document . readyState === 'complete' ;
Original file line number Diff line number Diff line change @@ -406,7 +406,7 @@ export function importSettings(string) {
406
406
init ( 'main' ) ;
407
407
408
408
// Add our button last
409
- eventManager . on ( ':ready ' , ( ) => {
409
+ eventManager . on ( ':load ' , ( ) => {
410
410
menu . addButton ( {
411
411
text : 'Settings' ,
412
412
action : ( ) => {
You can’t perform that action at this time.
0 commit comments