thomasloven / lovelace-card-mod

πŸ”Ή Add CSS styles to (almost) any lovelace card
MIT License
1.05k stars 169 forks source link

3.3.0 does not work on older versions of browser engines #318

Closed jvcsw closed 6 months ago

jvcsw commented 7 months ago

My Home Assistant version: 2023.11.3

My lovelace configuration method (GUI or yaml): GUI

What I am doing: I use card-mod in a lot of areas of my lovelace and all works fine using card-mod 3.2.4. After update to version 3.3.0 all works fine using desktop browsers, but, tablets and phones with old versions of android (webview) do not work.

Ex: Fire HD 8 (2017)

What I expected to happen: All works fine.

What happened instead: All card-mod lines are ignored.

Minimal steps to reproduce: any card-mod code

Error messages from the browser console: Not found

By putting an X in the boxes ([]) below, I indicate that I:

ildar170975 commented 7 months ago

For the record: iOS 12.5.x, iPhone 5S - card-mod seems to be working (although I have not tested ALL my mods for a last few months).

leovj commented 7 months ago

I confirm i have iPad 2 with iOs 12.5.7, it doesn't seem to work with safari, kiosk and app Companion..

formatBCE commented 7 months ago

Lenovo Clock 2 - confirmed bug, doesn't work in system browser, Fully kiosk Browser and companion app.

pickonedev commented 7 months ago

Same problem here. Where I use Fully Kiosk Broswer, I get error similar with this "custom element doesn't exists cart mod". I have downgraded to 3.2.4, everything working good with this. The problem is with the new version "3.3.0"

Roflcopterer commented 7 months ago

Having the same issue using the "Wallpanel" app on a "Lenovo Smart Clock 2". This device uses an older version of Android and Webview.

A similar issues happened with Mushroom Cards (and was fixed): https://github.com/piitaya/lovelace-mushroom/issues/963

pickonedev commented 7 months ago

Maybe @thomasloven it is already working for a fix, we just need to wait.

QuAzI commented 7 months ago

On Firefox (Desktop) and the official application for Android 12 card-mod works randomly. One reload - works, next - all card_mod customizations ignored, always randomly.

skydado commented 7 months ago

Same problem here on a Family Hub tizen 6.0 tablet. A similar issue happened with other cards and has been solved downgrading the LIT version back to v2. See https://github.com/maxwroc/battery-state-card/issues/596 and https://github.com/pkissling/clock-weather-card/issues/243

tbrasser commented 6 months ago

Saw a mention of fire hd tablets here, know you can update the webview, so if that's your only "old" device you may be lucky. As this problem will continue to pop up when using older webviews, at some point (especially when using custom cards) it's gonna break.

snairolf commented 6 months ago

I have the same issue. It's a Samsung Smart Fridge in my case. There is no option to update.

pickonedev commented 6 months ago

Just downgrade and wait till @thomasloven have time to repair the issue

snairolf commented 6 months ago

Browser and Operating System: Samsung Smart fridge (Tizen browser 1.0; seems to be running webkit 537.36)

Reproduce

MMDaemonD commented 6 months ago

Same issue with my old samsung tablet.

Dear @thomasloven can you please help us with this issue? Thank you so much.

TrutaIonM commented 6 months ago

Same problem

RoxyPoxy2015 commented 6 months ago

I get the same issues

spudje commented 6 months ago

And same here. It's not just card_mod, there are more addons that broke recently on older browsers. I really think this is a very bad development. It's basically forcing us to keep all our dashboard hardware unrealistically up to date, The Lenovo Smart Clock 2 is only 2 years old!!

ildar170975 commented 6 months ago

Many devices (fridge etc) have "browsers" with quite limited possibilities & not following standards. Creating a software which will keep supporting these so called "browsers" is not an easy task; guess in some cases it is not realistic. Suggest users NOT to expect that something will keep working in these "browsers".

spudje commented 6 months ago

That's different from devices that use Android webview (which does obey standards), but are locked down so can't be updated to newer versions of webview. I'm just asking to extend/keep support for older webview versions.

ildar170975 commented 6 months ago

Btw, what particular reason makes people to think that it was card-mod which stopped working in their devices? May be it was a change in HA itself? From time to time HA Frontend change controls like "paper input -> MDC" (like in ~2023.2), or controls (which are 3rd party solutions) are changed by their developers (like the recent change of slider in 2023.11). In some cases these changes are not supported by old browsers (or by so called "browsers" with limited possibilities). And ofc some card-mod code may just become not applicable to new controls; and users just need to revise their styles, nothing else. Guess some amount of these "card-mod stopped working" complains come from users who do not know how card-mod works.

TrutaIonM commented 6 months ago

Btw, what particular reason makes people to think that it was card-mod which stopped working in their devices? May be it was a change in HA itself? From time to time HA Frontend change controls like "paper input -> MDC" (like in ~2023.2), or controls (which are 3rd party solutions) are changed by their developers (like the recent change of slider in 2023.11). In some cases these changes are not supported by old browsers (or by so called "browsers" with limited possibilities). And ofc some card-mod code may just become not applicable to new controls; and users just need to revise their styles, nothing else. Guess some amount of these "card-mod stopped working" complains come from users who do not know how card-mod works.

  1. The most obvious reason: you see that the addon has a new update, you make the update, then nothing is working, after that if you downgrade the addon and all good again.
  2. Imagine that HA is the sun and addons are the planets, guess which one will circle who (every addon must update the code, in order to work with a newer version of HA, it is logical)
  3. It has nothing to do with browsers, I use the same most recent browser on all my tablets (fully kiosk), the only difference is that some are using Android 11, some 10, some, some
  4. How card-mod works?! I tell you how, for me: It is not working. If you will have this issue, your answers will be totally different...
pickonedev commented 6 months ago

It is starting to become funny... I agree with @spudje support it is all the matters when we talk about updates...

ildar170975 commented 6 months ago

every addon must update the code, in order to work with a newer version of HA, it is logical

You probably missed the "3rd party controls changed" & "ways of using card-mod hence obviously must be revised" point.

It has nothing to do with browsers, I use the same most recent browser on all my tablets (fully kiosk), the only difference is that some are using Android 11, some 10, some, some

And same browser may not use/support some functionality in diff OS. Btw, some my card-mod styles work differently even in the latest Safari - because this is Safari. And this is not a reason to kill myself.

TrutaIonM commented 6 months ago

Try to be more optimistic, you can finally find a reason for that.

pickonedev commented 6 months ago

I tried to make the update again to 3.3.0 and seems that now it is somehow working... All of you which have the problem, try a machine restart, clear cache for the browsers and give again a try to the new version

pickonedev commented 6 months ago

@ildar170975 about the ways of using the card-mod, I don't see any breaking change announcement for 3.3.0... Only this could drastically change the way of using addon, right? Sorry but I don't get it...

ildar170975 commented 6 months ago

@pickonedev As I said, HA changed ; also it could be due to changed dependencies.

spudje commented 6 months ago

In my case it's not an HA change, since I didn't update Hass (yet). It's only the card_mod update that caused this.

In smart clock I get: PXL_20231215_102448556

In normal up to date browser I get correct results: image

ildar170975 commented 6 months ago

Just checked again iPhone 5S (iOS 12.5.7). Confirm - card-mod stopped working on 2023.12.2 (and was working with 2023.11.x) with even simple styles like

type: entities
...
card_mod:
  style: |
    ha-card {
      color: red;
    }

Last time I checked it was with 2023.12.0 - seemed to work. Now it is 2023.12.2. Also, I start to doubt - may be that time I tested with 2023.11.x, not with 2023.12.0.

spudje commented 6 months ago

I'm still on 2023.11 and have the issues. So not related to that.

ildar170975 commented 6 months ago

I'm still on 2023.11 and have the issues. So not related to that.

Tested my device with 2023.12.0 & card-mod 3.2.4 - card-mod not working at all. So, seems that some changes in HA caused card-mod to stop working.

formatBCE commented 6 months ago

I'm still on 2023.11 and have the issues. So not related to that.

Tested my device with 2023.12.0 & card-mod 3.2.4 - card-mod not working at all. So, seems that some changes in HA caused card-mod to stop working.

EDIT: sorry didn't realize you're saying "iOS".

Works for me on Android, with same versions. I'm on latest HA now 2023.12.3, and card-mod 3.2.4. Works good. Updating to 3.3.0 - stops working. Reverting card-mod to 3.2.4 - works again.

The problem for Android is in 3.3.0.

There's some some discussion about different "browsers" on Android. I'm android dev. And i insist, that vast majority of browser apps (including Fully Kiosk) on Android do not use their own WebView, but use SYSTEM implementation. So basically, "browser version" doesn't depend on certain browser app, but on system Android WebView version - which is mostly carved in stone for some unusual devices or for older Android versions. I tried to update WebView on my Lenovo clock, but i'd need root access which i don't have. The fact that it works on newer Android versions confirms all that i wrote.

spudje commented 6 months ago

Exactly, so either, dear developers, please continue support for older webview versions or give us a Hass android app "minimal" (without google services dependencies) and integrated webview. I know, this is not the github for that. I might do a feature request in the companion app github.

formatBCE commented 6 months ago

Exactly, so either, dear developers, please continue support for older webview versions or give us a Hass android app "minimal" (without google services dependencies) and integrated webview. I know, this is not the github for that. I might do a feature request in the companion app github.

That's not right. Nothing to do with companion app. A lot of folks use Fully Kiosk browser, since it's faster and more customizable for wall panels or clocks.

Card-mod should support older versions of Android WebView. That way all old browser apps will be supported.

ildar170975 commented 6 months ago

iPhone 5S (iOS 12.5.7) HA 2023.11.1 + card-mod 3.2.3 β†’ WORKING (at least with simple styles). HA 2023.12.2 + card-mod 3.2.3 β†’ WORKING (same, not tested all my cases) HA 2023.12.2 + card-mod 3.2.4 β†’ WORKING (same, not tested all my cases) HA 2023.12.2 + card-mod 3.3.0 β†’ NOT

spudje commented 6 months ago

That's not right. Nothing to do with companion app. A lot of folks use Fully Kiosk browser, since it's faster and more customizable for wall panels or clocks.

Please read what I write. The companion app and Fully Kiosk browser as well depend on the standard Android webview. If this standard Android webview is too old, we run into these issues.

What I would love to see is a companion app that has its own webview integrated. So that when we update the companion app, the (internal) webview is updated as well. So we are not dependent on the standard (old) Android webview of the device on which the app is running.

formatBCE commented 6 months ago

That's not right. Nothing to do with companion app. A lot of folks use Fully Kiosk browser, since it's faster and more customizable for wall panels or clocks.

Please read what I write. The companion app and Fully Kiosk browser as well depend on the standard Android webview. If this standard Android webview is too old, we run into these issues.

What I would love to see is a companion app that has its own webview integrated. So that when we update the companion app, the (internal) webview is updated as well. So we are not dependent on the standard (old) Android webview of the device on which the app is running.

I don't know what level of expertise in Android you have, but on my level (15 years of development) it seems impossible to update system webview with update to third-party app, which Companion is.

And even if it would be possible - who wants to keep Companion app on some minimal-specs device just to have updated webview for Fully Kiosk Browser?

ildar170975 commented 6 months ago

HA 2023.12.2 + card-mod 3.2.4 β†’ WORKING !!!!! updated my post

thomasloven commented 6 months ago

This should now be fixed in version 3.3.1.

Please note that it can be really really hard to get rid of old cached versions on e.g. ipad. Have patience if it doesn't work immediately.

formatBCE commented 6 months ago

This should now be fixed in version 3.3.1.

Please note that it can be really really hard to get rid of old cached versions on e.g. ipad. Have patience if it doesn't work immediately.

Thank you so much @thomasloven . So it should work, if updating straight from 3.2.4 to 3.3.1, I guess?

thomasloven commented 6 months ago

I hope so.

ildar170975 commented 6 months ago

@thomasloven Thank you, Thomas! iPhone 5S (iOS 12.5.7), 2023.12.1, card-mod 3.3.1 - works OK

spudje commented 6 months ago

@thomasloven Awesome, awesome!!! Thanks so very much. It works fine again on my Lenovo Smart Clock 2 as well.

formatBCE commented 6 months ago

@thomasloven unfortunately, with new HA update problem returned. :( Still works on 3.2.4 though.

thomasloven commented 6 months ago

Please note that it can be really really hard to get rid of old cached versions on e.g. ipad. Have patience if it doesn't work immediately.

This also means it may reappear after working for a while.

spudje commented 6 months ago

Anyone checked with 3.4.0 on old browsers? Reluctant to update after the previous experience.

thomasloven commented 6 months ago

Works on iPad Air with IOS 12.5.

spudje commented 6 months ago

Thanks! I can confirm 3.4.1 works fine on my Lenovo Smart Clock 2.