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

Global variables cause some external sites to work incorrectly #14

Open
pichurichko opened this issue Feb 27, 2024 · 0 comments
Open

Global variables cause some external sites to work incorrectly #14

pichurichko opened this issue Feb 27, 2024 · 0 comments

Comments

@pichurichko
Copy link

Which platform(s) does your issue occur on?

Both (examples below reproducible on iOS)

Please, provide the following version numbers that your issue occurs with:

Does not matter, web view runtime issue

Please, tell us how to recreate the issue in as much detail as possible.

Open some site in web view which executes script in global scope like (code from real 3DS payment form):
for (i = 0, ii = 0; i < method.length; i++) {
...
}

Is there any code involved?

The reason of the issue is this code:

const w = window as any;

const w = window as any;

After minification "w" variable transforms to "i", and if some site will use it in "for" loop like from example, it will get error:

TypeError: Attempted to assign to readonly property.

Recommendation for fix is to wrap the related code from links into separate scope (not global one).

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

No branches or pull requests

1 participant