File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ class DebugPermissionVerify implements IPermissionVerify {
50
50
return Promise . resolve ( true ) ;
51
51
}
52
52
}
53
+
53
54
const gmapi = new GMApi ( messageSandbox , new DebugPermissionVerify ( ) ) ;
54
55
gmapi . start ( ) ;
55
56
IoC . registerInstance ( GMApi , gmapi ) ;
@@ -62,6 +63,16 @@ tryConnect(message, (ok: boolean) => {
62
63
}
63
64
} ) ;
64
65
66
+ // 处理沙盒加载消息
67
+ messageSandbox . setHandler ( "sandboxOnload" , ( ) => {
68
+ return Promise . resolve ( true ) ;
69
+ } ) ;
70
+
71
+ // 转发value变更消息给沙盒
72
+ message . setHandler ( "valueUpdate" , ( action , value ) => {
73
+ messageSandbox . send ( "valueUpdate" , value ) ;
74
+ } ) ;
75
+
65
76
ReactDOM . createRoot ( document . getElementById ( "root" ) as HTMLElement ) . render (
66
77
< div >
67
78
< MainLayout className = "!flex-row" pageName = "options" >
Original file line number Diff line number Diff line change @@ -585,7 +585,6 @@ function ScriptEditor() {
585
585
droplist = {
586
586
< Menu
587
587
style = { {
588
- backgroundColor : "var(--color-secondary)" ,
589
588
padding : "0" ,
590
589
margin : "0" ,
591
590
borderRadius : "0" ,
Original file line number Diff line number Diff line change @@ -28,6 +28,9 @@ export default class RuntimeController {
28
28
async debugScript ( script : Script ) {
29
29
// 清理脚本缓存,避免GMApi中的缓存影响
30
30
Cache . getInstance ( ) . del ( CacheKey . script ( script . id ) ) ;
31
+ Cache . getInstance ( ) . del (
32
+ CacheKey . scriptValue ( script . id , script . metadata . storagename )
33
+ ) ;
31
34
// 构建脚本代码
32
35
return this . runtime . startBackgroundScript ( script ) ;
33
36
}
You can’t perform that action at this time.
0 commit comments