webview阻止打开新页面

admin2022-01-06  4.2K+

var 阻止打开新页面 = /** 
window.addEventListener('load',()=>{
	document.body.addEventListener('click', function (e) {
    	for (const el of e.path) {
        	if (el.tagName == "A") {
            	e.preventDefault();
            	return window.location.href = el.href;
        	}
    	}
	})
})
window.open = href => window.location.href = href;
**/
wb.preloadScript(阻止打开新页面);
转载请注明原文地址: http://www.aardio.net/read-291.html
最新回复(0)
aardio问答
aardio编程语言