Closed Bug 1402256 Opened 7 years ago Closed 4 years ago

WebExtension API to 'warm up' a tab

Categories

(WebExtensions :: Frontend, enhancement, P5)

enhancement

Tracking

(firefox57 wontfix, firefox79 fixed)

RESOLVED FIXED
mozilla79
Tracking Status
firefox57 --- wontfix
firefox79 --- fixed

People

(Reporter: bugzilla, Assigned: aria)

Details

(Keywords: dev-doc-complete, Whiteboard: [design-decision-approved])

Attachments

(1 file)

Bug 1385453 allows 'warming up' the tabs that are hovered, giving a perceived performance improvement when the user clicks a tab. It would be nice for WebExtensions that implement alternative tab switchers (e.g. Tree Style Tabs) to be able to benefit from this improvement. This could be done by adding an extra property to updateProperties of browser.tabs.update, e.g. 'hovered', 'warmed', or 'about-to-be-active' that would trigger the same behaviour as hovering a built-in tab.
Severity: normal → enhancement
Priority: -- → P5
Whiteboard: [design-decision-needed]
tabbrowser.xml also calls SessionStore.speculativeConnectOnTabHover when a tab is hovered (for restored tabs). So the API call should probably call that as well as warmupTab and any other non-UI stuff that happens when a tab is hovered.
Hi Paul, this has been added to the agenda for the February 27 WebExtensions APIs triage. Would you be able to join us? Here’s a quick overview of what to expect at the triage: * We normally spend 5 minutes per bug * The more information in the bug, the better * The goal of the triage is to give a general thumbs up or thumbs down on a proposal; we won't be going deep into implementation details Relevant Links: * Wiki for the meeting: https://wiki.mozilla.org/WebExtensions/Triage#Next_Meeting * Meeting agenda: https://docs.google.com/document/d/1Jd50z5FMuS6tA6BMiCkpemAMeE5CtR_NboA-EdYI7jE/edit# * Vision doc for WebExtensions: https://wiki.mozilla.org/WebExtensions/Vision
We're approving tab 'warm ups,' and Kris will comment with some implementation suggestions.
Flags: needinfo?(kmaglione+bmo)
Whiteboard: [design-decision-needed] → [design-decision-approved]
We approved this, but with the caveat that there should be a warmup function rather than a flag.
Flags: needinfo?(kmaglione+bmo)
Product: Toolkit → WebExtensions

Hi, any news on this?

Hi, I wrote a patch but I’d like guidance on what type of test I can write and how to check that the tab has been effectively warmed up, since we can’t know that with the WebExtensions API.

Assignee: nobody → perso

I'm a touch tight on time this week, lets see if someone familiar with tab warmup has a quick answer on how to test for it.

Flags: needinfo?(dothayer)

I can't really comment on where the test should live and whatnot - I'm not familiar with general policies on web extension API testing. But you can tell if a tab is warm or being warmed or not by checking the renderLayers property on the browser object. For example, in the browser toolbox: gBrowser.tabs[0].linkedBrowser.renderLayers will tell you if your first tab is warming up / warmed up / displayed.

However, looking at your patch, I don't think that should work...? It should be gBrowser.warmupTab, not gBrowser.warmUp.

Flags: needinfo?(dothayer)
Pushed by rmaries@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9b32011328f0 Add WebExtensions API to “warm up” a tab r=mixedpuppy
Pushed by ncsoregi@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9855eb03a9f1 Add WebExtensions API to “warm up” a tab r=mixedpuppy

Backed out for failures on test_ext_all_apis.html

backout: https://hg.mozilla.org/integration/autoland/rev/98fd4fe746ea5f38a26de5bc5b15cd467b6e883f

push: https://treeherder.mozilla.org/#/jobs?repo=autoland&selectedTaskRun=S3eWLtQpTlGMurMDVlhcQA-0&revision=9855eb03a9f17c6fd915a4e72efa9e26552b589a&group_state=expanded

failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=303720052&repo=autoland&lineNumber=1604

[task 2020-05-26T03:18:37.235Z] 03:18:37 INFO - TEST-PASS | browser/components/extensions/test/mochitest/test_ext_all_apis.html | content script APIs
[task 2020-05-26T03:18:37.235Z] 03:18:37 INFO - Buffered messages logged at 03:18:36
[task 2020-05-26T03:18:37.235Z] 03:18:37 INFO - add_task | Leaving test test_enumerate_content_script_apis
[task 2020-05-26T03:18:37.235Z] 03:18:37 INFO - add_task | Entering test test_enumerate_background_script_apis
[task 2020-05-26T03:18:37.235Z] 03:18:37 INFO - Extension loaded
[task 2020-05-26T03:18:37.235Z] 03:18:37 INFO - Buffered messages finished
[task 2020-05-26T03:18:37.235Z] 03:18:37 INFO - TEST-UNEXPECTED-FAIL | browser/components/extensions/test/mochitest/test_ext_all_apis.html | background script APIs - Structures begin differing at:
[task 2020-05-26T03:18:37.235Z] 03:18:37 INFO - got[99] = "browser.tabs.warmup"
[task 2020-05-26T03:18:37.235Z] 03:18:37 INFO - expected[99] = "browser.test.assertEq"
[task 2020-05-26T03:18:37.235Z] 03:18:37 INFO -
[task 2020-05-26T03:18:37.235Z] 03:18:37 INFO - SimpleTest.isDeeply@SimpleTest/SimpleTest.js:1879:16
[task 2020-05-26T03:18:37.235Z] 03:18:37 INFO - test_enumerate_background_script_apis@browser/components/extensions/test/mochitest/test_ext_all_apis.js:178:11
[task 2020-05-26T03:18:37.235Z] 03:18:37 INFO - asyncnextTick/<@SimpleTest/SimpleTest.js:2080:34
[task 2020-05-26T03:18:37.235Z] 03:18:37 INFO - async
nextTick@SimpleTest/SimpleTest.js:2105:11
[task 2020-05-26T03:18:37.235Z] 03:18:37 INFO - setTimeout handler*SimpleTest_setTimeoutShim@SimpleTest/SimpleTest.js:788:41
[task 2020-05-26T03:18:37.235Z] 03:18:37 INFO - add_task@SimpleTest/SimpleTest.js:2035:17
[task 2020-05-26T03:18:37.235Z] 03:18:37 INFO - @browser/components/extensions/test/mochitest/test_ext_all_apis.js:143:9
[task 2020-05-26T03:18:37.236Z] 03:18:37 INFO - add_task | Leaving test test_enumerate_background_script_apis
[task 2020-05-26T03:18:37.236Z] 03:18:37 INFO - GECKO(1258) | MEMORY STAT vsizeMaxContiguous not supported in this build configuration.
[task 2020-05-26T03:18:37.236Z] 03:18:37 INFO - GECKO(1258) | MEMORY STAT heapAllocated not supported in this build configuration.
[task 2020-05-26T03:18:37.236Z] 03:18:37 INFO - GECKO(1258) | MEMORY STAT | vsize 130550484MB | residentFast 398MB

There are also other browser-chrome failures such as:

  • toolkit/components/extensions/test/browser/browser_ext_themes_dynamic_getCurrent.js | Test timed out -
  • browser/components/extensions/test/browser/browser_ext_tabs_cookieStoreId_private.js | Test timed out -
  • browser/extensions/report-site-issue/test/browser/browser_report_site_issue.js | Test timed out -

and many others.

Pushed by cbrindusan@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/18a94269c57c Add WebExtensions API to “warm up” a tab r=mixedpuppy
Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79
Flags: needinfo?(perso)

I've added a page for this API: https://wiki.developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/warmup .

Compat data is merged but not deployed until tomorrow.

Please let me know if this covers it.

Flags: needinfo?(mixedpuppy)

Thanks Will, I replaced the use of "discard" on that page, to avoid confusion with the unrelated tabs.discard method, and added a clarifying sentence about this not being required, just a performance optimization. Please check if my edit fits the article and MDN.

Flags: needinfo?(mixedpuppy) → needinfo?(wbamberg)

Yes, this looks great, thank you Tom!

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

Attachment

General

Creator:
Created:
Updated:
Size: