Closed Bug 1632441 Opened 5 years ago Closed 5 years ago

Script-closable window with http:// URL opened from a file:// window does not close after calling window.close()

Categories

(Core :: DOM: Core & HTML, defect, P1)

75 Branch
Desktop
All
defect

Tracking

()

RESOLVED FIXED
mozilla79
Tracking Status
firefox-esr68 --- unaffected
firefox75 - wontfix
firefox76 + wontfix
firefox77 + verified
firefox78 + fixed
firefox79 --- fixed

People

(Reporter: adrigarry, Assigned: pbone)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0

Steps to reproduce:

Page A open a new page B, then after some user actions on page B, this page should be closed by window.close().

Actual results:

Since 75 release, the page B is not closed anymore.

I can't find any relative information on 75 version's release note. Is that a know issue ? Or this is a new behavior relating to https://www.w3.org/TR/html52/browsers.html#dom-window-close specifications ?

Expected results:

Before 75 release of Firefox, the page B was closed.

OS: Unspecified → Windows 10
Hardware: Unspecified → Desktop
Summary: Script-closable window does not close anymore from 75 release → Script-closable window (with not same-origin policy) does not close anymore from 75 release

Hi adrigarry,

Thanks for your report.

Would you happen to have any test page as example so we can investigate this issue?

Please also confirm if you are able to reproduce this issue in the latest Firefox Nightly version, you can download it here: https://nightly.mozilla.org/

In the meantime, I'll assign this ticket to the Core DOM: Core & HTML component.

Thanks,
Virginia

Component: Untriaged → DOM: Core & HTML
Flags: needinfo?(adrigarry)
Product: Firefox → Core

Hi,

In the zip archive, you can find a nodejs simple server. To reproduce, launch server ('node server.js'), and open in firefox the test.html page. This page will open another page that should automatically close few seconds after.

I have reproduce this issue with the latest firefox Nightly version.

Thanks,
Adri

Flags: needinfo?(adrigarry)

Edgar, could this be related to the new user activation model? Page B uses setTimeout.

Dear reporter, could you please help try to get the regression window with the tool https://mozilla.github.io/mozregression/ ? thanks!

Flags: needinfo?(echen)

(In reply to Hsin-Yi Tsai [:hsinyi] from comment #3)

Edgar, could this be related to the new user activation model? Page B uses setTimeout.

It doesn't look like something related to the new user activation model. window.close() doesn't check user action. but I will take a look at anyway.

I could reproduce this on latest Nightly with the steps in comment #2, I saw following warning message on console,

Scripts may not close windows that were not opened by script.

91:17.41 INFO: Last good revision: b0e84820d231a3b5a47f2ea72c384828d91f4c49
91:17.41 INFO: First bad revision: b158903288bb2968dff9e587a3a8ca67f7435e37
91:17.41 INFO: Pushlog:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=b0e84820d231a3b5a47f2ea72c384828d91f4c49&tochange=b158903288bb2968dff9e587a3a8ca67f7435e37

It is caused by bug 1603006, Paul, could you take a look? Thanks.

Flags: needinfo?(echen) → needinfo?(pbone)
Regressed by: 1603006
Has Regression Range: --- → yes

[Tracking Requested - why for this release]:
This is rather core web functionality being broken.

I don't know the cause, investigating now. Thanks.

Assignee: nobody → pbone
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Flags: needinfo?(pbone)
Priority: -- → P1

I can't reproduce this, I've tried: Nightly and Release on Windows 10, and Nightly on Linux.

  • I use the webserver enclosed (as described in comment 2)
  • Open a new tab and put localhost:3000/test.html in the address bar (or `hostname:3000/test.html' when I was using windows because node was running on linux).
  • The next tab opens, it has the message that it will close, and then it closes.

As I understand it from comment 0, if the tab closes firefox works correctly, if the tab stays open then it's broken.

The test included opens the tabs from the same origin, but the bug title says "not same origin" Is this test incomplete?

Flags: needinfo?(adrigarry)

Edgar, how did you reproduce it? Is there something I'm missing? Thanks.

Flags: needinfo?(echen)

I could reproduce it with loading test.html from file.

Flags: needinfo?(echen)

Nope, still doesn't reproduce on Nighly, Realease, Linux or Windows.

I'm accepting a pop-up warning as it begins, should I not be doing that? I'm also editing the path in the4 test so it works at all with file:// OH! I think I see, it's the problem going from file:// to http://

Flags: needinfo?(echen)

Okay, it reproduces in nightly on Linux when going from file:// to http:// and fission is disabled or it's in a non-fission window.

Flags: needinfo?(echen)
Flags: needinfo?(adrigarry)
Summary: Script-closable window (with not same-origin policy) does not close anymore from 75 release → Script-closable window with http:// URL opened from a file:// window does not close after calling window.close()
OS: Windows 10 → All
Depends on: 1634779
Depends on: 1550571

The workaround Bug 1634779 may be uplifted. I want to keep this as 'affected' for 77.

Bug 1634779 has added a fix for this bug. This patch adds a test to ensure
we don't regress this behaviour again.

Marking as fixed in beta since Bug 1634779 has now been uplifted.

Reproduced the issue on Firefox 77.0a1 (20200419091145) on Windows 10 and Ubuntu 18.04.4.
Verified fixed on Firefox 77.0b9 (20200521224544). This is also Verified fixed on Firefox 78.0a1 (20200521093657) .

Thanks. it looks like there's a race on some builds.

Flags: needinfo?(pbone)
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79

The patch landed in nightly and beta is affected.
:pbone, is this bug important enough to require an uplift?
If not please set status_beta to wontfix.

For more information, please visit auto_nag documentation.

Flags: needinfo?(pbone)

The bug is already fixed in 78 by Bug 1634779, this patch only adds a regression test and doesn't need to be uplifted.

Thanks.

Flags: needinfo?(pbone)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: