From 3e63425a24dfc786ac00b83a0646de79e22880ad Mon Sep 17 00:00:00 2001 From: Simeon Vincent Date: Wed, 18 Sep 2024 22:19:22 -0700 Subject: [PATCH 1/3] Clarify behavior of omitting RegisteredUserScript.worldId --- proposals/multiple_user_script_worlds.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proposals/multiple_user_script_worlds.md b/proposals/multiple_user_script_worlds.md index 55d694e1..bd73878a 100644 --- a/proposals/multiple_user_script_worlds.md +++ b/proposals/multiple_user_script_worlds.md @@ -140,8 +140,8 @@ Relevant methods and types: + /** + * If specified, specifies a specific user script world ID to execute in. -+ * Only valid if `world` is omitted or is `USER_SCRIPT`. If omitted, the -+ * script will execute in the default user script world. ++ * Only valid if `world` is omitted or is `USER_SCRIPT`. If `worldId` is ++ * omitted, the script will execute in the default user script world. + * Values with leading underscores (`_`) are reserved. + */ + worldId?: string; From 8285cdf9fd53d47bf33e98cbb34c2bea52b997c9 Mon Sep 17 00:00:00 2001 From: Simeon Vincent Date: Wed, 18 Sep 2024 22:24:15 -0700 Subject: [PATCH 2/3] Add type definitions for methods on RegisteredUserScript --- proposals/multiple_user_script_worlds.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/proposals/multiple_user_script_worlds.md b/proposals/multiple_user_script_worlds.md index bd73878a..e6827254 100644 --- a/proposals/multiple_user_script_worlds.md +++ b/proposals/multiple_user_script_worlds.md @@ -149,6 +149,16 @@ Relevant methods and types: ... + export function configureWorld(config: WorldProperties): Promise; + + export function getScripts(filter?: UserScriptFilter[]): Promise; + + export function register(scripts: RegisteredUserScript): Promise; + + export function unregister(filter?: UserScriptFilter[]): Promise; + + export function update(scripts: RegisteredUserScript[]): Promise; + + /** + * Resets the configuration for a given world. Any scripts that inject into + * the world with the specified ID will use the default world configuration. From 88e7339029cc53d8d6b3b7e285fced6e9928c6bb Mon Sep 17 00:00:00 2001 From: Simeon Vincent Date: Wed, 18 Sep 2024 22:27:38 -0700 Subject: [PATCH 3/3] Clarify how userScripts methods are affected --- proposals/multiple_user_script_worlds.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/proposals/multiple_user_script_worlds.md b/proposals/multiple_user_script_worlds.md index e6827254..89e1d69c 100644 --- a/proposals/multiple_user_script_worlds.md +++ b/proposals/multiple_user_script_worlds.md @@ -175,8 +175,9 @@ Relevant methods and types: } ``` -Note that the signatures of the related functions, including `configureWorld()`, -`register()`, and others are left unchanged. +Note that save for the introduction of `worldId` on these interfaces, +the signatures of the related functions - `configureWorld()`, +`register()`, and others – are left unchanged. When the developer specifies a `RegisteredUserScript`, the browser will use a separate user script world when injecting the scripts into a document. If