MicrosoftEdge / WebView2Feedback

Feedback and discussions about Microsoft Edge WebView2
https://aka.ms/webview2
450 stars 54 forks source link

window.open invoked with 4th parameter triggers type error #847

Open frankdekker opened 3 years ago

frankdekker commented 3 years ago

Description Some (older) scripts invoke window.open with a 4th boolean parameter. For example CKEditor 4. In Chrome, Firefox and Microsoft Edge this works properly and the window opens. In WebView2 (Edge Canary), a js error triggers: Uncaught TypeError: Failed to execute 'open' on 'Window': cannot convert to dictionary

Version SDK: 1.0.721-prerelease Runtime: Version 89.0.774.0 (Official build) canary (64-bit) Framework: WPF OS: Win10

Repro Steps Create a simple html page with the content below, open this in WebView2, and click on the "open window"-link.

<!DOCTYPE html>
<html lang="en">
<body>
<script>
    function openWindow() {
        window.open(
            "",
            null,
            "location=no,menubar=no,toolbar=no,dependent=yes," +
            "minimizable=no,modal=yes,alwaysRaised=yes," +
            "resizable=yes,scrollbars=yes,width=2201,height=806,top=173,left=275",
            true  // < ------ 4th parameter
        );
    }
</script>
<a href="#" onclick="openWindow()">open window</a>
</body>
</html>

Temp solution A workaround would be to inject a window.open function that discards the 4th parameter, but ye, not quite elegant. Would be great to have this work normally :)

AB#31461676

champnic commented 3 years ago

I've added a bug to our backlog to track, but would recommend your suggested workaround in the meantime. Thanks for the report!