我是中国网民。Google/Yahoo 搜索引擎在我国非常不稳定。
当我单击雅虎搜索结果链接时,我经常会收到此错误页面:
ERROR
The requested URL could not be retrieved
While trying to retrieve the URL: http://search.yahoo.com/r/_ylt=A0oGdUY7FbNQFQsA5rZXNyoA;_ylu=X3oDMTE0ODJ2YTduBHNlYwNzcgRwb3MDMQRjb2xvA3NrMQR2dGlkA1ZJUDA1MV83Ng--/SIG=11ac0sa5q/EXP=1353942459/**http%3a//www.google.com/
The following error was encountered:
Access Denied.
Access control configuration prevents your request from being allowed at this time. Please contact your service provider if you feel this is incorrect.
Your cache administrator is noc_admin@163.com.
by DXT-GZ-APP02
我注意到,当我单击链接时,雅虎会自动href
更改的值。
我尝试,但它不起作用。
如何阻止雅虎这样做?dirtyhref
$('a[id|=link]').unbind('click mousedown')
目前,我使用这个Firefox的greasemonkey代码:
// ==UserScript==
// @name Clean URL
// @namespace http://hjkl.me
// @include https://www.google.com/search*
// @include http://search.yahoo.com/search*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js
// @version 1
// ==/UserScript==
// GOOGLE
$('h3.r>a').removeAttr('onmousedown');
// YAHOO
$('a[id|=link]').on('click', function(){
var url = $(this).attr('dirtyhref').split('**')[1];
url = decodeURIComponent(url);
$(this).attr('href', url); //<-- yahoo will change it back!
window.open(url, '_blank');
return false;
});
问题是:我不能使用鼠标中键功能。(默默打开标签页)