我是中國互聯網用戶。 Google/Yahoo搜索引擎在我的國家非常不穩定。
當我點擊雅虎搜索結果的鏈接,我經常會收到這樣的錯誤頁面:如何在單擊鏈接時將「href」更改爲「dirtyhref」?
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 [email protected]
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;
});
的問題是:我不能使用鼠標中鍵單擊功能。 (無聲打開tabpage)
改回手動? –
當我將它改回去時,雅虎將會再次改變它。 – kev
您是否在單獨的窗口(無導航)或搜索窗口中打開鏈接(在導航回時更改)? –