Skip to content

Global variables cause some external sites to work incorrectly #14

@pichurichko

Description

@pichurichko

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions