What is the difference between open() and window.open() in Firefox?

前端 未结 6 2064
抹茶落季
抹茶落季 2021-01-18 10:16

In answering my question Pumbaa80 found a difference between calling open() and window.open(), try the following examples in Firefox

6条回答
  •  北荒
    北荒 (楼主)
    2021-01-18 11:04

    One of your fiddles is calling window.open while the other is calling document.open, because the scope chain in inline attribute event handlers is weird. So you end up at http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#dom-document-open

    That said, since you pass 3 arguments, this should be invoking window.open. The difference in behavior seems to be a bug in Firefox. I filed https://bugzilla.mozilla.org/show_bug.cgi?id=741266 on that.

提交回复
热议问题