Google Images direct link

NOTE: Since July 2016 this script is unmaintained. It is here just for historical purposes and to let other people fork it. Adds direct links to images and pages in google image search

< 腳本Google Images direct link的回應

評論:正評 - 腳本一切正常

§
發表於:2016-03-19

Open in new tab

How can I open original site in new tab?

§
發表於:2016-03-19

And the full size image in new tab.

Lorentz83作者
§
發表於:2016-03-20

You can middle click on the image to open it in a new tab and middle click on the image name at the bottom to open its page in a new tab. See here.

If it is difficult to middle click (i.e. on a touchpad), you can always right click and choose "open in a new tab"

§
發表於:2016-03-20

Actually I made a modification, left cllick to name opens it in new tab. But could you help me to also open image in new tab via left click?

span.innerHTML = '

Lorentz83作者
§
發表於:2016-03-23

The problem is that there's some google code which messes up the links: when you click instead of opening the link as supposed, a javascript function read the href attribute and redirect you to the new page. This is why the target="_blank" does not work for the images. The a.addEventListener('click', stopEvent, false) should prevent also this behavior but, for some reasons I don't understand, it does not.

The easiest hack that I found consist in adding

GM_openInTab(event.target.parentElement.href)
event.stopPropagation() 

to the beginning of the stopEvent function.

Remember also to replace // @grant none with // @grant GM_openInTab

§
發表於:2016-03-24
編輯:2016-03-24

Hi, there's a bug in new modification; It opens image in new tab but it also opens the image in Google Image search tab.
Video to show it:
http://www40.zippyshare.com/v/dCp3KKcp/file.html

Lorentz83作者
§
發表於:2016-03-25

Yes, the hack is more difficult than I thought because there are different js events to block. You can try this one
https://gist.github.com/Lorentz83/06d8499c8f58aba4415e
it appears to work correctly.

§
發表於:2016-03-27

Yes, it worked perfectly Thank you very much.

Lorentz83作者
§
發表於:2016-03-27

You are welcome :smile:

發表回覆

登入以回復

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址