This repository has been archived by the owner on Jan 30, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
Refactor browserContext.grantPermissions #1075
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b8e6390
to
08e7912
Compare
ka3de
previously approved these changes
Oct 19, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👏
inancgumus
previously approved these changes
Oct 19, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work 👍 It's a good step towards #271 and #1064. Thanks! Some minor suggestions. Feel free to skip.
08e7912
to
d5c55a6
Compare
9d81296
to
3f1f503
Compare
ka3de
previously approved these changes
Oct 20, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
3f1f503
to
f7f3714
Compare
This change aligns the options parsing with the other APIs.
Instead of panicking in grantPermissions we should return an error to prevent unnecessary panics.
This moves the goja value parsing into the mapping layer so that we're removing goja from the browserContext business logic, which makes the code a bit more maintainable.
This change makes it explicit when a permission is used that the module doesn't recognise, allowing the user to fix the mistake quickly instead of having to debug the issue if the module just hid the invalid permissions.
Co-authored-by: İnanç Gümüş <[email protected]>
f7f3714
to
50992a9
Compare
ka3de
approved these changes
Oct 23, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
inancgumus
approved these changes
Oct 23, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
This refactors the
browserContext.grantPermissions
implementation.Why?
This helps bring it inline with current ways of implementing the APIs:
error
instead of panicking.Checklist
Related PR(s)/Issue(s)
Prerequisite to working on grafana/k6#4435