From 7f1ad9818a750d42f774579a67584be302c58272 Mon Sep 17 00:00:00 2001 From: Image Date: Wed, 26 Feb 2020 18:32:11 +0800 Subject: [PATCH] adjusted frontend --- src/main/actions.ts | 18 ++++-- src/renderer/app.css | 4 ++ src/renderer/app.tsx | 135 +++++++++++++++++++++++++++++++++++-------- 3 files changed, 128 insertions(+), 29 deletions(-) diff --git a/src/main/actions.ts b/src/main/actions.ts index 5abbaa7..a1f82d1 100644 --- a/src/main/actions.ts +++ b/src/main/actions.ts @@ -61,13 +61,14 @@ export const startDebugging = ( setTimeout(function(){ CDP({port:nodePort},async client => { let count=0; + let renew=false; let interval=setInterval(async function() { try{ let length=await client.Runtime.evaluate({ expression: `process.mainModule.require('electron').webContents.getAllWebContents().length` }) - - if(length.result.value!=count){ + + if(renew || length.result.value!=count){ count=length.result.value; let webcontents=await client.Runtime.evaluate({ expression: ` @@ -75,13 +76,20 @@ export const startDebugging = ( contents=process.mainModule.require('electron').webContents.getAllWebContents(); for(let i=0;i { -
-                      {session.log}
-                    
-
-                      webContents count:{session.webcontents==undefined?0:session.webcontents.length};{"\n"}
-                      {JSON.stringify(session.webcontents,null,2)}
-                    
+ + + + + URL + nodeIntegration + contextIsolation + sandbox + nativeWindowOpen + webPreferences + + + + {session.webcontents == undefined ? : session.webcontents.map((webcontent) => ( + + + {webcontent.url} + + + {webcontent.webPreferences.nodeIntegration ? "true" : "false"} + + + {webcontent.webPreferences.contextIsolation ? "true" : "false"} + + + {webcontent.webPreferences.sandbox ? "true" : "false"} + + + {webcontent.webPreferences.nativeWindowOpen ? "true" : "false"} + + + {JSON.stringify(webcontent.webPreferences, null, 2)} + + + ))} + + + }> + + + {session.log} + + }> + + } />