Skip to content

Instantly share code, notes, and snippets.

@scout119
Last active April 21, 2018 03:00
Show Gist options
  • Save scout119/0bd368659372036598b75c6a515a5192 to your computer and use it in GitHub Desktop.
Save scout119/0bd368659372036598b75c6a515a5192 to your computer and use it in GitHub Desktop.
Debugging HTML content provider in VSCode
// Instructions to open Chrome DevTools on the HTML preview window:
//
// 1. With the HTML preview window open, click Help->Toggle Developer Tools.
// Note that this DevTools is docked and is only for VSCode itself.
//
// 2. In the Console tab, paste this line:
// document.body.querySelector('webview').getWebContents().openDevTools();
//
// 3. You now have a second DevTools, the new one is un-docked. Close the
// old docked one.
//
// 4. In the top of the Console tab of the remaining un-docked DevTools,
// click the pull-down and change "top" to "_target (webview.html)".
// Now you can debug the HTML preview in the sandboxed iframe.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment