about:networking isn't auto refreshed after restoring session

RESOLVED FIXED in Firefox 56

Status

()

RESOLVED FIXED
2 years ago
a year ago

People

(Reporter: michal.novotny, Assigned: valentin)

Tracking

Trunk
mozilla56
Points:
---

Firefox Tracking Flags

(firefox56 fixed)

Details

(Whiteboard: [necko-active])

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

2 years ago
After restoring session, the page about:networking#rcwn doesn't auto refresh when autorefresh is checked. The "refresh" button is enabled. Auto-refreshing starts working after re-enabling it or after switching to another tab in about:networking. In the latter case the "refresh" button is still enabled.
Created attachment 8885288 [details] [diff] [review]
Make sure init gets called when about:networking is loaded from the bfcache

MozReview-Commit-ID: 8DdhaEm88Nb
Attachment #8885288 - Flags: review?(jaws)
Assignee: nobody → valentin.gosu
Whiteboard: [necko-active]
Comment on attachment 8885288 [details] [diff] [review]
Make sure init gets called when about:networking is loaded from the bfcache

Review of attachment 8885288 [details] [diff] [review]:
-----------------------------------------------------------------

::: toolkit/content/aboutNetworking.js
@@ +437,5 @@
>  }, {once: true});
>  
> +window.onunload = function() {
> +  // We need this to ensure that init is called when the page is loaded
> +  // from the bfcache.

Can you use "pageshow" and "pagehide" instead? Using "onunload" disables the bfcache making it slower to go back and forward etc.
Attachment #8885288 - Flags: review?(jaws) → review-
Created attachment 8885531 [details] [diff] [review]
Make sure init gets called when about:networking is loaded from the bfcache

Thanks for the suggestion.
Attachment #8885531 - Flags: review?(jaws)
Attachment #8885288 - Attachment is obsolete: true
Comment on attachment 8885531 [details] [diff] [review]
Make sure init gets called when about:networking is loaded from the bfcache

Review of attachment 8885531 [details] [diff] [review]:
-----------------------------------------------------------------

::: toolkit/content/aboutNetworking.js
@@ +435,5 @@
> +// We use the pageshow event instead of onload. This is needed because sometimes
> +// the page is loaded via session-restore/bfcache. In such cases we need to call
> +// init() to keep the page behaviour consistent with the ticked checkboxes.
> +// Mostly the issue is with the autorefresh checkbox.
> +window.addEventListener("pageshow", function() {

pageshow can be called multiple times, for example switching away and back to this tab. Can you add an early return to init() in the case that init() was already called?
Attachment #8885531 - Flags: review?(jaws) → review+

Comment 5

2 years ago
Pushed by valentin.gosu@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/50bb4bb1902f
Make sure init gets called when about:networking is loaded from the bfcache r=jaws
https://hg.mozilla.org/integration/mozilla-inbound/rev/50bb4bb1902f84a7335754f62e7a124ca9b5c732
Bug 1379927 - Make sure init gets called when about:networking is loaded from the bfcache r=jaws

Comment 7

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/50bb4bb1902f
Status: NEW → RESOLVED
Last Resolved: a year ago
status-firefox56: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.