chrome的断点调试在什么情况下会进入 debugger:///VM模式

debugger:///VM 里的js从哪来的

阅读 7.7k
1 个回答

这个一般是由原生程序注入webview的,大部分webview对象都有一个类似executeJavaScript的方法,例如Android、iOS、Eelctron。

参考一下Electron的webContents

contents.executeJavaScript('fetch("https://jsonplaceholder.typicode.com/users/1").then(resp => resp.json())', true)
  .then((result) => {
    console.log(result) // Will be the JSON object from the fetch call
  })
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题