···11--- original
22+++ modified
33-@@ -0,0 +1,62 @@
33+@@ -0,0 +1,65 @@
44+/* SPDX Id: AGPL-3.0-or-later */
55+
66+// Servo-specific API for communication between web content and the embedder.
···2727+
2828+ // Respond to a web task request with the selected provider id, or null to cancel.
2929+ undefined respondToTaskRequest(DOMString requestId, DOMString? providerId);
3030++
3131++ // Set a user default: always use this provider for this task (identified by href + optional remote peer).
3232++ undefined setTaskDefault(DOMString taskName, USVString providerHref, optional DOMString? remotePeerId = null);
3033+
3134+ // Register a task provider. Only available to privileged pages.
3235+ undefined registerTaskProvider(TaskProviderDescriptor descriptor);
···209209 /// Mark a new document as active
210210 ActivateDocument,
211211 /// Set the document state for a pipeline (used by screenshot / reftests)
212212-@@ -725,6 +858,109 @@
212212+@@ -725,6 +858,112 @@
213213 RespondToScreenshotReadinessRequest(ScreenshotReadinessResponse),
214214 /// Request the constellation to force garbage collection in all `ScriptThread`'s.
215215 TriggerGarbageCollection,
···316316+ /// Constellation responds with the task data via callback.
317317+ /// Args: callback(task_name, data, provider_port_id_bytes).
318318+ AcceptTask(GenericCallback<Option<(String, Option<StructuredSerializedData>, Vec<u8>)>>),
319319++ /// Set a user default for a task: always use this provider.
320320++ /// Args: task_name, provider_href, remote_peer_id.
321321++ SetTaskDefault(String, String, Option<String>),
319322 }
320323321324 impl fmt::Debug for ScriptToConstellationMessage {
+2-2
patches/components/shared/script/lib.rs.patch
···4141 /// Preferences were updated in the parent process.
4242 PreferencesUpdated(Vec<(String, PrefValue)>),
4343+ /// A web task request needs to be shown to the system UI.
4444-+ /// Fields: request_id, task_name, providers_json.
4545-+ ShowTaskChooser(String, String, String),
4444++ /// Fields: request_id, task_name, providers_json, default_provider_id.
4545++ ShowTaskChooser(String, String, String, Option<String>),
4646+ /// Tell the system UI to open a task provider webview.
4747+ /// Fields: request_id, provider_url, provider_title.
4848+ OpenTaskProvider(String, String, String),