Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support preload scripts per user context #862

Merged
merged 9 commits into from
Jan 20, 2025
Merged

Conversation

OrKoN
Copy link
Contributor

@OrKoN OrKoN commented Jan 16, 2025

Closes #849


Preview | Diff

@OrKoN OrKoN force-pushed the orkon/preload-user-context branch 2 times, most recently from 1f64732 to 5b3ea11 Compare January 16, 2025 18:15
Copy link
Contributor

@juliandescottes juliandescottes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks great, some nits and minor issues to fix.

index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
OrKoN and others added 3 commits January 17, 2025 10:50
Co-authored-by: Julian Descottes <jdescottes@mozilla.com>
Co-authored-by: Julian Descottes <jdescottes@mozilla.com>
index.bs Outdated Show resolved Hide resolved
index.bs Show resolved Hide resolved
Copy link
Contributor

@juliandescottes juliandescottes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good on my end, thanks for the update!

@OrKoN OrKoN force-pushed the orkon/preload-user-context branch from 5ea2f50 to f8311a9 Compare January 17, 2025 10:34
Comment on lines +9815 to +9821
1. Set |user contexts| to [=set/create|create a set=] with |command parameters|["<code>userContexts</code>"].

1. For each |user context id| of |user contexts|:

1. Set |user context| to [=get user context=] with |user context id|.

1. If |user context| is null, return [=error=] with [=error code=] [=no such user context=].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe iterate through the |command parameters|["<code>userContexts</code>"], assert valid values and append them to existing map |user contexts| to increase readability and align with contexts logic one step above?

@OrKoN OrKoN merged commit 8043429 into main Jan 20, 2025
5 checks passed
@OrKoN OrKoN deleted the orkon/preload-user-context branch January 20, 2025 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for "userContexts" argument to "script.addPreloadScript" command
4 participants