This repository was archived by the owner on Feb 26, 2024. It is now read-only.
fix(listener): fix #616, webdriver removeEventListener throw permission denied error#699
Merged
mhevery merged 2 commits intoangular:masterfrom Apr 10, 2017
Merged
Conversation
…row permission denied error
mhevery
approved these changes
Apr 10, 2017
|
Which version, this PR is going to be in? |
Collaborator
Author
|
@jlin412 , I think it will be released into the next version(0.8.6 maybe). |
This file contains hidden or 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
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.
fix #616, and mozilla/geckodriver#515.
the issue just like angular/protractor#2784.
In cross site contexts (such as WebDriver frameworks like Selenium),
access eventHandler will throw permission denied error.
and in angular/protractor#2784, @juliemr fixed addEventListener,
in #616, firefox will also call removeEventListener , the code can be found here,
https://reviewboard.mozilla.org/r/98064/diff/12#index_header
so we need to do the same with addEventListener in removeEventListener to avoid
such issue.
https://github.com/JiaLiPassion/zone.js/blob/3fae05d347fde7e46cc8834158da74e544506877/lib/common/utils.ts#L320
in earlier fix, if data.handler.toString is permission denied, we do nothing, but in FF52+, toString() is not accessible, but we can still call native addEventListener/removeEventListener with the data.handler, so we can try to do that and try/catch to avoid error.
Firefox 52+, webdriver-manager 12.0.4+, selenium-webdriver 3.3.0+, and I will try to add it into travis/saucelabs after saucelabs support those newest browser/webdriver versions.