toolkit/content/editMenuOverlay.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 // -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     3 /* This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 // update menu items that rely on focus or on the current selection
     8 function goUpdateGlobalEditMenuItems()
     9 {
    10   // Don't bother updating the edit commands if they aren't visible in any way
    11   // (i.e. the Edit menu isn't open, nor is the context menu open, nor have the
    12   // cut, copy, and paste buttons been added to the toolbars) for performance.
    13   // This only works in applications/on platforms that set the gEditUIVisible
    14   // flag, so we check to see if that flag is defined before using it.
    15   if (typeof gEditUIVisible != "undefined" && !gEditUIVisible)
    16     return;
    18   goUpdateCommand("cmd_undo");
    19   goUpdateCommand("cmd_redo");
    20   goUpdateCommand("cmd_cut");
    21   goUpdateCommand("cmd_copy");
    22   goUpdateCommand("cmd_paste");
    23   goUpdateCommand("cmd_selectAll");
    24   goUpdateCommand("cmd_delete");
    25   goUpdateCommand("cmd_switchTextDirection");
    26 }
    28 // update menu items that relate to undo/redo
    29 function goUpdateUndoEditMenuItems()
    30 {
    31   goUpdateCommand("cmd_undo");
    32   goUpdateCommand("cmd_redo");
    33 }
    35 // update menu items that depend on clipboard contents
    36 function goUpdatePasteMenuItems()
    37 {
    38   goUpdateCommand("cmd_paste");
    39 }

mercurial