Chrome console deprecation warnings on Discourse v2026.1.0-latest (+307)

AI-generated summary

In the Dev category under the topic ‘Chrome console deprecation warnings on Discourse v2026.1.0-latest (+307)’, user Ethsim2 reports consistent deprecation warnings in Chrome during page load on a Discourse site running v2026.1.0-latest +307. The warnings relate to accessing site.mobileView/site.desktopView during initialization and the use of document.execCommand(), both of which are deprecated. While these do not break functionality, Ethsim2 seeks confirmation if these issues are addressed in newer commits or if there are recommended modern replacements. chapoi confirms these are legacy issues being gradually phased out and points to a guide on designing for different devices at meta.discourse.org.

Hi all,

While testing a Discourse site, I’m seeing consistent Chrome console deprecation warnings during initial page load.

This does not break functionality - the site operates normally - but I wanted to check whether this is already known or being cleaned up in recent commits.

Environment

  • Discourse core: v2026.1.0-latest +307
    (latest available at time of testing: +349, ~42 commits ahead)
  • Browser: Chrome (current stable)
  • OS: Windows 11
  • Theme: standard site theme (no custom JS added manually)
  • Plugins: only official Discourse plugins enabled

Console warnings observed

  • Accessing site.mobileView / site.desktopView during site initialization may lead to errors in future versions
  • document.execCommand() is deprecated

These appear during early app initialization (before user interaction) and are reproducible on hard reload.

I’m aware these are deprecation warnings rather than runtime errors - mainly checking whether:

  • these are already addressed in more recent -latest commits, or
  • there is a recommended modern replacement pattern for themes / components that still rely on these APIs.

Happy to test against +349 or a clean install if that helps.

Thanks!

This is legacy that’s slowly being replaced; we don’t have a distinct timeline for when all of the instances of this will be resolved.

I’m assuming the same for the other one.

For the one above that’s outlined in:

Designing for Different Devices (Viewport Size, Touch/Hover, etc.)