Closed Bug 1844044 Opened 1 year ago Closed 2 months ago

Prevent automatic suspension of event page for permissions.request (generally: APIs dependent on user feedback)

Categories

(WebExtensions :: General, defect, P2)

defect

Tracking

(firefox128 fixed)

RESOLVED FIXED
128 Branch
Tracking Status
firefox128 --- fixed

People

(Reporter: robwu, Assigned: zombie)

References

(Blocks 1 open bug)

Details

(Whiteboard: [addons-jira])

Attachments

(1 file)

Forked from https://bugzilla.mozilla.org/show_bug.cgi?id=1771203#c4

There are some extension APIs that involve user interaction and can theoretically run forever. These methods should prevent the event page/SW from suspending until they return. For details, see:

As of writing, the list of APIs in Firefox is:

  • identity.launchWebAuthFlow
  • permissions.request

Note that this is distinct from bug 1844041: While other bug is about resetting the idle timer upon method invocation, this bug is about stopping the timer from starting for the whole duration of the API calls.

Severity: -- → S3
Type: enhancement → defect
Priority: -- → P2
Whiteboard: [
Whiteboard: [ → [addons-jira]

Note: implementing this would be significantly easier if the timer-based implementation changed to refcounting, see bug 1874406.

Depends on: 1874406
Assignee: nobody → tomica
Attachment #9402665 - Attachment description: WIP: Bug 1844044 - Keep event page alive while waiting for permissions.request() → Bug 1844044 - Keep event page alive while waiting for permissions.request()
Status: NEW → ASSIGNED
Attachment #9402665 - Attachment description: Bug 1844044 - Keep event page alive while waiting for permissions.request() → WIP: Bug 1844044 - Keep event page alive while waiting for permissions.request()
Attachment #9402665 - Attachment description: WIP: Bug 1844044 - Keep event page alive while waiting for permissions.request() → Bug 1844044 - Keep event page alive while waiting for permissions.request() r?robwu
Pushed by tjovanovic@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/38526d136ef4
Keep event page alive while waiting for permissions.request() r=robwu
Flags: needinfo?(tomica)
Pushed by tjovanovic@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c2e2e4402035
Keep event page alive while waiting for permissions.request() r=robwu
Pushed by tjovanovic@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7ea2e3df7895
Keep event page alive while waiting for permissions.request() r=robwu
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 128 Branch
Flags: needinfo?(tomica)
Backout by tszentpeteri@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/26bce625289c
Backed out changeset 7ea2e3df7895 for causing mochitest failures on test_ext_tabs_permissions.html. CLOSED TREE.

Backed out for causing mochitest failures on test_ext_tabs_permissions.html.

[task 2024-05-21T11:42:13.699Z] 11:42:13     INFO - TEST-PASS | toolkit/components/extensions/test/mochitest/test_ext_contentscript_activeTab.html | test result correct 
[task 2024-05-21T11:42:13.699Z] 11:42:13     INFO - Buffered messages logged at 11:34:34
[task 2024-05-21T11:42:13.699Z] 11:42:13     INFO - add_task | Leaving test_navigate_by_src_tabs
[task 2024-05-21T11:42:13.699Z] 11:42:13     INFO - add_task | Entering test_navigate_by_src_scripting
[task 2024-05-21T11:42:13.699Z] 11:42:13     INFO - Extension loaded
[task 2024-05-21T11:42:13.699Z] 11:42:13     INFO - Buffered messages finished
[task 2024-05-21T11:42:13.699Z] 11:42:13     INFO - TEST-UNEXPECTED-TIMEOUT | toolkit/components/extensions/test/mochitest/test_ext_contentscript_activeTab.html | application timed out after 370 seconds with no output
[task 2024-05-21T11:42:13.699Z] 11:42:13     INFO - TEST-INFO took 540721ms
[task 2024-05-21T11:42:13.699Z] 11:42:13     INFO - Buffered messages finished
[task 2024-05-21T11:42:13.699Z] 11:42:13  WARNING - Force-terminating active process(es).
[task 2024-05-21T11:42:13.699Z] 11:42:13     INFO - Determining child pids from psutil...
[task 2024-05-21T11:42:13.748Z] 11:42:13     INFO - [2079, 2156, 2163, 2218, 3566, 3615, 3616, 3665, 3666, 3715, 3717, 3765, 3767]
[task 2024-05-21T11:42:14.807Z] 11:42:14     INFO - ==> process 2006 launched child process 2079
[task 2024-05-21T11:42:15.049Z] 11:42:15     INFO - ==> process 2006 launched child process 2107
[task 2024-05-21T11:42:15.049Z] 11:42:15     INFO - ==> process 2006 launched child process 2156
[task 2024-05-21T11:42:15.049Z] 11:42:15     INFO - ==> process 2006 launched child process 2163
[task 2024-05-21T11:42:15.049Z] 11:42:15     INFO - ==> process 2006 launched child process 2164
[task 2024-05-21T11:42:15.049Z] 11:42:15     INFO - ==> process 2006 launched child process 2184
[task 2024-05-21T11:42:15.049Z] 11:42:15     INFO - ==> process 2006 launched child process 2218
[task 2024-05-21T11:42:15.050Z] 11:42:15     INFO - ==> process 2006 launched child process 2264
[task 2024-05-21T11:42:15.050Z] 11:42:15     INFO - ==> process 2006 launched child process 2303
[task 2024-05-21T11:42:15.050Z] 11:42:15     INFO - ==> process 2006 launched child process 2339
[task 2024-05-21T11:42:15.050Z] 11:42:15     INFO - ==> process 2006 launched child process 2341
[task 2024-05-21T11:42:15.050Z] 11:42:15     INFO - ==> process 2006 launched child process 2398
<...>
[task 2024-05-21T11:42:15.064Z] 11:42:15     INFO - ==> process 2006 launched child process 3765
[task 2024-05-21T11:42:15.064Z] 11:42:15     INFO - ==> process 2006 launched child process 3767
[task 2024-05-21T11:42:15.065Z] 11:42:15     INFO - Found child pids: {3330, 3715, 3332, 3717, 2693, 2184, 2828, 2829, 2575, 2449, 2578, 3473, 3093, 3230, 3615, 3616, 2079, 3231, 2339, 2341, 2729, 2218, 2603, 2476, 2858, 2986, 3497, 3498, 3501, 2738, 3378, 3124, 3765, 3767, 2107, 2503, 3407, 3280, 3665, 3666, 3026, 3155, 2901, 2902, 3030, 2264, 2649, 2398, 2910, 3039, 3297, 2402, 3430, 2793, 2156, 3180, 3566, 3182, 3565, 2163, 2164, 2303}
[task 2024-05-21T11:42:15.164Z] 11:42:15     INFO - Failed to get child procs
[task 2024-05-21T11:42:15.164Z] 11:42:15     INFO - Killing process: 3330
[task 2024-05-21T11:42:15.412Z] 11:42:15     INFO - TEST-INFO | started process screentopng
[task 2024-05-21T11:42:29.074Z] 11:42:29     INFO - TEST-INFO | screentopng: exit 0
[task 2024-05-21T11:42:29.074Z] 11:42:29     INFO - Can't trigger Breakpad, just killing process
[task 2024-05-21T11:42:29.074Z] 11:42:29     INFO - Error: Failed to kill process 3330: process PID not found (pid=3330)
[task 2024-05-21T11:42:29.074Z] 11:42:29     INFO - Killing process: 3715
[task 2024-05-21T11:42:29.074Z] 11:42:29     INFO - Not taking screenshot here: see the one that was previously logged
[task 2024-05-21T11:42:29.074Z] 11:42:29     INFO - Can't trigger Breakpad, just killing process
<...>
[task 2024-05-21T11:44:00.803Z] 11:44:00     INFO - ==> process 2006 launched child process 3843
[task 2024-05-21T11:44:00.804Z] 11:44:00     INFO - ==> process 2006 launched child process 3845
[task 2024-05-21T11:44:00.804Z] 11:44:00     INFO - ==> process 2006 launched child process 3854
[task 2024-05-21T11:44:00.805Z] 11:44:00     INFO - zombiecheck | Checking for orphan process with PID: 3330
[task 2024-05-21T11:44:00.806Z] 11:44:00     INFO - zombiecheck | Checking for orphan process with PID: 3715
[task 2024-05-21T11:44:00.806Z] 11:44:00     INFO - zombiecheck | Checking for orphan process with PID: 3332
<...>
[task 2024-05-21T11:44:00.836Z] 11:44:00     INFO - runtests.py | Running with scheme: https
[task 2024-05-21T11:44:00.836Z] 11:44:00     INFO - runtests.py | Running with e10s: True
[task 2024-05-21T11:44:00.837Z] 11:44:00     INFO - runtests.py | Running with fission: True
[task 2024-05-21T11:44:00.837Z] 11:44:00     INFO - runtests.py | Running with cross-origin iframes: False
[task 2024-05-21T11:44:00.837Z] 11:44:00     INFO - runtests.py | Running with serviceworker_e10s: True
[task 2024-05-21T11:44:00.838Z] 11:44:00     INFO - runtests.py | Running with socketprocess_e10s: False
[task 2024-05-21T11:44:00.838Z] 11:44:00     INFO - runtests.py | Running tests: start.
[task 2024-05-21T11:44:00.838Z] 11:44:00     INFO - 
[task 2024-05-21T11:44:00.913Z] 11:44:00     INFO - Application command: /builds/worker/workspace/build/application/firefox/firefox -marionette -foreground -profile /tmp/tmps64m1t6q.mozrunner
[task 2024-05-21T11:44:00.923Z] 11:44:00     INFO - runtests.py | Application pid: 3951
[task 2024-05-21T11:44:00.923Z] 11:44:00     INFO - TEST-INFO | started process GECKO(3951)
[task 2024-05-21T11:44:04.445Z] 11:44:04     INFO - GECKO(3951) | ATTENTION: default value of option mesa_glthread overridden by environment.
[task 2024-05-21T11:44:04.523Z] 11:44:04     INFO - GECKO(3951) | ATTENTION: default value of option mesa_glthread overridden by environment.
[task 2024-05-21T11:44:07.303Z] 11:44:07     INFO - GECKO(3951) | 1716291847302	Marionette	INFO	Marionette enabled
[task 2024-05-21T11:44:07.306Z] 11:44:07     INFO - GECKO(3951) | 1716291847304	Marionette	TRACE	Received observer notification final-ui-startup
[task 2024-05-21T11:44:07.372Z] 11:44:07     INFO - GECKO(3951) | console.error: "Warning: unrecognized command line flag" "-foreground"
[task 2024-05-21T11:44:07.381Z] 11:44:07     INFO - GECKO(3951) | 1716291847380	Marionette	INFO	Listening on port 2828
[task 2024-05-21T11:44:07.385Z] 11:44:07     INFO - GECKO(3951) | 1716291847381	Marionette	DEBUG	Marionette is listening
[task 2024-05-21T11:44:07.402Z] 11:44:07     INFO - GECKO(3951) | 1716291847401	Marionette	DEBUG	Accepted connection 0 from 127.0.0.1:32852
[task 2024-05-21T11:44:07.491Z] 11:44:07     INFO - GECKO(3951) | 1716291847490	Marionette	DEBUG	Closed connection 0
[task 2024-05-21T11:44:07.495Z] 11:44:07     INFO - GECKO(3951) | 1716291847490	Marionette	DEBUG	Accepted connection 1 from 127.0.0.1:32854
[task 2024-05-21T11:44:08.344Z] 11:44:08     INFO - GECKO(3951) | 1716291848343	Marionette	DEBUG	1 -> [0,1,"WebDriver:NewSession",{"strictFileInteractability":true}]
[task 2024-05-21T11:44:08.348Z] 11:44:08     INFO - GECKO(3951) | 1716291848347	Marionette	DEBUG	Waiting for initial application window
[task 2024-05-21T11:44:11.792Z] 11:44:11     INFO - GECKO(3951) | console.error: ({})
[task 2024-05-21T11:44:14.821Z] 11:44:14     INFO - GECKO(3951) | [ERROR error_support::handling] suggest-unexpected: Error from Remote Settings: Error parsing URL: relative URL with a cannot-be-a-base base
[task 2024-05-21T11:44:14.827Z] 11:44:14     INFO - GECKO(3951) | console.error: URLBar - QuickSuggest.SuggestBackendRust: "Ingest error: Error from Remote Settings: Error parsing URL: relative URL with a cannot-be-a-base base"
[task 2024-05-21T11:44:14.990Z] 11:44:14     INFO - GECKO(3951) | 1716291854988	Marionette	TRACE	Received observer notification browser-idle-startup-tasks-finished
[task 2024-05-21T11:44:14.999Z] 11:44:14     INFO - GECKO(3951) | 1716291854998	RemoteAgent	TRACE	[3] ProgressListener Start: expectNavigation=false resolveWhenStarted=false unloadTimeout=40000 waitForExplicitStart=false
[task 2024-05-21T11:44:15.003Z] 11:44:15     INFO - GECKO(3951) | 1716291854999	RemoteAgent	TRACE	[3] ProgressListener Setting unload timer (40000ms)
[task 2024-05-21T11:44:15.005Z] 11:44:15     INFO - GECKO(3951) | 1716291855000	RemoteAgent	TRACE	[3] Wait for initial navigation: isInitial=false, isLoadingDocument=false
[task 2024-05-21T11:44:15.005Z] 11:44:15     INFO - GECKO(3951) | 1716291855000	RemoteAgent	TRACE	[3] Document already finished loading: about:blank
[task 2024-05-21T11:44:15.005Z] 11:44:15     INFO - GECKO(3951) | 1716291855000	RemoteAgent	TRACE	[3] ProgressListener Stop: has error=false
[task 2024-05-21T11:44:15.021Z] 11:44:15     INFO - GECKO(3951) | 1716291855019	Marionette	DEBUG	1 <- [1,1,null,{"sessionId":"4dd3bd8d-0334-4c7f-86e2-662076c11a1a","capabilities":{"browserName":"firefox","browserVersion":"128.0a1","platformName":"linux","acceptInsecureCerts":false,"pageLoadStrategy":"normal","setWindowRect":true,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"strictFileInteractability":true,"unhandledPromptBehavior":"dismiss and notify","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0","moz:accessibilityChecks":false,"moz:buildID":"20240521074552","moz:headless":false,"moz:platformVersion":"4.4.0-1014-aws","moz:processID":3951,"moz:profile":"/tmp/tmps64m1t6q.mozrunner","moz:shutdownTimeout":300000,"moz:webdriverClick":true,"moz:windowless":false,"proxy":{}}}]
[task 2024-05-21T11:44:15.195Z] 11:44:15     INFO - GECKO(3951) | 1716291855194	Marionette	DEBUG	1 -> [0,2,"Addon:Install",{"path":"/tmp/tmp0ryshzwd.zip","temporary":false}]
[task 2024-05-21T11:44:15.378Z] 11:44:15     INFO - GECKO(3951) | JavaScript error: , line 0: NotFoundError: No such JSWindowActor 'AppTestDelegate'
[task 2024-05-21T11:44:16.011Z] 11:44:16     INFO - GECKO(3951) | 1716291856010	Marionette	DEBUG	1 <- [1,2,null,{"value":"special-powers@mozilla.org"}]
[task 2024-05-21T11:44:16.193Z] 11:44:16     INFO - GECKO(3951) | 1716291856192	Marionette	DEBUG	1 -> [0,3,"Addon:Install",{"path":"/tmp/tmp_qysdbyb.zip","temporary":false}]
[task 2024-05-21T11:44:16.285Z] 11:44:16     INFO - GECKO(3951) | 1716291856284	Marionette	DEBUG	1 <- [1,3,null,{"value":"mochikit@mozilla.org"}]
[task 2024-05-21T11:44:16.313Z] 11:44:16     INFO - GECKO(3951) | 1716291856312	Marionette	DEBUG	1 -> [0,4,"Marionette:GetContext",{}]
[task 2024-05-21T11:44:16.315Z] 11:44:16     INFO - GECKO(3951) | 1716291856313	Marionette	DEBUG	1 <- [1,4,null,{"value":"content"}]
[task 2024-05-21T11:44:16.318Z] 11:44:16     INFO - GECKO(3951) | 1716291856317	Marionette	DEBUG	1 -> [0,5,"Marionette:SetContext",{"value":"chrome"}]
[task 2024-05-21T11:44:16.320Z] 11:44:16     INFO - GECKO(3951) | 1716291856317	Marionette	DEBUG	1 <- [1,5,null,{"value":null}]
[task 2024-05-21T11:44:16.369Z] 11:44:16     INFO - GECKO(3951) | 1716291856367	Marionette	DEBUG	1 -> [0,6,"WebDriver:ExecuteScript",{"script":"/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distr ... s which flavor and url to load.\nlet ev = new CustomEvent(\"mochitest-load\", { detail: [flavor, url] });\nwin.dispatchEvent(ev);","args":[{"flavor":"mochitest","testUrl":"https://example.com:443/tests?autorun=1&closeWhenDone=1&consoleLevel=INFO&manifestFile=tests.json&dumpOutputDirectory=%2Ftmp&cleanupCrashes=true&ignorePrefsFile=ignorePrefs.json"}],"newSandbox":true,"sandbox":"default","line":2167,"filename":"tests/mochitest/runtests.py"}]
[task 2024-05-21T11:44:16.374Z] 11:44:16     INFO - GECKO(3951) | 1716291856373	RemoteAgent	TRACE	WebDriverProcessData actor created for PID 3951
[task 2024-05-21T11:44:16.375Z] 11:44:16     INFO - GECKO(3951) | 1716291856374	Marionette	TRACE	[1] MarionetteCommands actor created for window id 2
[task 2024-05-21T11:44:16.422Z] 11:44:16     INFO - GECKO(3951) | 1716291856421	Marionette	DEBUG	1 <- [1,6,null,{"value":null}]
[task 2024-05-21T11:44:16.433Z] 11:44:16     INFO - GECKO(3951) | 1716291856432	Marionette	DEBUG	1 -> [0,7,"Marionette:SetContext",{"value":"content"}]
[task 2024-05-21T11:44:16.434Z] 11:44:16     INFO - GECKO(3951) | 1716291856432	Marionette	DEBUG	1 <- [1,7,null,{"value":null}]
[task 2024-05-21T11:44:16.437Z] 11:44:16     INFO - GECKO(3951) | 1716291856436	Marionette	DEBUG	1 -> [0,8,"WebDriver:DeleteSession",{}]
[task 2024-05-21T11:44:16.439Z] 11:44:16     INFO - GECKO(3951) | 1716291856437	Marionette	TRACE	[1] MarionetteCommands actor destroyed for window id 2
[task 2024-05-21T11:44:16.463Z] 11:44:16     INFO - GECKO(3951) | 1716291856460	Marionette	DEBUG	1 <- [1,8,null,{"value":null}]
[task 2024-05-21T11:44:16.480Z] 11:44:16     INFO - runtests.py | Waiting for browser...
[task 2024-05-21T11:44:16.483Z] 11:44:16     INFO - GECKO(3951) | 1716291856482	Marionette	DEBUG	Closed connection 1
[task 2024-05-21T11:44:17.022Z] 11:44:17     INFO - GECKO(3951) | console.error: (new TypeError("can't access property \"get\", linkMap is undefined", "resource://gre/modules/NewTabUtils.sys.mjs", 2003))
[task 2024-05-21T11:44:18.360Z] 11:44:18     INFO - SimpleTest START
[task 2024-05-21T11:44:18.360Z] 11:44:18     INFO - Dumping test context:
[task 2024-05-21T11:44:18.360Z] 11:44:18     INFO -   fission.autostart=true
[task 2024-05-21T11:44:18.380Z] 11:44:18     INFO - TEST-START | toolkit/components/extensions/test/mochitest/test_ext_storage_manager_capabilities.html
Flags: needinfo?(tomica)
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: 128 Branch → ---
Pushed by tjovanovic@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/aefb20bd8c57
Keep event page alive while waiting for permissions.request() r=robwu
Flags: needinfo?(tomica)
Status: REOPENED → RESOLVED
Closed: 2 months ago2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 128 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: