Skip to content

Commit 0bcc7db

Browse files
authored
Merge pull request #691 from dotproto/multi-user-script
Multiple User Script Worlds proposal polish
2 parents ef23e63 + 88e7339 commit 0bcc7db

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

proposals/multiple_user_script_worlds.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,25 @@ Relevant methods and types:
140140

141141
+ /**
142142
+ * If specified, specifies a specific user script world ID to execute in.
143-
+ * Only valid if `world` is omitted or is `USER_SCRIPT`. If omitted, the
144-
+ * script will execute in the default user script world.
143+
+ * Only valid if `world` is omitted or is `USER_SCRIPT`. If `worldId` is
144+
+ * omitted, the script will execute in the default user script world.
145145
+ * Values with leading underscores (`_`) are reserved.
146146
+ */
147147
+ worldId?: string;
148148
}
149149

150150
...
151151

152+
export function configureWorld(config: WorldProperties): Promise<void>;
153+
154+
export function getScripts(filter?: UserScriptFilter[]): Promise<RegisteredUserScript[]>;
155+
156+
export function register(scripts: RegisteredUserScript): Promise<void>;
157+
158+
export function unregister(filter?: UserScriptFilter[]): Promise<void>;
159+
160+
export function update(scripts: RegisteredUserScript[]): Promise<void>;
161+
152162
+ /**
153163
+ * Resets the configuration for a given world. Any scripts that inject into
154164
+ * the world with the specified ID will use the default world configuration.
@@ -165,8 +175,9 @@ Relevant methods and types:
165175
}
166176
```
167177

168-
Note that the signatures of the related functions, including `configureWorld()`,
169-
`register()`, and others are left unchanged.
178+
Note that save for the introduction of `worldId` on these interfaces,
179+
the signatures of the related functions - `configureWorld()`,
180+
`register()`, and others – are left unchanged.
170181

171182
When the developer specifies a `RegisteredUserScript`, the browser will use a
172183
separate user script world when injecting the scripts into a document. If

0 commit comments

Comments
 (0)