@@ -491,7 +491,7 @@ describe.concurrent("GM_value", () => {
491491 expect ( mockSendMessage ) . toHaveBeenNthCalledWith (
492492 3 ,
493493 expect . objectContaining ( {
494- action : "content /runtime/gmApi" ,
494+ action : "scripting /runtime/gmApi" ,
495495 data : {
496496 api : "GM_setValue" ,
497497 params : [ expect . any ( String ) , "proxy-key" , { } ] , // Proxy 会被转换为空对象
@@ -505,7 +505,7 @@ describe.concurrent("GM_value", () => {
505505 expect ( mockSendMessage ) . toHaveBeenNthCalledWith (
506506 4 ,
507507 expect . objectContaining ( {
508- action : "content /runtime/gmApi" ,
508+ action : "scripting /runtime/gmApi" ,
509509 data : {
510510 api : "GM_setValue" ,
511511 params : [ expect . any ( String ) , "window" ] , // window 会被转换为空对象
@@ -757,19 +757,14 @@ return { value1, value2, value3, values1,values2, allValues1, allValues2, value4
757757 expect ( mockSendMessage ) . toHaveBeenNthCalledWith (
758758 3 ,
759759 expect . objectContaining ( {
760- action : "content /runtime/gmApi" ,
760+ action : "scripting /runtime/gmApi" ,
761761 data : {
762762 api : "GM_setValues" ,
763763 params : [
764764 // event id
765765 expect . stringMatching ( / ^ .+ : : \d + $ / ) ,
766766 // the object payload
767- expect . objectContaining ( {
768- k : expect . stringMatching ( / ^ # # [ \d . ] + # # $ / ) ,
769- m : expect . objectContaining ( {
770- "proxy-key" : { } ,
771- } ) ,
772- } ) ,
767+ [ [ "proxy-key" , encodeRValue ( { } ) ] ] ,
773768 ] ,
774769 runFlag : expect . any ( String ) ,
775770 uuid : undefined ,
@@ -781,19 +776,19 @@ return { value1, value2, value3, values1,values2, allValues1, allValues2, value4
781776 expect ( mockSendMessage ) . toHaveBeenNthCalledWith (
782777 4 ,
783778 expect . objectContaining ( {
784- action : "content /runtime/gmApi" ,
779+ action : "scripting /runtime/gmApi" ,
785780 data : {
786781 api : "GM_setValues" ,
787782 params : [
788783 // event id
789784 expect . stringMatching ( / ^ .+ : : \d + $ / ) ,
790785 // the object payload
791- expect . objectContaining ( {
792- k : expect . stringMatching ( / ^ # # [ \d . ] + # # $ / ) ,
793- m : expect . objectContaining ( {
794- window : expect . stringMatching ( / ^ # # [ \d . ] + # # u n d e f i n e d $ / ) ,
795- } ) ,
796- } ) ,
786+ [
787+ [
788+ "window" ,
789+ encodeRValue ( undefined ) , // window 会被转换为 undefined
790+ ] ,
791+ ] ,
797792 ] ,
798793 runFlag : expect . any ( String ) ,
799794 uuid : undefined ,
0 commit comments