function addContextMenuTo(selector) {
    selector = selector + ', ' + selector + ' *';
    var matches;
    ['matches', 'webkitMatchesSelector', 'webkitMatches', 'matchesSelector'].some(function(m) {
        if (m in document.documentElement) {
            matches = m;
            return true;
        }
    });

    var isHovering = false;
    document.addEventListener('mouseover', function(event) {
        if (event.target && event.target[matches](selector)) {
            for (var i = 0; i < event.path.length; i++) {
                var element = event.path[i];
                if (element[matches] && element[matches]('a')) {
                    createContextMenu(element.href);
                    isHovering = true;
                    break;
                }
            }
        } else if (isHovering) {
            isHovering = false;
        }
    });
    document.addEventListener('mouseout', function(event) {
        if (isHovering && (!event.target || !event.target[matches](selector))) {
            isHovering = false;
        }
    });
}

function createContextMenu(linkUrl) {
    if (linkUrl && linkUrl.match('^//.*$')) {
        var tabUrl = window.location.href;
        var patternMatch = tabUrl.match('^(https|http)://(.+)/.*$');
        if (patternMatch) {
            chrome.runtime.sendMessage({action: 'createContextMenu', link: patternMatch[1] + ':' + linkUrl}, function (response) {});
        } else {
            console.log("Could not determine what to do with link: " + linkUrl);
        }
    } else if (linkUrl && linkUrl.match('^/.*$')) {
        var tabUrl = window.location.href;
        var patternMatch = tabUrl.match('^(https|http)://([^/]+)/.*$');
        if (patternMatch) {
            chrome.runtime.sendMessage({action: 'createContextMenu', link: patternMatch[1] + '://' + patternMatch[2] + linkUrl}, function (response) {});
        } else {
            console.log("Could not determine what to do with link: " + linkUrl);
        }
    } else if (linkUrl && (linkUrl.match('^(https|http|acestream|sop)://.+$') || linkUrl.match('^(http|https)://.*\.(torrent|torrent\?.+)$'))) {
        chrome.runtime.sendMessage({action: 'createContextMenu', link: linkUrl}, function (response) {});
    } else if (!linkUrl || linkUrl.trim() == ''
        || (linkUrl && (linkUrl.indexOf('#') == 0
        || linkUrl.indexOf('mailto') == 0
        || linkUrl.indexOf('javascript') == 0
        || linkUrl.indexOf('irc') == 0))) {
        //Do nothing to these links.
    } else {
        console.log("Could not determine what to do with link: " + linkUrl);
    }
}

addContextMenuTo('a');

$(document).ready(function() {
    for (var i = 0; i < allModules.length; i++) {
        var module = allModules[i];
        if (module.createCustomContextMenus) {
            module.createCustomContextMenus();
        }
    }
});

@@ -456,24 +456,58 @@
 elector)) %7B%0A
+            if (event.path) %7B%0A    
             
@@ -544,32 +544,36 @@
 .length; i++) %7B%0A
+    
                 
@@ -613,24 +613,28 @@
             
+    
 if (element%5B
@@ -690,16 +690,20 @@
         
+    
 createCo
@@ -739,32 +739,36 @@
                 
+  
+  
 isHovering = tru
@@ -794,15 +794,41 @@
     
+    
 break;%0A
+                    %7D%0A
     

Use even.path only if defined (Fixes #4).