This file is indexed.

/usr/share/xul-ext/adblock-plus-element-hiding-helper/lib/inspectorObserver.js is in xul-ext-adblock-plus-element-hiding-helper 1.3-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
 * This Source Code is subject to the terms of the Mozilla Public License
 * version 2.0 (the "License"). You can obtain a copy of the License at
 * http://mozilla.org/MPL/2.0/.
 */

let InspectorObserver =
{
  init: function()
  {
    let gDevTools;
    try
    {
      ({gDevTools}) = Cu.import("resource:///modules/devtools/gDevTools.jsm", null);
    }
    catch(e)
    {
      // No developer tools or unsupported version - ignore.
      return;
    }

    gDevTools.on("inspector-ready", this.inspectorReady);
    onShutdown.add(function()
    {
      gDevTools.off("inspector-ready", this.inspectorReady);
    }.bind(this));
  },

  get inspectorButtonTooltip()
  {
    // Randomize URI to work around bug 719376
    let stringBundle = Services.strings.createBundle("chrome://elemhidehelper/locale/global.properties?" + Math.random());
    let result = stringBundle.GetStringFromName("inspector.button.tooltiptext");

    delete this.inspectorButtonTooltip;
    this.__defineGetter__("inspectorButtonTooltip", function() result);
    return this.inspectorButtonTooltip;
  },

  inspectorReady: function(eventName, toolbox, panel)
  {
    let panelWindow = panel.panelWin;
    let inspectBtn = panelWindow.document.getElementById("inspector-breadcrumbs");
    if (!inspectBtn)
      return;

    let tooltiptext = InspectorObserver.inspectorButtonTooltip;
    button = panelWindow.document.createElement("toolbarbutton");
    button.setAttribute("id", "ehh-inspector-toolbarbutton");
    button.setAttribute("class", "devtools-toolbarbutton");
    button.setAttribute("tooltiptext", tooltiptext);
    button.setAttribute("tabindex", "0");
    button.addEventListener("command", function()
    {
      panelWindow.openDialog("chrome://elemhidehelper/content/composer.xul", "_blank",
                             "chrome,centerscreen,resizable,dialog=no", panel.selection.node);
    }, false);
    
    //Override button style for light DevTools theme
    let style = panelWindow.document.createProcessingInstruction("xml-stylesheet", 'href="chrome://elemhidehelper/skin/devToolsOverlay.css" type="text/css"');
    panelWindow.document.insertBefore(style, panelWindow.document.firstChild);
    
    inspectBtn.parentNode.insertBefore(button, inspectBtn);
  }
};

InspectorObserver.init();