-
Notifications
You must be signed in to change notification settings - Fork 659
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
feat: add possibility to handle access geolocation dialog(closes #3224) #7791
Merged
Artem-Babich
merged 6 commits into
DevExpress:master
from
Artem-Babich:handle-geoposition
Jul 12, 2023
Merged
feat: add possibility to handle access geolocation dialog(closes #3224) #7791
Artem-Babich
merged 6 commits into
DevExpress:master
from
Artem-Babich:handle-geoposition
Jul 12, 2023
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
Artem-Babich
force-pushed
the
handle-geoposition
branch
from
June 13, 2023 15:17
56a7d63
to
b6e5c8c
Compare
miherlosev
requested changes
Jun 14, 2023
miherlosev
approved these changes
Jun 21, 2023
Artem-Babich
force-pushed
the
handle-geoposition
branch
from
June 22, 2023 07:45
dc96f3f
to
cdb8784
Compare
Artem-Babich
force-pushed
the
handle-geoposition
branch
from
July 12, 2023 08:20
cdb8784
to
89ca440
Compare
Release v3.1.0-rc.1 addresses this. |
2 tasks
miherlosev
pushed a commit
that referenced
this pull request
Jul 20, 2023
## Purpose If the user mocks the geolocation dialog via page/client-scripts/client-function we will override it with default native dialog handler. That will lead to unexpected behavior. This PR also handles the case when the user "promisified" the getCurrentPosition method which may lead to test hanging. ## Approach Do not override the getCurrentPosition method in case when it is already overridden. ## References #7791 ## Pre-Merge TODO - [x] Write tests for your proposed changes - [ ] Make sure that existing tests do not fail
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Purpose
#3224
In some cases, you need to handle access geolocation dialog and provide a corresponding result.
Approach
The geolocation window can be invoked when the user call window.navigator.geolocation.getCurrentPosition or watchPosition.
We cannot emulate watchPosition method because it invokes callbacks on changing user geolocation. So, this PR only handles getCurrentPosition method. When this method is called on the page for the first time, the Geolocation access dialog must be shown. All subsequent calls will lead to returning geolocation in the case when the user allowed access, or an error in the case when the user denied access.
This handler allows you to return a geolocation or an error when calling getCurrentPosition. If an instance of an Error object was returned, the failCallback function will be called with that error. If any other value is returned, then successCallback will be called with that value.
Since this dialog is only shown the first time getCurrentPosition is called, the history contains only one record per URL.
API
References
#3224
Pre-Merge TODO