[Webkit-unassigned] [Bug 184514] New: Cannot set window.location immediately after window.open('')

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Apr 11 12:52:28 PDT 2018


https://bugs.webkit.org/show_bug.cgi?id=184514

            Bug ID: 184514
           Summary: Cannot set window.location immediately after
                    window.open('')
           Product: WebKit
           Version: Safari 11
          Hardware: iPhone / iPad
                OS: iOS 11
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebCore JavaScript
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: jdarcangelo at mozilla.com

In a WKWebView, web content cannot set `window.location` or `window.opener` on a `Window` returned immediately after calling `window.open('')` or `window.open('about:blank')`. For example, clicking the link in the following HTML/JS snippet will result in a BLANK `WKWebView` being opened via `webView(_:createWebViewWith:for:windowFeatures:)` and the location is never set:

```
<a href="https://webkit.org/" id="brokenlink">Click Me</a>

<script>
  var brokenlink = document.getElementById('brokenlink');
  brokenlink.addEventListener(function(evt) {
    evt.preventDefault();

    var openedWin = window.open('about:blank');
    openedWin.location = this.href;
  });
</script>
```

A more in-depth version of the above example can be found at: http://output.jsbin.com/tegacej

Also, a minimal proof-of-concept iOS app to reproduce this issue can be found at: https://github.com/justindarc/WebViewOpenTester

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180411/9e3a506d/attachment-0002.html>


More information about the webkit-unassigned mailing list