PWA won't work

Website URL

http://www.gr8brik.rf.gd

Error Message

(please share the FULL error message you see, if applicable)

Other Information

I made a PWA app with valid code. It should work, but I have a problem. I get an error: “Manifest: Line: 1, column: 1, Syntax error.” When I go to sources->manifest.json, manifest.json looks like this: >

<body>
    <script type="text/javascript" src="/aes.js"></script>
    <script>
        function toNumbers(d) {
            var e = [];
            d.replace(/(..)/g, function(d) {
                e.push(parseInt(d, 16))
            });
            return e
        }
        function toHex() {
            for (var d = [], d = 1 == arguments.length && arguments[0].constructor == Array ? arguments[0] : arguments, e = "", f = 0; f < d.length; f++)
                e += (16 > d[f] ? "0" : "") + d[f].toString(16);
            return e.toLowerCase()
        }
        var a = toNumbers("f655ba9d09a112d4968c63579db590b4")
          , b = toNumbers("98344c2eee86c3994890592585b49f80")
          , c = toNumbers("11f8bb40df38cfe66693ce8168147ca1");
        document.cookie = "__test=" + toHex(slowAES.decrypt(c, 2, a, b)) + "; expires=Thu, 31-Dec-37 23:55:55 GMT; path=/";
        location.href = "https://www.gr8brik.rf.gd/manifest.json?i=1";
    </script>
    <noscript>This site requires Javascript to work, please enable Javascript in your browser or use a browser with Javascript support</noscript>
</body>

It’s supposed to look like:

{
“short_name”: “gr8brik”,
“name”: “GR8BRIK mobile (PWA)”,
“icons”: [
{
“src”: “/img/logo/512.png”,
“sizes”: “192x192”,
“type”: “image/png”
},
{
“src”: “./img/logo/384.png”,
“sizes”: “384x384”,
“type”: “image/png”
},
{
“src”: “/img/logo/192.png”,
“sizes”: “512x512”,
“type”: “image/png”
}
],
“start_url”: “/”,
“display”: “standalone”,
“background_color”: “#ffffff”,
“theme_color”: “#ffffff”,
“serviceworker”: {
“src”: “/serviceWorker.js”,
“scope”: “/”,
“update_via_cache”: “imports”
},
“description”: “Block building browser game.”,
“lang”: “en”
}
It seems like some obfuscation.
I can provide more code if you need.

Maybe the manifest can’t be validated on the PWA side because of this security system:

In fact, the first code you tried to integrate looks like the security system’s one in the article I linked to.

6 Likes

What if I hosted the manifest on another server? Would that work?

I’m not that familiar with PWAs, but I would expect that the PWA manifest and the website it actually talks to must be hosted on the same server.

The other issue is that even if a browser is able to setup the PWA, this same security issue may cause problems with running the PWA afterwards. It may also restrict the PWA from downloading assets, accessing any APIs hosted with us, and so on.

I’m not sure about it, and you’re definitely welcome to try, but I cannot guarantee you that it will work.

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.