如果它不需要是漂亮,你沒事處事稍微砍狀,這應該強行解除綁定綁定到該元素每次點擊收聽:
var el = document.querySelector('a[rel]');
el.onclick = function() {};
el.addEventListener = function() {};
或每一個元素:
Array.prototype.slice.call(document.querySelectorAll('a[rel]')).forEach(function(el) {
el.onclick = function() {};
el.addEventListener = function() {};
});
編輯:也許你可以做一些事情,甚至醜陋的和有內容腳本在「document_start」運行,並做到:
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);
}
};
})();
您的分機可以注入一個腳本到它,你需要什麼網頁? – Pointy 2011-04-03 16:34:57
尖尖的,我可以,但比我需要一個外部腳本保存在互聯網上的某個地方。我希望它只是'.crx' ... – Rudie 2011-04-21 19:06:31