testing with google miscell project

A alert.js is include and the user.js should prevent it from running.

 

// ==UserScript==
// @id             5008e85f-e821-414f-b82a-4fd4c76d5485
// @name           testcase
// @include        http://www.cnblogs.com/*
// @run-at         document-start
// ==/UserScript==
document.addEventListener('beforescriptexecute',
function(e){
	if(e.target.src.indexOf('alert.js') != -1){
		e.preventDefault();
		document.removeEventListener(e.type,arguments.callee,0);
	}
},false);

 

It does but not when it was open in a target = _blank link like below:

click me

posted on 2012-03-04 16:42  dindog  阅读(179)  评论(0编辑  收藏  举报

导航