File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed
Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 55 "zh" : " 🔥🔥🔥移除页面水印🔥🔥🔥"
66 },
77 "namespace" : " https://github.com/WindrunnerMax/TKScript" ,
8- "version" : " 1.0.5 " ,
8+ "version" : " 1.0.6 " ,
99 "description" : {
1010 "default" : " 移除常见网页的水印" ,
1111 "en" : " Remove watermarks from common web pages" ,
1717 "license" : " GPL License" ,
1818 "installURL" : " https://github.com/WindrunnerMax/TKScript" ,
1919 "run-at" : " document-start" ,
20- "grant" : [" unsafeWindow" ]
20+ "grant" : [" GM_addStyle " , " unsafeWindow" ]
2121}
Original file line number Diff line number Diff line change @@ -4,3 +4,5 @@ declare module "*.css" {
44 const content : string ;
55 export default content ;
66}
7+
8+ declare const GM_addStyle : ( css : string ) => void ;
Original file line number Diff line number Diff line change 11import { styles } from "../../../copy-currency/src/utils" ;
22
33export const injectCSSEarly = ( css : string ) => {
4+ if ( typeof GM_addStyle === "function" ) {
5+ GM_addStyle ( css ) ;
6+ return void 0 ;
7+ }
48 const style = document . createElement ( "style" ) ;
59 style . innerText = css ;
610 const head = document . head ;
711 if ( head ) {
812 head . appendChild ( style ) ;
9- return ;
13+ return void 0 ;
1014 }
1115 const html = document . documentElement ;
1216 if ( html ) {
1317 html . appendChild ( style ) ;
14- return ;
18+ return void 0 ;
1519 }
1620 styles . insertCSS ( String ( Math . random ( ) ) , css ) ;
1721} ;
You can’t perform that action at this time.
0 commit comments