Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Web compatibility issue in bricklink.com with "at" method name #41

Open
@Constellation

Description

We enabled at method of Array in ToT WebKit, and encountered web compatibility issue in bricklink.com.
The website includes

            var at = blUtil.getHashVar("at");

            if (at)
            {
                var trigger = JSON.parse(blUtil.decodeURLSafeB64(at));
        getVarsFromHashString:
        function(strHash)
        {
            var vars = [],
                hash;
            var hashes = strHash.slice(strHash.indexOf('#') + 1).split('&');
            for (var i = 0; i < hashes.length; i++)
            {
                hash = hashes[i].split('=');
                vars.push(hash[0]);
                vars[hash[0]] = this.decodeURL(hash[1]);
            }
            return vars;
        }
...
        getHashVars: function()
        {
            return $.getVarsFromHashString(window.location.href);
        }
...
        getHashVar: function(name)
        {
            return $.getHashVars()[name];
        }

It attempted to extract at hash value from window.location.href, and it is using array to construct hash table.
Previously, at returns undefined (if at hash value does not exist) or string (if at hash value exists). But now, it returns function, and getting a wrong code path.

This website does not work with STP 118 and Chrome Canary.

Since at is still common name, I wonder if we need to pick itemAt instead.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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