If you donβt need to be beautiful, and you can do something slightly hacked, this should forcibly untie every click listener associated with this element:
var el = document.querySelector('a[rel]'); el.onclick = function() {}; el.addEventListener = function() {};
or for each item:
Array.prototype.slice.call(document.querySelectorAll('a[rel]')).forEach(function(el) { el.onclick = function() {}; el.addEventListener = function() {}; });
EDIT: Perhaps you can do something even uglier and have a script content for "document_start" and do:
Element.prototype.addEventListener = (function() { var real = Element.prototype.addEventListener; return function(ev) { if (ev === 'click' && this.tagName === 'A' && this.hasAttribute('rel')) { console.log('try again, jquery!'); } else { return real.apply(this, arguments); } }; })();
source share