-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
RegExp for modifyObstructiveCode replaces var names started with top
with self
when it shouldn't
#4794
Comments
top
to self
top
with self
Hey @indooorsman, this is intended behavior in Cypress in order to have sites tested in Cypress work correctly - as they are run from within an iframe - and some sites have framebusting code. You can turn off this behavior by setting I'd like to more fully understand the error you are getting and the unintended effect that Cypress seems to have caused in your application though. Can you post the error and explain the unexpected behavior more fully? Thanks. |
@jennifer-shehane Thanks for your reply, the error is funcA(topTarget) {
if (topTarget.window === topTarget) { ... }
} In cypress it's replaced with: funcA(topTarget) {
if (topTarget.window === selfTarget) { ... }
} Of course, And I think the regexp About setting |
@indooorsman Thanks. Yeah, indeed - I agree this RegExp is too lenient in this situation and is definitely a problem. Thanks for clearing this up - we need to fix this. |
top
with self
top
with self
when it shouldn't
The code for this is done in cypress-io/cypress#4831, but has yet to be released. |
@jennifer-shehane Great, thanks for your efficient actions 💯 |
Released in 3.4.1 |
cypress/packages/server/lib/util/security.js
Line 17 in b568e82
One of my file contains the below code:
in Cypress, It's replaced with
and it caused error.
Please fix it as soon as possible, many thanks <3
The text was updated successfully, but these errors were encountered: