Urgent.News

What's breaking now, across thousands of outlets.

Tech

Firefox Responsive Design Mode: DPR, Touch Simulation, Network Throttling, and Device Presets

Firefox's Responsive Design Mode (RDM) is a powerful tool for testing websites across different screen sizes, device types, and network conditions. It goes beyond Chrome's DevTools device mode in several ways. This guide covers everything you can do in RDM. Opening Responsive Design Mode Three ways to open RDM: Keyboard : Ctrl+Shift+M (Windows/Linux) or Cmd+Shift+M (Mac) DevTools : F12 →…

Firefox's Responsive Design Mode (RDM) is a robust tool for testing websites on various screen sizes, devices, and network conditions. It offers more functionality than Chrome's DevTools device mode. To open RDM, press Ctrl+Shift+M on Windows/Linux or Cmd+Shift+M on Mac. Alternatively, you can use the DevTools F12 interface and select the responsive icon or right-click on the page, choose Inspect, and switch to responsive view. Upon opening, a resizable viewport appears, along with simulation tools in the toolbar.

Resizing the viewport is done by dragging the edges, while the dimensions are shown at the top in real-time. Manual entry is possible by clicking the display and entering exact pixel values. Rotating the viewport swaps width and height, simulating landscape and portrait orientations. The device dropdown supplies presets for typical devices, such as iPhone SE, 12, 14 Pro Max, iPad, iPad Pro, Samsung Galaxy, Pixel, and Kindle Fire.

Each preset automatically sets width, height, device pixel ratio, and user agent. You can also create custom device presets by clicking Edit list... and adding a custom preset with your own dimensions and DPR.

Touch simulation allows you to test touch-specific code paths by converting mouse clicks into touchstart/touchend events and activating dragging. This enables JavaScript's window.ontouchstart to return true. The User Agent (UA) string can be set directly in the toolbar, allowing you to test UA-sniffing code that serves different content to mobile browsers. However, UA sniffing is discouraged in favor of feature detection.

The DPR button enables simulation of high-DPI screens by switching between 1x, 2x, and 3x ratios. Images served via srcset with 2x descriptors will load the 2x version when DPR 2x is enabled. Network throttling simulates slow connections, including Good 3G (~750 Kbps), Regular 3G (~250 Kbps), and Poor 2G. These presets apply to all network requests from the RDM viewport.

Screenshot capture captures a screen of the entire viewport at current dimensions, matching the pixel dimensions (DPR affects the resolution of the captured image).

RDM can be used alongside DevTools, with DevTools panels running on the RDM viewport. This allows you to test how your site performs on simulated mobile conditions using network throttling and the Performance panel. Common testing workflows involve opening RDM, setting device presets, enabling touch simulation, and adjusting network throttling.

Keep in mind that RDM has limitations, such as not simulating fonts, native input elements, vibration API, device sensors, or actual performance. For final mobile testing, always test on a real device or a device emulator.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Optimize init.lua untuk Neovim 0.13: dari 470ms ke 130ms

Optimize init.lua untuk Neovim 0.13: dari 470ms ke 130ms Neovim sekarang di 0.13 (development). Kalau korang masih guna config lama (0.12 atau sebelumnya), ada beberapa benda 0.13 yang patut diambil…

  • Startup time reduced from 470ms to 130ms in Neovim 0.13
  • Optimized init.lua with native pack, LSP configuration, and bytecode caching
  • Loaded 15+ plugins, configured nvim-cmp autocompletion, and LSP API

Understanding Flask Environment, Security, and Error Handling

Understanding Flask Environment, Security, and Error Handling 🚀 _**When building a Flask application, separating Development (your local machine) from Production (the live server like Render) is one…

  • Environment variables securely manage sensitive configurations in Flask apps.
  • Debug mode varies between local development and production environments.
  • Flask error handling distinguishes between developer logs and user-facing messages.

WooCommerce Order Updates on WhatsApp: 6 Bugs I’d Watch For

Sending a WhatsApp message when a WooCommerce order changes status sounds like a 10-line job. In production, these six problems show up first.

  • Six potential bugs affect WooCommerce order updates on WhatsApp
  • Offload WhatsApp API task to Action Scheduler to improve performance
  • Normalize phone numbers and include opt-in checkbox to comply with regulations

Firefox DOM Inspector: CSS Rules, Grid/Flexbox, Accessibility, Fonts, and Event Listeners

Firefox's DOM Inspector (the Inspector tab in DevTools) is one of the most powerful tools for understanding and debugging web pages.

  • Firefox DOM Inspector accessible via DevTools for web page analysis
  • Inspector displays HTML structure on left, CSS rules on right with keyboard navigation
  • Accessibility panel reveals accessibility tree and checks for contrast, focus issues

More from Friday 16 October →