阅读:5621回复:15
求个去除“谷歌图片”搜索重定向的脚本
最好是兼容ipv6的!先谢谢咯!!!
![]() |
|
1楼#
发布于:2014-07-02 11:37
|
|
2楼#
发布于:2014-07-02 13:01
http://userscripts.org:8080/scripts/show/78355更好,楼上那个对文字有用,对图好像我这里不行
|
|
|
3楼#
发布于:2014-07-02 13:13
|
|
5楼#
发布于:2014-07-02 13:35
asdfcc:借帖问一下,Google Images direct link和GoogleMonkeyR合用的时候,只能解码前几张图片(也就是原本在第一页的),后面的都无效,有办法解决吗?@hzzhaiqi 看能不能写个支持自动翻页的版本出来 |
|
6楼#
发布于:2014-07-02 23:03
文科:@hzzhaiqi 看能不能写个支持自动翻页的版本出来回到原帖粗略看了下,脚本自身支持自动翻页。 @asdfcc 我修正了下。https://github.com/ywzhaiqi/userscript/blob/master/.%E4%BF%AE%E6%94%B9%E7%89%88/Google%20Images%20direct%20link.user.js PS:脚本自身已经支持自动翻页,但作者未将相似图片搜索支持自动翻页,可能是因为该方法会随着翻页页数的增加造成工作量的增加。 |
|
7楼#
发布于:2014-07-02 23:43
hzzhaiqi:粗略看了下,脚本自身支持自动翻页。嗯 我试试看 |
|
8楼#
发布于:2014-07-03 12:03
感谢Y大出手,不过我这儿试了下还是没生效,和之前的情况一样
![]() |
|
9楼#
发布于:2014-07-03 12:23
|
|
|
10楼#
发布于:2014-07-04 10:25
// ==UserScript==
// @name Google Images direct links // @author Dwoo // @version 2014.1.31 // @namespace http://userscripts.org/scripts/show/48293 // @updateURL https://userscripts.org/scripts/source/48293.meta.js // @download http://userscripts.org/scripts/source/48293.user.js // @description Makes images link directly to the original in Google Images search. The source website link is moved to the white URL at the bottom of the image. Also gives the option to always use the basic (old) version of Google Images. // @include http*://*.google.*/ // @include http*://*.google.*/#* // @include http*://*.google.*/search* // @include http*://*.google.*/webhp* // @include http*://*.google.*/img* // @include http*://*.google.*/images* // @include http*://images.google.* // ==/UserScript== (function () { function cleanClick(e) { var a = e.target, url; if ((a.tagName === 'A' || (a.tagName === 'IMG' && (a = a.parentNode) && a.tagName === 'A')) && (url = a.href.match(/imgurl=([^&]+)/))) { a.href = decodeURIComponent(decodeURIComponent(url[1])); } } function removeTail(e) { var a = e.target; if ((a.tagName === 'A' || (a.tagName === 'IMG' && (a = a.parentNode) && a.tagName === 'A')) && (/iact=/).test(a.href)) { a.href = a.href.replace(/.iact=.*/, ''); } } function cleanPopUp(e) { if (e.target.parentNode.id !== 'rg_haln') { return; } var img = document.getElementById('rg_hl'); try { var site = document.getElementById('rg_hr'); var a = document.createElement('a'); a.innerHTML = site.innerHTML; a.setAttribute('style', 'text-decoration: inherit; color: inherit;'); if ((/newwindow=1/).test(document.location.href)) { a.setAttribute('target', '_blank'); } a.setAttribute('href', decodeURIComponent(decodeURIComponent(img.href.match(/imgrefurl=([^&]+)/)[1]))); site.replaceChild(a, site.firstChild); } catch (e) {} var name = document.getElementById('rg_hta'); name.href = img.href = decodeURIComponent(decodeURIComponent(img.href.match(/imgurl=([^&]+)/)[1])); } function fixLinks() { try { var images = document.getElementById('rg_s').getElementsByClassName('rg_di'); for (var i in images) { try { var image = images; if (image.classList.contains('done')) { continue; } image.classList.add('done'); var img = image.getElementsByTagName('img')[0]; img.addEventListener('click', function(e){if(!e.ctrlKey){e.stopPropagation();}}); var a = img.parentNode; var span = image.getElementsByTagName('span')[0]; span.innerHTML = span.innerHTML.replace(/ - (.*)/, ' - <a href="'+decodeURIComponent(decodeURIComponent(a.href.match(/imgrefurl=([^&]+)/)[1]))+'" style="color: inherit;"'+((/newwindow=1/).test(document.location.href)?' target="_blank"':'')+'>$1</a>'); span.getElementsByTagName('a')[0].addEventListener("click", function(e){if(!e.ctrlKey){e.stopPropagation();}}); } catch (e) { continue; } } } catch (e) {} } function checkNew(e) { if (e.target.id && e.target.id.startsWith('page')) { fixLinks(); } } if ((/\/imgres\?/).test(document.location.href)) { window.location.replace(decodeURIComponent(location.search.match(/imgurl=([^&]+)&/)[1])); } else { document.addEventListener('click', cleanClick); document.addEventListener('mouseup', removeTail); document.addEventListener('DOMNodeInserted', cleanPopUp); document.addEventListener('DOMNodeInserted', checkNew); fixLinks(); } })(); |
|
|
11楼#
发布于:2014-07-04 12:23
LS这个试过也不行,连第一页都解不出来。
能麻烦Y大再看看么?之前那个修正版的没生效 @hzzhaiqi |
|
12楼#
发布于:2014-07-04 17:56
|
|
13楼#
发布于:2014-09-11 18:36
|
|
14楼#
发布于:2014-09-11 21:08
|
|
上一页
下一页