@@ -36,7 +36,7 @@ async function runMutationRequest(params: {
3636 try {
3737 const result = await callBrowserRequest ( params . parent , params . request , { timeoutMs : 20000 } ) ;
3838 if ( params . parent ?. json ) {
39- defaultRuntime . log ( JSON . stringify ( result , null , 2 ) ) ;
39+ defaultRuntime . writeJson ( result ) ;
4040 return ;
4141 }
4242 defaultRuntime . log ( params . successMessage ) ;
@@ -72,10 +72,10 @@ export function registerBrowserCookiesAndStorageCommands(
7272 { timeoutMs : 20000 } ,
7373 ) ;
7474 if ( parent ?. json ) {
75- defaultRuntime . log ( JSON . stringify ( result , null , 2 ) ) ;
75+ defaultRuntime . writeJson ( result ) ;
7676 return ;
7777 }
78- defaultRuntime . log ( JSON . stringify ( result . cookies ?? [ ] , null , 2 ) ) ;
78+ defaultRuntime . writeJson ( result . cookies ?? [ ] ) ;
7979 } catch ( err ) {
8080 defaultRuntime . error ( danger ( String ( err ) ) ) ;
8181 defaultRuntime . exit ( 1 ) ;
@@ -165,10 +165,10 @@ export function registerBrowserCookiesAndStorageCommands(
165165 { timeoutMs : 20000 } ,
166166 ) ;
167167 if ( parent ?. json ) {
168- defaultRuntime . log ( JSON . stringify ( result , null , 2 ) ) ;
168+ defaultRuntime . writeJson ( result ) ;
169169 return ;
170170 }
171- defaultRuntime . log ( JSON . stringify ( result . values ?? { } , null , 2 ) ) ;
171+ defaultRuntime . writeJson ( result . values ?? { } ) ;
172172 } catch ( err ) {
173173 defaultRuntime . error ( danger ( String ( err ) ) ) ;
174174 defaultRuntime . exit ( 1 ) ;
0 commit comments