maykar / compact-custom-header

This project has been replaced by Custom Header
MIT License
239 stars 31 forks source link

Browser hanging (high CPU) if theme changed without refreshing page #200

Closed gadgetchnnel closed 5 years ago

gadgetchnnel commented 5 years ago

Describe the issue:

With Compact Custom Header enabled, the browser will hang if the following steps are performed:

  1. Click on Profile
  2. Change the theme from the dropdown
  3. Click on Overview to navigate to the Lovelace home page
  4. Click on any other tab or sidebar icon

When it hangs, the CPU usage of Chrome rapidly increases up to almost 200%. The page is unresponsive until the process is killed (although sometimes, if you catch it quickly enough, you can close the tab instead). The same happens with Safari (the CPU only seems to increase to around 100% but the experience is the same). Using the Chrome browser on an Android phone, the whole browser becomes unresponsive and needs to be force stopped.

If Compact Custom Header is disabled or the page is refreshed before step 4 it doesn't happen.

Disabling Compact Custom Header stops this from happening. It also doesn’t happen if I refresh the page after changing the theme (as long as this is done before trying to navigate to another tab).

Config YAML:

cch:
  chevrons: true
  exceptions:
    - conditions:
        user: Kiosk
      config:
        default_tab: Kiosk
        disable: false
        header: true
        hide_tabs: 0 to 8
        kiosk_mode: true
        menu: show
        notifications: show
        options: show
        redirect: true
        show_tabs: Kiosk
        voice: show
        disable_sidebar: false
    - conditions:
        query_string: embed
      config:
        default_tab: []
        hide_tabs: '9'
        kiosk_mode: true
        menu: show
        notifications: show
        options: show
        show_tabs: []
        voice: show
    - conditions:
        user_agent: Mobile
      config:
        default_tab: []
        hide_tabs: 'Kiosk,Calendar,media-players,Github,Test'
        menu: show
        notifications: show
        options: show
        show_tabs: []
        voice: overflow
  hide_help: true
  hide_tabs: 'Kiosk,Calendar,Test'
  swipe: true

HA and/or Browser Error:

Versions and Browser:

CCH Version: 1.3.6 Home Assistant Version: 0.98.5

Browser versions: Chrome 76 and Safari 12.0 on macOS Mojave and Chrome on Android 9 (EMUI 9.1.0)

Storage Mode

maykar commented 5 years ago

Duplicate issue with config for reference: https://github.com/maykar/compact-custom-header/issues/202 (note to self)

maykar commented 5 years ago

Should be sorted in the latest release. More info:

https://community.home-assistant.io/t/compact-custom-header/83716/1179