MicrosoftEdge / MicrosoftEdge/WebView2Feedback

window.open invoked with 4th parameter triggers type error

Open
#847 1 comment 1 reaction 1 assignee View on GitHub

@champnic is already working on this.

Since Jan 26, 2021.

bug priority-low tracked
Dominant language
PowerShell
Stars
526
Forks
67
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.