tor-browser

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

ui.js (1573B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 "use strict";
      6 
      7 const {
      8  CHANGE_DISPLAY_PIXEL_RATIO,
      9  CHANGE_USER_AGENT,
     10  TOGGLE_LEFT_ALIGNMENT,
     11  TOGGLE_RELOAD_ON_TOUCH_SIMULATION,
     12  TOGGLE_RELOAD_ON_USER_AGENT,
     13  TOGGLE_TOUCH_SIMULATION,
     14  TOGGLE_USER_AGENT_INPUT,
     15 } = require("resource://devtools/client/responsive/actions/index.js");
     16 
     17 module.exports = {
     18  /**
     19   * The pixel ratio of the display has changed. This may be triggered by the user
     20   * when changing the monitor resolution, or when the window is dragged to a different
     21   * display with a different pixel ratio.
     22   */
     23  changeDisplayPixelRatio(displayPixelRatio) {
     24    return {
     25      type: CHANGE_DISPLAY_PIXEL_RATIO,
     26      displayPixelRatio,
     27    };
     28  },
     29 
     30  changeUserAgent(userAgent) {
     31    return {
     32      type: CHANGE_USER_AGENT,
     33      userAgent,
     34    };
     35  },
     36 
     37  toggleLeftAlignment(enabled) {
     38    return {
     39      type: TOGGLE_LEFT_ALIGNMENT,
     40      enabled,
     41    };
     42  },
     43 
     44  toggleReloadOnTouchSimulation(enabled) {
     45    return {
     46      type: TOGGLE_RELOAD_ON_TOUCH_SIMULATION,
     47      enabled,
     48    };
     49  },
     50 
     51  toggleReloadOnUserAgent(enabled) {
     52    return {
     53      type: TOGGLE_RELOAD_ON_USER_AGENT,
     54      enabled,
     55    };
     56  },
     57 
     58  toggleTouchSimulation(enabled) {
     59    return {
     60      type: TOGGLE_TOUCH_SIMULATION,
     61      enabled,
     62    };
     63  },
     64 
     65  toggleUserAgentInput(enabled) {
     66    return {
     67      type: TOGGLE_USER_AGENT_INPUT,
     68      enabled,
     69    };
     70  },
     71 };