tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

index.rst (8800B)


      1 ======================
      2 Responsive Design Mode
      3 ======================
      4 
      5 `Responsive design <https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Responsive/responsive_design_building_blocks>`_ is the practice of designing a website so it looks and works properly on a range of different devices — particularly mobile phones and tablets as well as desktops and laptops.
      6 
      7 The most obvious factor here is screen size, but there are other factors as well, including the pixel density of the display and whether it supports touch. Responsive Design Mode gives you a simple way to simulate these factors, to test how your website will look and behave on different devices.
      8 
      9 
     10 Toggling Responsive Design Mode
     11 *******************************
     12 
     13 There are three ways to toggle Responsive Design Mode:
     14 
     15 
     16 - From the Firefox menu: Select **Responsive Design Mode** from the **Browser Tools** submenu in the Firefox Menu (or **Tools** menu if you display the menu bar or are on macOS).
     17 - From the Developer Tools toolbox: Press the **Responsive Design Mode** button in the :ref:`Toolbox's toolbar <tools-toolbox-toolbar>`
     18 - From the keyboard: Press :kbd:`Ctrl` + :kbd:`Shift` + :kbd:`M` (or :kbd:`Cmd` + :kbd:`Opt` + :kbd:`M` on macOS).
     19 
     20 
     21 Controlling Responsive Design Mode
     22 **********************************
     23 
     24 With Responsive Design Mode enabled, the content area for web pages is set to the screen size for a mobile device. Initially, it's set to 320 x 480 pixels.
     25 
     26 .. note::
     27 
     28  The device you select when in Responsive Design Mode and the orientation (portrait or landscape) is saved between sessions.
     29 
     30 .. image:: responsive_ui.png
     31  :class: center
     32 
     33 Information for the selected device is centered over the display. From left to right, the display includes:
     34 
     35 
     36 - *Name of the selected device* - A drop-down list that includes whatever devices you have selected from the Device Settings screen.
     37 - *Screen size* - You can edit the width and height values to change the device size by editing a number directly or using the :kbd:`Up` and :kbd:`Down` keys to increase or decrease the value by 1 pixels on each keypress or hold and :kbd:`Shift` to change the value by 10.
     38 
     39  - The mouse wheel changes the size values by 1 pixel at a time
     40  - You can also change the device's screen size by grabbing the bottom-right corner of the viewport and dragging it to the size you want.
     41 
     42 
     43 - *Orientation (portrait or landscape)* - This setting persists between sessions
     44 - *DPR (pixel ratio)* - To set a specific DPR, you need to create a custom device
     45 - *Throttling* - A drop-down list where you can select the connection throttling to apply, for example 2G, 3G, or LTE
     46 - *Enable/Disable touch simulation* - Toggles whether or not Responsive Design Mode simulates touch events. While touch event simulation is enabled, mouse events are translated into `touch events <https://developer.mozilla.org/en-US/docs/Web/API/Touch_events>`_; this includes translating a mouse-drag event into a touch-drag event. (Note that when touch simulation is enabled, this toolbar icon is blue; when simulation is disabled, it is black).
     47 
     48 
     49 On the right end of the screen, three buttons allow you to:
     50 
     51 
     52 .. _responsive-design-mode-camera-button:
     53 
     54 - *Camera button* - take a screenshot
     55 
     56  - Screenshots are saved to Firefox's default download location.
     57  - If you checked "Screenshot to clipboard" in the Developer Tools :doc:`Settings <../settings/index>` page, then the screenshot will be copied to the system clipboard.
     58 
     59 - *Settings button* - Opens the RDM settings menu
     60 - *Close button* - closes RDM mode and returns to regular browsing
     61 
     62 
     63 The Settings menu includes the following commands:
     64 
     65 .. image:: responsive_setting_menu.png
     66  :class: center
     67 
     68 - *Left-align Viewport* - when checked moves the RDM viewport to the left side of the browser window
     69 - *Show user agent* - when checked displays the user agent string
     70 - The final two options define when the page is reloaded:
     71 
     72  - *Reload when touch simulation is toggled:* when this option is enabled, the page is reloaded whenever you toggle touch support.
     73  - *Reload when user agent is changed:* when this option is enabled, the page is reloaded whenever the user agent is changed.
     74 
     75 
     76 Reloading on these changes can be helpful because certain page behaviors would otherwise not be applied. For example, many pages check for touch support on load and only add event handlers if it is supported, or only enable certain features on certain browsers.
     77 
     78 However, if you are not interested in examining such features (maybe you are just checking the overall layout at different sizes), these reloads can waste time and possibly result in the loss of productive work, so it is useful to be able to control these reloads.
     79 
     80 Now when you change such settings for the first time, you are given a warning message that tells you these reloads are no longer automatic, and informed about how you can make them automatic. For example:
     81 
     82 
     83 .. image:: page-reload-warning.png
     84  :class: center
     85 
     86 
     87 Developer Toolbox with RDM
     88 **************************
     89 
     90 You can show or hide the Developer Tools toolbox independently of toggling Responsive Design Mode itself:
     91 
     92 .. image:: rdmdevtools.png
     93  :class: center
     94 
     95 While Responsive Design Mode is enabled, you can continue browsing as you normally would in the resized content area.
     96 
     97 
     98 Device selection
     99 ****************
    100 
    101 Just above the viewport there is a label "no device selected"; click this to see a list of device names. Select a device, and Responsive Design Mode sets the following properties to match the selected device:
    102 
    103 
    104 - Screen size
    105 - Device pixel ratio (the ratio of device physical pixels to device-independent pixels)
    106 - Touch event simulation
    107 
    108 
    109 Additionally, Firefox sets the `User-Agent <https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/User-Agent>`_ HTTP request header to identify itself as the default browser on the selected device. For example, if you've selected an iPhone, then Firefox identifies itself as Safari. The `navigator.userAgent <https://developer.mozilla.org/en-US/docs/Web/API/Navigator/userAgent>`_ property is set to the same value.
    110 
    111 .. raw:: html
    112 
    113  <iframe width="560" height="315" src="https://www.youtube.com/embed/JNAyKemudv0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
    114  <br/>
    115  <br/>
    116 
    117 
    118 The devices listed in the drop-down are just a subset of the devices that can be selected. At the end of the drop-down, there is an item labeled **Edit list**. Select this to see a panel containing all the choices, which enables you to check the devices you want to see in the drop-down.
    119 
    120 
    121 Creating custom devices
    122 -----------------------
    123 
    124 You can create and save custom devices in Responsive Design Mode by clicking the **Add Custom Device** button. Each device can have its own:
    125 
    126 
    127 - Name
    128 - Size
    129 - DevicePixelRatio
    130 - User Agent String
    131 - Touch Screen
    132 
    133 
    134 Also, you can preview the properties of existing devices by hovering over the name in the device modal, where they display in a tooltip.
    135 
    136 .. raw:: html
    137 
    138  <iframe width="560" height="315" src="https://www.youtube.com/embed/SA0RlGtOCmE" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
    139  <br/>
    140  <br/>
    141 
    142 Network throttling
    143 ******************
    144 
    145 If you do all your development and testing using a very fast network connection, users may experience problems with your site if they are using a slower connection. In Responsive Design Mode, you can instruct the browser to emulate, very approximately, the characteristics of various different types of networks.
    146 
    147 The characteristics emulated are:
    148 
    149 - Download speed
    150 - Upload speed
    151 - Minimum latency
    152 
    153 
    154 The table below lists the numbers associated with each network type, but please do not rely on this feature for exact performance measurements; it's intended to give an approximate idea of the user experience in different conditions.
    155 
    156 .. list-table::
    157  :widths: 25 25 25 25
    158  :header-rows: 1
    159 
    160  * - Selection
    161    - Download speed
    162    - Upload speed
    163    - Minimum latency (ms)
    164 
    165  * - GPRS
    166    - 50 Kb/s
    167    - 20 Kb/s
    168    - 500
    169 
    170  * - Regular 2G
    171    - 250 Kb/s
    172    - 50 Kb/s
    173    - 300
    174 
    175  * - Good 2G
    176    - 450 Kb/s
    177    - 150 Kb/s
    178    - 150
    179 
    180  * - Regular 3G
    181    - 750 Kb/s
    182    - 250 Kb/s
    183    - 100
    184 
    185  * - Good 3G
    186    - 1.5 Mb/s
    187    - 750 Kb/s
    188    - 40
    189 
    190  * - Regular 4G/LTE
    191    - 4 Mb/s
    192    - 3 Mb/s
    193    - 20
    194 
    195  * - DSL
    196    - 2 Mb/s
    197    - 1 Mb/s
    198    - 5
    199 
    200  * - Wi-Fi
    201    - 30 Mb/s
    202    - 15 Mb/s
    203    - 2
    204 
    205  * - Offline
    206    - 0 Mb/s
    207    - 0 Mb/s
    208    - 5
    209 
    210 To select a network, click the list box that's initially labeled "No throttling":
    211 
    212 .. image:: rdm_throttling.png
    213  :class: center