appdaemon icon indicating copy to clipboard operation
appdaemon copied to clipboard

The compiled application.js does not work in some browsers

Open Zylazy opened this issue 3 years ago • 3 comments

There is a try catch block in the compiled application.js, which causes problem in some browser (also in fully kiosk browser on my tablet). The problem is that the catch has no parameters how ever it is expected. So this line line 1267: catch should be replaced with this: catch (error)

Zylazy avatar Nov 12 '21 08:11 Zylazy

if you dont have any custom widgets and your AD is up to date (version 4.1) then you will have to wait for the next release or change the navigate widget to a custom widget en replace it with the corrected widget from the dev version from AD.

there was a try/catch in the navigate widget from 4.1 but its already repaired in the dev version.

ReneTode avatar Nov 13 '21 01:11 ReneTode

@ReneTode I'm faced with the same problem. I have some old tablet running Android 4.4.2 and trying to install any dashboard on it (HADash or TileBoard). Unfortunately none of them works. I have AD 4.1 running in docker:

/usr/src/app $ pip list|grep appda
appdaemon              4.1.0

and I try to see Hello.dash example on that tablet:

#
# Main arguments, all optional
#
title: Hello Panel
widget_dimensions: [120, 120]
widget_margins: [5, 5]
columns: 8

label:
    widget_type: label
    text: Hello World
    widget_style: "font-family: sans-serif;"

layout:
    - label(2x2)

So this is a very simple widget, and it doesn't appear on the tablet correctly (I checked all apps like WallPanel, Kiosk Browser etc, and even Firefox 55! The only browser worked was Opera, but I want to have HADash working in WallPanel). In dashboard I see that label widget (with colors depending on skin applied) but without any text. I was able to install local FF and debug over USB, and I see this in the errors:

image

I can find that application.js manually and it has the only 'catch' line (like @Zylazy says):

        else
        {
            if ("timeout" in parameters)
            {
                try {
                    current_dash = location.pathname.split('/')[1];
                    if (i == 0)
                    {
                        url = url + "?return=" + current_dash;
                        i++
                    }
                    else
                    {
                        url = url + "&return=" + current_dash;
                        i++
                    }
                }
                catch
                {
                    console.log('failled to auto-set return dashboard')
                }
            }
        }

And when I manually change that file and replace 'catch' with 'catch (err)', it works!

            if ("timeout" in parameters)
            {
                try {
                    current_dash = location.pathname.split('/')[1];
                    if (i == 0)
                    {
                        url = url + "?return=" + current_dash;
                        i++
                    }
                    else
                    {
                        url = url + "&return=" + current_dash;
                        i++
                    }
                }
                catch (error)
                {
                    console.log('failled to auto-set return dashboard')
                }
            }

@ReneTode do you know if that has been fixed in the dev release of AD? If yes, how can I check this fix in the sources? I'd really like to have it working because right now this is the only dashboard that might work on this tablet. Thanks!

sergeolkhovik avatar Mar 29 '22 10:03 sergeolkhovik

Oh, wait.. I just figured out that 4.2.1 is already released. Will try it and update what I find.

sergeolkhovik avatar Mar 29 '22 10:03 sergeolkhovik