Closed Bug 1809094 Opened 1 year ago Closed 11 months ago

Implement tab.autoDiscardable property

Categories

(WebExtensions :: General, enhancement, P5)

enhancement

Tracking

(firefox116 fixed)

RESOLVED FIXED
116 Branch
Tracking Status
firefox116 --- fixed

People

(Reporter: gregp, Assigned: gregp)

References

Details

(4 keywords)

Attachments

(1 file)

Automatic tab unloading was re-enabled in Firefox 93 (bug 1587762). A tab's autodiscardability status should be available to extensions for reading and modification.
https://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/API/tabs/Tab#autodiscardable

Severity: -- → N/A
Depends on: 1587762
Priority: -- → P5
Assignee: nobody → gp3033
Status: NEW → ASSIGNED

I looked up the background of the changes in Chrome, and it appears to have been introduced in https://bugs.chromium.org/p/chromium/issues/detail?id=621070 as a part of an internship project, whose API design posted at https://docs.google.com/document/d/1iv--e69yNUeHJmnXtQMfJbwJfO6GTpE3ujq_CArTFMI/edit

While the name tab.autoDiscardable property could be interpreted as a reflection of whether a tab could be discarded, it is not. It signals the extension's intent to suppress the browser's auto-discarding behavior, in order to allow the extension to do that using tabs.discard (which we implemented in bug 1322485).

Let's make sure that this aspect is well-documented, as Chrome's documentation can be misinterpreted, as you did in D166440#5477564.

Pushed by gp3033@protonmail.com:
https://hg.mozilla.org/integration/autoland/rev/0ee2d1b2ec37
Implement tab.autoDiscardable property r=robwu,geckoview-reviewers,extension-reviewers,Gijs,owlish,tabbrowser-reviewers,dao

Latest land also caused these failures: https://treeherder.mozilla.org/logviewer?job_id=420070283&repo=autoland

[task 2023-06-20T23:43:33.378Z] 23:43:33     INFO - TEST-PASS | browser/components/extensions/test/browser/browser_ext_tabs_autoDiscardable.js | autoDiscardable should be false after setting it as such - 
[task 2023-06-20T23:43:33.379Z] 23:43:33     INFO - Console message: [JavaScript Error: "Error: Internal error: Expected a callback parameter with name callback" {file: "resource://gre/modules/Schemas.sys.mjs" line: 2484}]
[task 2023-06-20T23:43:33.379Z] 23:43:33     INFO - parseSchema@resource://gre/modules/Schemas.sys.mjs:2484:15
[task 2023-06-20T23:43:33.380Z] 23:43:33     INFO - parseSchema@resource://gre/modules/Schemas.sys.mjs:3552:17
[task 2023-06-20T23:43:33.380Z] 23:43:33     INFO - parseSchema@resource://gre/modules/Schemas.sys.mjs:2801:12
[task 2023-06-20T23:43:33.380Z] 23:43:33     INFO - loadFunction@resource://gre/modules/Schemas.sys.mjs:3265:26
[task 2023-06-20T23:43:33.380Z] 23:43:33     INFO - initKey@resource://gre/modules/Schemas.sys.mjs:3188:33
[task 2023-06-20T23:43:33.380Z] 23:43:33     INFO - get@resource://gre/modules/Schemas.sys.mjs:3332:20
[task 2023-06-20T23:43:33.380Z] 23:43:33     INFO - init@resource://gre/modules/Schemas.sys.mjs:3165:14
[task 2023-06-20T23:43:33.381Z] 23:43:33     INFO - keys@resource://gre/modules/Schemas.sys.mjs:3314:10
[task 2023-06-20T23:43:33.381Z] 23:43:33     INFO - injectInto@resource://gre/modules/Schemas.sys.mjs:3281:27
[task 2023-06-20T23:43:33.381Z] 23:43:33     INFO - getDescriptor@resource://gre/modules/Schemas.sys.mjs:3303:8
[task 2023-06-20T23:43:33.381Z] 23:43:33     INFO - getDescriptor@resource://gre/modules/Schemas.sys.mjs:816:32
[task 2023-06-20T23:43:33.381Z] 23:43:33     INFO - getDescriptor@resource://gre/modules/Schemas.sys.mjs:1009:22
[task 2023-06-20T23:43:33.381Z] 23:43:33     INFO - injectInto/<@resource://gre/modules/Schemas.sys.mjs:3294:24
[task 2023-06-20T23:43:33.381Z] 23:43:33     INFO - redefine@resource://gre/modules/Schemas.sys.mjs:210:23
[task 2023-06-20T23:43:33.381Z] 23:43:33     INFO - exportLazyProperty/<.get<@resource://gre/modules/Schemas.sys.mjs:233:15
[task 2023-06-20T23:43:33.382Z] 23:43:33     INFO - background@moz-extension://d98e192b-8960-4b36-80a0-33167402e634/%7B715e446c-a8d1-4d07-bd93-54cdf4d6d705%7D.js:35:5
[task 2023-06-20T23:43:33.382Z] 23:43:33     INFO - async*@moz-extension://d98e192b-8960-4b36-80a0-33167402e634/%7B715e446c-a8d1-4d07-bd93-54cdf4d6d705%7D.js:112:5
[task 2023-06-20T23:43:33.382Z] 23:43:33     INFO - 
[task 2023-06-20T23:43:33.382Z] 23:43:33     INFO - Console message: [JavaScript Error: "InvalidStateError: An exception was thrown" {file: "moz-extension://d98e192b-8960-4b36-80a0-33167402e634/%7B715e446c-a8d1-4d07-bd93-54cdf4d6d705%7D.js" line: 35}]
[task 2023-06-20T23:43:33.382Z] 23:43:33     INFO - background@moz-extension://d98e192b-8960-4b36-80a0-33167402e634/%7B715e446c-a8d1-4d07-bd93-54cdf4d6d705%7D.js:112:3
[task 2023-06-20T23:43:33.382Z] 23:43:33     INFO - async*@moz-extension://d98e192b-8960-4b36-80a0-33167402e634/%7B715e446c-a8d1-4d07-bd93-54cdf4d6d705%7D.js:112:5
[task 2023-06-20T23:43:33.382Z] 23:43:33     INFO - 
[task 2023-06-20T23:43:33.382Z] 23:43:33     INFO - Console message: [JavaScript Warning: "This page is in Quirks Mode. Page layout may be impacted. For Standards Mode use “<!DOCTYPE html>”." {file: "https://example.org/" line: 0}]
[task 2023-06-20T23:43:33.383Z] 23:43:33     INFO - Buffered messages finished
[task 2023-06-20T23:43:33.383Z] 23:43:33     INFO - TEST-UNEXPECTED-FAIL | browser/components/extensions/test/browser/browser_ext_tabs_autoDiscardable.js | Test timed out - 
[task 2023-06-20T23:43:33.383Z] 23:43:33     INFO - Not taking screenshot here: see the one that was previously logged
[task 2023-06-20T23:43:33.384Z] 23:43:33     INFO - TEST-UNEXPECTED-FAIL | browser/components/extensions/test/browser/browser_ext_tabs_autoDiscardable.js | Extension left running at test shutdown - 
[task 2023-06-20T23:43:33.384Z] 23:43:33     INFO - Stack trace:
[task 2023-06-20T23:43:33.384Z] 23:43:33     INFO - chrome://mochikit/content/browser-test.js:test_ok:1580
[task 2023-06-20T23:43:33.384Z] 23:43:33     INFO - chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js:ExtensionTestUtils.loadExtension/<:132
[task 2023-06-20T23:43:33.384Z] 23:43:33     INFO - chrome://mochikit/content/browser-test.js:nextTest:702
[task 2023-06-20T23:43:33.384Z] 23:43:33     INFO - chrome://mochikit/content/browser-test.js:timeoutFn:1437
[task 2023-06-20T23:43:33.384Z] 23:43:33     INFO - setTimeout handler*chrome://mochikit/content/browser-test.js:Tester_execTest:1379
[task 2023-06-20T23:43:33.385Z] 23:43:33     INFO - chrome://mochikit/content/browser-test.js:nextTest/<:1120
[task 2023-06-20T23:43:33.385Z] 23:43:33     INFO - chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/<:1056
[task 2023-06-20T23:43:33.385Z] 23:43:33     INFO - GECKO(1581) | [Child 1669, Main Thread] WARNING: JSWindowActorChild::SendRawMessage (Conduits, ConduitClosed) not sent: !CanSend() || !mManager || !mManager->CanSend(): file /builds/worker/checkouts/gecko/dom/ipc/jsactor/JSWindowActorChild.cpp:61
[task 2023-06-20T23:43:33.412Z] 23:43:33     INFO - GECKO(1581) | MEMORY STAT | vsize 4498MB | residentFast 1149MB | heapAllocated 786MB
[task 2023-06-20T23:43:33.414Z] 23:43:33     INFO - TEST-OK | browser/components/extensions/test/browser/browser_ext_tabs_autoDiscardable.js | took 94351ms
[task 2023-06-20T23:43:33.417Z] 23:43:33     INFO - Not taking screenshot here: see the one that was previously logged
[task 2023-06-20T23:43:33.418Z] 23:43:33     INFO - TEST-UNEXPECTED-FAIL | browser/components/extensions/test/browser/browser_ext_tabs_autoDiscardable.js | Found a tab after previous test timed out: https://example.org/ - 
[task 2023-06-20T23:43:33.440Z] 23:43:33     INFO - GECKO(1581) | [Child 1696: Main Thread]: I/DocShellAndDOMWindowLeak ++DOCSHELL 7f8a1f879400 == 1 [pid = 1696] [id = 136]
[task 2023-06-20T23:43:33.442Z] 23:43:33     INFO - GECKO(1581) | [Child 1696: Main Thread]: I/DocShellAndDOMWindowLeak ++DOMWINDOW == 1 (7f8a25584090) [pid = 1696] [serial = 295] [outer = 0]
[task 2023-06-20T23:43:33.443Z] 23:43:33     INFO - GECKO(1581) | [Child 1696: Main Thread]: I/DocShellAndDOMWindowLeak ++DOMWINDOW == 2 (7f8a1f879800) [pid = 1696] [serial = 296] [outer = 7f8a25584090]
[task 2023-06-20T23:43:33.503Z] 23:43:33     INFO - checking window state
[task 2023-06-20T23:43:33.509Z] 23:43:33     INFO - GECKO(1581) | [Child 1669: Main Thread]: I/DocShellAndDOMWindowLeak --DOCSHELL 7fcbfbcfb400 == 5 [pid = 1669] [id = 792] [url = moz-extension://d98e192b-8960-4b36-80a0-33167402e634/_generated_background_page.html]
[task 2023-06-20T23:43:33.607Z] 23:43:33     INFO - TEST-START | browser/components/extensions/test/browser/browser_ext_tabs_containerIsolation.js
Pushed by gp3033@protonmail.com:
https://hg.mozilla.org/integration/autoland/rev/f3fe6cc42791
Implement tab.autoDiscardable property r=robwu,geckoview-reviewers,extension-reviewers,Gijs,owlish,tabbrowser-reviewers,dao
Flags: needinfo?(gp3033)
Flags: needinfo?(gp3033)
Pushed by gp3033@protonmail.com:
https://hg.mozilla.org/integration/autoland/rev/877c5e736359
Implement tab.autoDiscardable property r=robwu,geckoview-reviewers,extension-reviewers,Gijs,owlish,tabbrowser-reviewers,dao
Status: ASSIGNED → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → 116 Branch

Content updates provided in:

  • BCD: tabs.Tab.autoDiscardable support in Firefox 116 #20211
  • Content: tabs.Tab.autoDiscardable in 116 #27494
See Also: → 1839754
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: