diff --git a/xpfe/communicator/resources/content/contentAreaClick.js b/xpfe/communicator/resources/content/contentAreaClick.js
index ebd9d9fce2fd..08a39d0a60c4 100644
--- a/xpfe/communicator/resources/content/contentAreaClick.js
+++ b/xpfe/communicator/resources/content/contentAreaClick.js
@@ -134,7 +134,8 @@
prefillTextBox(target); // prefill the empty text field if possible
}
else {
- linkNode = findParentNode(event.originalTarget, "a");
+ while (linkNode && !(linkNode instanceof HTMLAnchorElement))
+ linkNode = linkNode.parentNode;
// cannot be nested. So if we find an anchor without an
// href, there is no useful around the target
if (linkNode && !linkNode.hasAttribute("href"))
@@ -186,7 +187,6 @@
if (pref && !isKeyPress && event.button == 1 &&
!event.getPreventDefault() &&
- !findParentNode(event.originalTarget, "scrollbar") &&
pref.getBoolPref("middlemouse.contentLoadURL")) {
if (middleMousePaste(event)) {
event.preventBubble();
diff --git a/xpfe/communicator/resources/content/contentAreaUtils.js b/xpfe/communicator/resources/content/contentAreaUtils.js
index 4c428765d184..dbf9c612e861 100644
--- a/xpfe/communicator/resources/content/contentAreaUtils.js
+++ b/xpfe/communicator/resources/content/contentAreaUtils.js
@@ -178,29 +178,6 @@ function openNewTabWith(url, sendReferrer, reverseBackgroundPref)
}
}
-function findParentNode(node, parentNode)
-{
- if (node && node.nodeType == Node.TEXT_NODE) {
- node = node.parentNode;
- }
- while (node) {
- if (node.nodeType == Node.DOCUMENT_NODE) {
- return null;
- }
- var nodeName = node.localName;
- if (!nodeName)
- return null;
- nodeName = nodeName.toLowerCase();
- if (nodeName == "body" || nodeName == "html") {
- return null;
- }
- if (nodeName == parentNode)
- return node;
- node = node.parentNode;
- }
- return null;
-}
-
// Clientelle: (Make sure you don't break any of these)
// - File -> Save Page/Frame As...
// - Context -> Save Page/Frame As...