Skip to content
This repository has been 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
merged 2 commits into from
Apr 10, 2017

Conversation

JiaLiPassion
Copy link
Collaborator

@JiaLiPassion JiaLiPassion commented Mar 24, 2017

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.

  • And I modify a little about addEventListener/removeEventListener

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.

@mhevery mhevery merged commit e02960d into angular:master Apr 10, 2017
@jlin412
Copy link

jlin412 commented Apr 14, 2017

Which version, this PR is going to be in?

@JiaLiPassion
Copy link
Collaborator Author

@jlin412 , I think it will be released into the next version(0.8.6 maybe).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Protractor tests on Firefox fail for Angular apps using Zone.JS > 0.7.2
4 participants