File tree Expand file tree Collapse file tree 6 files changed +12
-23
lines changed
Expand file tree Collapse file tree 6 files changed +12
-23
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,11 @@ if (version.prerelease) {
5656const firefoxManifest = { ...manifest } ;
5757const chromeManifest = { ...manifest } ;
5858
59+ delete chromeManifest . content_security_policy ;
60+
5961delete firefoxManifest . sandbox ;
62+ firefoxManifest . content_security_policy =
63+ "script-src 'self' 'unsafe-eval'; object-src 'self'" ;
6064firefoxManifest . browser_specific_settings = {
6165 gecko : { strict_min_version : "91.1.0" } ,
6266} ;
Original file line number Diff line number Diff line change @@ -77,18 +77,10 @@ export default class MessageContent
7777
7878 nativeSend ( data : any ) : void {
7979 let detail = data ;
80- if ( ( < { cloneInto : any } > ( < unknown > window ) ) . cloneInto ) {
80+ if ( typeof cloneInto !== "undefined" ) {
8181 try {
82- detail = ( <
83- {
84- cloneInto : (
85- // eslint-disable-next-line no-unused-vars, no-shadow
86- detail : any ,
87- // eslint-disable-next-line no-unused-vars
88- view : any
89- ) => { action : string ; data : any } ;
90- }
91- > ( < unknown > global ) ) . cloneInto ( detail , document . defaultView ) ;
82+ // eslint-disable-next-line no-undef
83+ detail = cloneInto ( detail , document . defaultView ) ;
9284 } catch ( e ) {
9385 // eslint-disable-next-line no-console
9486 console . log ( e ) ;
Original file line number Diff line number Diff line change 4242 ],
4343 "sandbox" : {
4444 "pages" : [" src/sandbox.html" ]
45- }
45+ },
46+ "content_security_policy" : " script-src 'self' blob:; object-src 'self' blob:"
4647}
Original file line number Diff line number Diff line change @@ -38,7 +38,6 @@ switchLight(localStorage.lightMode || "auto");
3838ReactDOM . createRoot ( document . getElementById ( "root" ) as HTMLElement ) . render (
3939 < div
4040 style = { {
41- height : "50px" ,
4241 borderBottom : "1px solid var(--color-neutral-3)" ,
4342 } }
4443 >
Original file line number Diff line number Diff line change 11// 缓存key,所有缓存相关的key都需要定义在此
22// 使用装饰器维护缓存值
3-
4- import Cache from "@App/app/cache" ;
53import { ConfirmParam } from "@App/runtime/background/permission_verify" ;
64
75export default class CacheKey {
@@ -23,12 +21,7 @@ export default class CacheKey {
2321
2422 // 加载脚本信息时的缓存,已处理删除
2523 static scriptInfo ( uuid : string ) : string {
26- const key = `scriptInfo:${ uuid } ` ;
27- setTimeout ( ( ) => {
28- // 清理缓存
29- Cache . getInstance ( ) . del ( key ) ;
30- } , 60 * 1000 ) ;
31- return key ;
24+ return `scriptInfo:${ uuid } ` ;
3225 }
3326
3427 // 脚本资源url缓存,可能存在泄漏
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ declare let sandbox: Window;
22
33declare let ScriptFlag : string ;
44
5+ declare let cloneInto : ( ( detail : any , view : any ) => any ) | undefined ;
6+
57declare module "@App/types/scriptcat.d.ts" ;
68declare module "*.tpl" ;
79
@@ -33,5 +35,3 @@ declare namespace GMSend {
3335 filename ?: string ;
3436 }
3537}
36-
37-
You can’t perform that action at this time.
0 commit comments