Open Bug 1514178 Opened 5 years ago Updated 1 year ago

If a page is slowing down the browser, some/most content loads are blocked until user action

Categories

(Firefox :: New Tab Page, defect, P3)

defect

Tracking

()

Tracking Status
firefox-esr60 --- wontfix
firefox64 --- wontfix
firefox65 --- wontfix
firefox66 --- wontfix
firefox67 --- wontfix
firefox68 --- wontfix

People

(Reporter: obotisan, Unassigned)

Details

(Keywords: regression)

Attachments

(1 file)

[Affected versions]:
- Firefox 64
- Firefox 65.0b4
- Nightly 66.0a1

[Affected platforms]:
- macOS 10.13
- Ubuntu 18.04 x64
- Windows 10 x64


[Steps to reproduce]:
1. In the URL bar, navigate to
       data:text/html,<script>while(true);</script>
2. Wait until the notification "A web page is slowing down..." is displayed.
3. Open at least three tabs.
 
[Expected result]:
- A New Window is opened and loaded.
- The notification "A web page is slowing down..." is displayed.

[Actual result]:
- A New Window is opened, but it doesn't load (the Activity Stream page is not loading).
- The notification "A web page is slowing down..." is not displayed.

[Regression range]:
- Last good revision: aff336ac161daa3ea350e59a288963edbd58ed39 (2017-07-17)
- First bad revision: dece50457378ac4934afe9fb3c2a8054e8894588 (2017-07-18)
- Pushlog:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=aff336ac161daa3ea350e59a288963edbd58ed39&tochange=dece50457378ac4934afe9fb3c2a8054e8894588

[Additional Notes]:
- Please look at the attached gif. 
- Sometimes the New Tab is loaded, but if you open another two tabs, the second one doesn't load. 
- I am not sure if I chose the Component correctly, feel free to change it.
Keywords: regression
OS: Unspecified → All
Hardware: Unspecified → All
Component: Notifications and Alerts → New Tab Page
Product: Toolkit → Firefox
Summary: If a page is slowing down the browser it affects other new tabs → If a page is slowing down the browser, the new tab page content doesn't show
Component: New Tab Page → Activity Streams: Newtab
Assignee: nobody → dmose
(In reply to Oana Botisan from comment #0)
> [Steps to reproduce]:
> 1. In the URL bar, navigate to
>        data:text/html,<script>while(true);</script>
>
> [...]
>
> [Actual result]:
> - A New Window is opened, but it doesn't load (the Activity Stream page is
> not loading).
> - The notification "A web page is slowing down..." is not displayed.

If I wait a second or two, the "A web page is slowing down..." appears on all of the tabs, even it wasn't initially there on some of the subsequently opened ones.
 
> [Regression range]:
> - Last good revision: aff336ac161daa3ea350e59a288963edbd58ed39 (2017-07-17)
> - First bad revision: dece50457378ac4934afe9fb3c2a8054e8894588 (2017-07-18)
> - Pushlog:
> https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=aff336ac161daa3ea350e59a288963edbd58ed39&tochange=dece50457378ac4934afe9fb3c2a8054e8894588

This is the merge when activity-stream was turned on by default in mozilla-central.  So something did change about the nature of the home page content then, but, then, AS is a significantly more featureful thing than before, so it may just be that it's executing (more?) JS in content.

> [Additional Notes]:
> - Please look at the attached gif. 
> - Sometimes the New Tab is loaded, but if you open another two tabs, the
> second one doesn't load. 

The reason for this is because, given a short amount of idle time, a new tab is preloaded behind the scenes, so it dodges the bullet.  After that, if you immediately open another new tab, it won't have had time to preload something, so things are stuck.

Interestingly, if one sets the newtab preference to load a blank page, then enters the above data: URL, opens a new tab, and tries to load almost any kind of page (eg about:preferences, cnn.com, etc), those pages won't load either, until one of the "Stop It" button on the info bar is pressed.

So my guess is that there's nothing Activity-Stream specific here, but, rather, that most browser loads become dysfunctional if runaway JavaScript completely eats the CPU and the user doesn't press the stop button.  Ideally, this wouldn't happen for in-browser UI, just individual web-pages.  Whether that's actually practical fix (and whether Fission will mitigate it), I don't know.
I'm putting this in Core:Performance, as I'm guessing that's where stuff like the infobar and it's implementation are handled.
Assignee: dmose → nobody
Component: Activity Streams: Newtab → Performance
Product: Firefox → Core
Summary: If a page is slowing down the browser, the new tab page content doesn't show → If a page is slowing down the browser, some/most content loads are blocked until user action

Thoughts on this Mike?

Flags: needinfo?(mconley)

Since bug 1317921, data URIs (and blob URIs) have been special-cased so that they:

  1. Transition a tab to, and load within a standard content process if the tab was originally non-remote
  2. Keep the tab in its current content process - privileged, file:// or otherwise.

So, in the attached GIF, the user presumably opened a second tab, which loaded about:newtab. Then the user asked it to load the data URI. Since about:newtab was already in a content process (specifically, the sole privileged content process), the code that does content process selection enforced (2), and ran the infinite loop in the privileged content process.

And since subsequent about:newtab's also load in the same content privileged content process, they're all hung waiting for the loop to exit (or for the user to break the loop).

This also affected us before the privileged content process, though I suspect the behaviour may have been less consistent - not only because of the preloaded background tab, but also because about:newtab's used to select a pre-existing content process instead of opening a new one, so depending on how many content processes were already running, there'd be a larger pool to select from to ultimately lock up.

The good news is that we have quite a bit of power here - we can detect when a content process is hung like this, and can cause its JS to terminate. We do that with the notification bar right now.

So, if a user loading evil JS like this in the newtab is something we're interested in fixing, I'm inclined to think of this as a bit of a UX challenge - how should we behave, ideally?

Flags: needinfo?(mconley)

My understanding is we're not going to have another 64 dot release given the impending 65 release.

Has Regression Range: --- → yes

vicky, could we get a priority on this one? do you think this needs a fix for 66?

Flags: needinfo?(vchin)

I'm thinking P3?

Component: Performance → Activity Streams: Newtab
Flags: needinfo?(vchin)
Product: Core → Firefox
Priority: -- → P3

Vicky, are you the right person to answer Mike’s question about our ideal behaviour in comment 4?

Flags: needinfo?(vchin)

My thoughts are having a notification bar that either allows the user to stop it or notifies them that we've stopped the script. Would like UX input though. Michael, are you the right person to NI?

Flags: needinfo?(vchin) → needinfo?(mverdi)

Marking as wontfix for 67 as this is a P3 with no assignee and we shipped 3 major releases with the regression. At this point in the cycle, it doesn't look like something we would want to uplift late in late betas.

Bulk change to wontfix for 68 (P3+ carryover with needinfo).

Component: Activity Streams: Newtab → New Tab Page
Severity: normal → S3
Flags: needinfo?(mverdi)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: