resources/content/browserOverlay.xul
author seabld
Fri, 31 Jan 2014 07:57:55 -0800
branchSEA2_24_RELBRANCH
changeset 1719 c7d83324b1af3f68d51b9d4f8a9817bfb2e9d7f1
parent 1393 6c425834882f309109d669b399b262770f855e4b
permissions -rw-r--r--
Added tag SEAMONKEY_2_24b1_BUILD2 for changeset 87599cab4bd2. CLOSED TREE a=release

<?xml version="1.0"?> 
<!-- This Source Code Form is subject to the terms of the Mozilla Public
   - License, v. 2.0. If a copy of the MPL was not distributed with this
   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->


<!DOCTYPE overlay SYSTEM "chrome://inspector/locale/tasksOverlay.dtd" >

<overlay id="ovBrowser"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

  <script type="application/javascript" src="chrome://inspector/content/hooks.js"/>
  
  <script type="application/javascript"><![CDATA[
  
  window.addEventListener("load", inspectorNavOnLoad, true);
  
  function inspectorNavOnLoad()
  {
    var prefService = Components.classes["@mozilla.org/preferences-service;1"]
                                .getService(Components.interfaces.nsIPrefService);
    var pref = prefService.getBranch(null);

    var enabled = pref.getBoolPref("inspector.hooks.navigator");
    if (!enabled) {
      document.getElementById("context-inspect").setAttribute("hidden", "true");
      document.getElementById("menu_inspectPage").setAttribute("hidden", "true");
    } else {
      var popup = document.getElementById("contentAreaContextMenu");
      popup.addEventListener("popupshowing", inspectorContextCreate, false);
    }
  }
  
  function inspectorContextCreate()
  {
    var mi = document.getElementById("context-inspect");
    mi.setAttribute("label", "Inspect <"+inspectorGetContextNode().localName+">");
  }
  
  function inspectPopupNode()
  {
    inspectDOMNode(inspectorGetContextNode());
  }
  
  function inspectorGetContextNode()
  {
    var n = document.popupNode;
    while (n && n.nodeType != Node.ELEMENT_NODE)
      n = n.parentNode;
  
    return n;
  }
  
  ]]></script>
  
  <popup id="contentAreaContextMenu">
    <menuitem id="context-inspect"
              insertbefore="context-sep-view"
              oncommand="inspectPopupNode();"/>
  </popup>

  <menupopup id="menu_FilePopup">
    <menuitem id="menu_inspectPage" label="&inspectPageTaskCmd.label;" command="Tasks:InspectPage" 
              accesskey="&inspectPageTaskCmd.accesskey;" key="key_inspectPage" 
              insertbefore="menu_sendPage"/>
  </menupopup>

</overlay>