1
1
import USAPI from "./api.js" ;
2
- import { getColor } from "@shared/colors.js" ;
2
+ import { colors } from "@shared/colors.js" ;
3
3
4
4
// code received from background page will be stored in this variable
5
5
// code referenced again when strict CSPs block initial injection attempt
@@ -63,13 +63,13 @@ ${userscript.code}
63
63
}
64
64
const world = injectInto === "content" ? "content" : "page" ;
65
65
if ( window . self === window . top ) {
66
- console . info ( `Injecting: ${ name } %c(js/${ world } )` , getColor ( " yellow" ) ) ;
66
+ console . info ( `Injecting: ${ name } %c(js/${ world } )` , colors . yellow ) ;
67
67
} else {
68
68
console . info (
69
69
`Injecting: ${ name } %c(js/${ world } )%c - %cframe(${ label } )(${ window . location } )` ,
70
- getColor ( " yellow" ) ,
71
- getColor ( ) ,
72
- getColor ( " blue" ) ,
70
+ colors . yellow ,
71
+ colors . inherit ,
72
+ colors . blue ,
73
73
) ;
74
74
}
75
75
if ( world === "page" ) {
@@ -95,13 +95,13 @@ ${userscript.code}
95
95
96
96
function injectCSS ( name , code ) {
97
97
if ( window . self === window . top ) {
98
- console . info ( `Injecting ${ name } %c(css)` , getColor ( " green" ) ) ;
98
+ console . info ( `Injecting ${ name } %c(css)` , colors . green ) ;
99
99
} else {
100
100
console . info (
101
101
`Injecting ${ name } %c(css)%c - %cframe(${ label } )(${ window . location } )` ,
102
- getColor ( " green" ) ,
103
- getColor ( ) ,
104
- getColor ( " blue" ) ,
102
+ colors . green ,
103
+ colors . inherit ,
104
+ colors . blue ,
105
105
) ;
106
106
}
107
107
// Safari lacks full support for tabs.insertCSS
@@ -247,7 +247,7 @@ function listeners() {
247
247
for ( let i = 0 ; i < data . files . menu . length ; i ++ ) {
248
248
const item = data . files . menu [ i ] ;
249
249
if ( item . scriptObject . filename === filename ) {
250
- console . info ( `Injecting ${ filename } %c(js)` , getColor ( " yellow" ) ) ;
250
+ console . info ( `Injecting ${ filename } %c(js)` , colors . yellow ) ;
251
251
injectJS ( item ) ;
252
252
return ;
253
253
}
0 commit comments