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