Skip to content
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

Guard ensureScrollValueMonitoring against popup blockers overriding document.createEvent() #7621

Merged
merged 1 commit into from
Aug 31, 2016
Merged

Guard ensureScrollValueMonitoring against popup blockers overriding document.createEvent() #7621

merged 1 commit into from
Aug 31, 2016

Conversation

Andarist
Copy link
Contributor

@Andarist Andarist commented Aug 31, 2016

Fixes #6887

cc @gaearon

expect(document.createEvent.calls.count()).toBe(1);
expect(hasEventPageXY).toBe(false);

document.createEvent = originalCreateEvent;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please wrap expectations into try / finally so document.createEvent is always restored regardless of whether the test fails?

@gaearon gaearon changed the title Guarded ensureScrollValueMonitoring against some malicious script on … Guarded ensureScrollValueMonitoring against popup blockers overriding document.createEvent() Aug 31, 2016
@gaearon gaearon changed the title Guarded ensureScrollValueMonitoring against popup blockers overriding document.createEvent() Guard ensureScrollValueMonitoring against popup blockers overriding document.createEvent() Aug 31, 2016
@gaearon gaearon mentioned this pull request Aug 31, 2016
@ghost ghost added the CLA Signed label Aug 31, 2016
@Andarist
Copy link
Contributor Author

@gaearon amended along your suggestions

…the Internet overriding native document.createEvent (fixes #6887)
@gaearon gaearon added this to the 15-next milestone Aug 31, 2016
@gaearon gaearon merged commit 51476de into facebook:master Aug 31, 2016
@gaearon
Copy link
Collaborator

gaearon commented Aug 31, 2016

Thanks.

@zpao zpao modified the milestones: 15.3.2, 15-next Sep 8, 2016
zpao pushed a commit that referenced this pull request Sep 15, 2016
…the Internet overriding native document.createEvent (fixes #6887) (#7621)

(cherry picked from commit 51476de)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants