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

Possibly wrong match on topOrParentLocationOrFramesRe regexp #3267

Closed
leandro-serafim opened this Issue Jan 31, 2019 · 3 comments

Comments

2 participants
@leandro-serafim
Copy link

leandro-serafim commented Jan 31, 2019

Current behavior:

Currently, having modifyObstructiveCode enabled didn't get a specific framebust situation:

top.location!=self.location&&(top.location.href=self.location.href)

After researching over the code base I could identify the regexp used on topOrParentLocationOrFramesRe possibly isn't getting correctly the first group match, as you can see: (https://regex101.com/r/o0ykmR/1)

Desired behavior:

I'd like to be able to block the given framebust.

Steps to reproduce: (app code and test code)

The regexp on topOrParentLocationOrFramesRe gets an extra character as you see here

Possibly the easiest fix I'd suggest could be:
https://regex101.com/r/Ophqrr/2

Versions

Cypress: v3.1.5
Windows 11
Chrome: 71.x

@jennifer-shehane

This comment has been minimized.

Copy link
Member

jennifer-shehane commented Feb 1, 2019

Thanks for the thorough investigation of the issue. Gotta <3 Regex. We'll have to update the regex, write a test to ensure it fixes this issue and ensure no other framebusting tests fail.

@jennifer-shehane

This comment has been minimized.

Copy link
Member

jennifer-shehane commented Feb 1, 2019

I opened a PR here: #3279

@cypress-bot

This comment has been minimized.

Copy link

cypress-bot bot commented Mar 15, 2019

Released in 3.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.