Skip to content
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
JiaLiPassion:webdriver
Apr 10, 2017
Merged

fix(listener): fix #616, webdriver removeEventListener throw permission denied error#699
mhevery merged 2 commits intoangular:masterfrom
JiaLiPassion:webdriver

Conversation

@JiaLiPassion
Copy link
Copy Markdown
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
Copy Markdown

jlin412 commented Apr 14, 2017

Which version, this PR is going to be in?

@JiaLiPassion
Copy link
Copy Markdown
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