Created
January 2, 2011 18:22
-
-
Save nmaier/762712 to your computer and use it in GitHub Desktop.
Complete but untested solution incl. the signature replication
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
let _old = XULBrowserWindow.setOverLink; | |
try { | |
if (Services.vc.compare(Services.appinfo.platformVersion, '2.0.*') < 0) { | |
// moz 2.0 | |
XULBrowserWindow.setOverLink = function(url, anchorElt) { | |
try { | |
if (NOReferrerToNOReferrerFrom.shouldDispatchOverLink) { | |
NOReferrerToNOReferrerFrom.dispatchEvent("onOverLink", url); | |
} | |
} | |
catch (ex) { /* no op; log or something */} | |
return _old.apply(XULBrowserWindow, arguments); | |
}; | |
} | |
else /* if */{ | |
// newer; future | |
} | |
} | |
catch (ex) { | |
// pre moz-2.0 | |
XULBrowserWindow.setOverLink = function(link, b) { | |
try { | |
if (NOReferrerToNOReferrerFrom.shouldDispatchOverLink) { | |
NOReferrerToNOReferrerFrom.dispatchEvent("onOverLink", link); | |
} | |
} | |
catch (ex) { /* no op; log or something */} | |
return _old.apply(XULBrowserWindow, arguments); | |
}; | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment