• Login
    • Search
    • Categories
    • Recent
    • Tags
    • Users
    • Groups
    • Rules
    • Help

    Do more on the web, with a fast and secure browser!

    Download Opera browser with:

    • built-in ad blocker
    • battery saver
    • free VPN
    Download Opera

    DevTools Responsive mode reports incorrect viewport width after reload

    General
    devtools responsive viewport
    1
    1
    38
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      przwojwwp last edited by

      Hello,

      I have already reported this issue through Opera's official bug reporting system.
      Reference: BS-104581

      The issue occurs intermittently when “Responsive” is selected in the DevTools Device Toolbar.

      When the issue occurs, reloading the page while “Responsive” mode is active may cause the layout viewport to be initialized incorrectly, even though the Device Toolbar still displays the expected dimensions.

      For example, with Responsive mode set to 320 × 568, I observed:

      window.innerWidth: 1868
      document.documentElement.clientWidth: 1868
      window.visualViewport.width: 1868
      window.screen.width: 320

      As a result, mobile CSS media queries do not match and the page is rendered as tablet/desktop.

      Resizing the responsive viewport slightly immediately recalculates the viewport correctly.

      The issue does not occur when a specific device preset is selected. Switching from “Responsive” to a phone preset and back to “Responsive” may also temporarily clear the issue.

      Steps to reproduce:

      1. Open DevTools.
      2. Enable Device Toolbar.
      3. Select “Responsive”.
      4. Set the viewport to 320 × 568.
      5. Reload the page.
      6. When the issue occurs, the Device Toolbar still shows 320 × 568, but the layout viewport reports a much larger width.
      7. Resize the responsive viewport slightly.
      8. The viewport is immediately recalculated correctly.

      Expected:
      The layout viewport should always match the dimensions shown in Responsive mode after reload.

      Control test:
      Selecting a specific phone preset and reloading initializes the viewport correctly.

      The issue is also reproducible with a standalone HTML file without React, Vite, SCSS or any framework.

      Environment:
      Opera One: 135.0.5973.41
      Chromium: 151.0.7922.138
      Windows 11 64-bit
      Stable channel

      Kind Regards

      Reply Quote 0
        1 Reply Last reply
      • First post
        Last post

      Computer browsers

      • Opera for Windows
      • Opera for Mac
      • Opera for Linux
      • Opera beta version
      • Opera USB

      Mobile browsers

      • Opera for Android
      • Opera Mini
      • Opera Touch
      • Opera for basic phones

      • Add-ons
      • Opera account
      • Wallpapers
      • Opera Ads

      • Help & support
      • Opera blogs
      • Opera forums
      • Dev.Opera

      • Security
      • Privacy
      • Cookies Policy
      • EULA
      • Terms of Service

      • About Opera
      • Press info
      • Jobs
      • Investors
      • Become a partner
      • Contact us

      Follow Opera

      • Opera - Facebook
      • Opera - Twitter
      • Opera - YouTube
      • Opera - LinkedIn
      • Opera - Instagram

      © Opera Software 1995-