MicrosoftEdge / MicrosoftEdge/WebView2Feedback
window.open invoked with 4th parameter triggers type error
@champnic is already working on this.
Since Jan 26, 2021.
- 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 :)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.