Skip to content

Can't view/debug script when using NavigateToString #1007

Open
@frostius

Description

@frostius

I am unable to view or debug the webview script when the script is set via NavigateToString

debug

To reproduce:

  • Start with the win32 WebView2GettingStarted solution
  • Instead of Navigate('bing.com') use NavigateToString() and load some HTML with javascript
    webviewWindow->NavigateToString(LR"(
      <html><head>
      <script>
        window.addEventListener('DOMContentLoaded', ()=>{
          document.body.querySelector('div').textContent = 'Goodbye'; 
        };
      </script>
      </head>
      <body>
      <div>Hello</div>
      <div>World</div>
      </body>
    </html>)");
    
  • Run the app and open the developer
  • There is no script available on the Sources tab

Versions

Visual Studio: 16.8.6
MSVC v142
WebView2 1.0.705.50 via nuget
Win32
Win10 18363

AB#31911694

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestfeature requesttrackedWe are tracking this work internally.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions