bijij / ViewImage

Extension to re-implement the "View Image" and "Search by image" buttons into google images.
MIT License
780 stars 106 forks source link

Extension doesn't work. #188

Closed ghost closed 4 years ago

ghost commented 4 years ago

The extension does not work in Firefox.

Firefox Quantum

Screenshot: ![screenshot-www google com-2019 10 10-14_54_35](https://user-images.githubusercontent.com/34379403/66566601-0a1b4500-eb6e-11e9-9a36-274341405229.png)

Chrome

Screenshot: ![www google com](https://user-images.githubusercontent.com/34379403/66566630-17383400-eb6e-11e9-8382-ab55fd5a610f.png)
LOuroboros commented 4 years ago

I'm getting the same result. The userscript version never worked for me, but the AddOn which did work correctly 2 months ago isn't working anymore either.

bijij commented 4 years ago

I'll take a look into this tomorrow. Extension was still working fine for me up until today, Seems Google's pushing staggered changes.

trlkly commented 4 years ago

My problems were on Chrome, so I don't think this is Firefox specific. Changing the title might be appropriate so that people don't keep reporting the bug.

bijij commented 4 years ago

commit dbcd909 is a quick and dirty fix. it's been pushed to webstores as well.

seems google is now changing the URL the image redirects to last second so the extension only sees a lower resolution interim image.

I'm likely going to need help with finding the original source image now.

needforsuv commented 4 years ago

you can use the image url from the main search box

https://www.google.com/search?as_st=y&tbm=isch&hl=en&as_q=rotodyne&as_epq=&as_oq=&as_eq=&cr=&as_sitesearch=&safe=images&tbs=isz:lt,islt:10mp#imgrc=CrE0zdL-6oQHBM:

/imgres?imgurl=https%3A%2F%2Fhushkit.files.wordpress.com%2F2016%2F12%2F24555339.jpg&imgrefurl=https%3A%2F%2Fhushkit.net%2F2016%2F12%2F19%2Fthe-10-coolest-cancelled-airliners%2F&docid=ihDmEM_aGU67lM&tbnid=CrE0zdL-6oQHBM%3A&vet=10ahUKEwi38snI-7zlAhU38XMBHbAuBOIQMwguKAIwAg..i&w=4872&h=3388&hl=en&safe=images&bih=800&biw=1370&as_q=rotodyne&ved=0ahUKEwi38snI-7zlAhU38XMBHbAuBOIQMwguKAIwAg&iact=mrc&uact=8

dynoChris commented 4 years ago

Yes, doesn't work. Already more than a month.

bijij commented 4 years ago

@needforsuv can you elaborate as to how you got that 2nd url from the searchbox doesn't appear for me. possibly A/B testing on googles end related?

softyoda commented 4 years ago

This exension work : https://addons.mozilla.org/fr/firefox/addon/view-image-for-google-images/

trlkly commented 4 years ago

@amcgi Not working on my end. It may just be that you haven't been switched over to the new site.

Google is being rather weird with this: they should only be doing the minimum possible to comply with their agreement, not making it hard for extensions to work.

On Mon, Oct 28, 2019 at 9:45 AM amcgi notifications@github.com wrote:

This exension work : https://addons.mozilla.org/fr/firefox/addon/view-image-for-google-images/

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bijij/ViewImage/issues/188?email_source=notifications&email_token=ABJVFLXHJMBHSVDZORH7AK3QQ33JFA5CNFSM4I7L3MQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECND75I#issuecomment-546979829, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJVFLUGHBU5HU5G4S2KLRTQQ33JFANCNFSM4I7L3MQQ .

needforsuv commented 4 years ago

@bijij

right click image tile, inspect element, parent class of thumbnail contains a href with the full url along with the referrer

works with both the one with jsname=sTFXNd ('new' one with different font) and the one with jsname=hSRGPd (the 'old' one that I have)

You can test A/B by opening a incognito window and installing something like EditThisCookie and deleting ALL the cookies and refreshing over and over until you hit the right one

needforsuv commented 4 years ago

And I found the cookie differences:

If I paste the cookies and apply them, I can switch between both 'versions' without doing hit and miss (once I got one I exported the cookies) but 3.1.0 works with neither version that produce either these cookies

OLD:

[
{
    "domain": ".google.com",
    "expirationDate": 1575031340,
    "hostOnly": false,
    "httpOnly": false,
    "name": "1P_JAR",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": false,
    "session": false,
    "storeId": "1",
    "value": "2019-10-30-12",
    "id": 1
},
{
    "domain": ".google.com",
    "expirationDate": 1587991339.763164,
    "hostOnly": false,
    "httpOnly": true,
    "name": "CGIC",
    "path": "/search",
    "sameSite": "no_restriction",
    "secure": false,
    "session": false,
    "storeId": "1",
    "value": "Ikp0ZXh0L2h0bWwsYXBwbGljYXRpb24veGh0bWwreG1sLGFwcGxpY2F0aW9uL3htbDtxPTAuOSxpbWFnZS93ZWJwLCovKjtxPTAuOA",
    "id": 2
},
{
    "domain": ".google.com",
    "expirationDate": 1588250541.061072,
    "hostOnly": false,
    "httpOnly": true,
    "name": "NID",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": false,
    "session": false,
    "storeId": "1",
    "value": "190=Gn6srGAL0ebrOBDgzj3ubz46_yD3K5F7mBm7QsSG9s3Ck4aN2SQuvGJDUSlvtR5Sy4IlL6a8bq_6vR5d6cDNqYadKnq0vdXuDwNLrVvWSQKDtMybHMlDaff-EG1RqjyWKkgf0X_vxWh3NsuC5oHNlEJiBrm0YrZL26CSGkAsqZA",
    "id": 3
},
{
    "domain": ".google.com",
    "expirationDate": 1575031340,
    "hostOnly": false,
    "httpOnly": false,
    "name": "OGPC",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": false,
    "session": false,
    "storeId": "1",
    "value": "19008563-1:",
    "id": 4
},
{
    "domain": "www.google.com",
    "expirationDate": 1572525740,
    "hostOnly": true,
    "httpOnly": false,
    "name": "UULE",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": false,
    "session": false,
    "storeId": "1",
    "value": "a+cm9sZToxIHByb2R1Y2VyOjEyIHByb3ZlbmFuY2U6NiB0aW1lc3RhbXA6MTU3MjQzOTMyOTM2MDAwMCBsYXRsbmd7bGF0aXR1ZGVfZTc6LTI3NDY5NzcwNyBsb25naXR1ZGVfZTc6MTUzMDI1MTIzNX0gcmFkaXVzOjYyOTM1MjA4MA==",
    "id": 5
}
]

NEW:

[
{
    "domain": ".google.com",
    "expirationDate": 1575031381,
    "hostOnly": false,
    "httpOnly": false,
    "name": "1P_JAR",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": false,
    "session": false,
    "storeId": "1",
    "value": "2019-10-30-12",
    "id": 1
},
{
    "domain": ".google.com",
    "expirationDate": 1588250580.438462,
    "hostOnly": false,
    "httpOnly": true,
    "name": "NID",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": false,
    "session": false,
    "storeId": "1",
    "value": "190=YjEXFXOu00oamB0b6LGFh-OxnsthQb4IXCzkkhfIxQqhmo5luKXNoeFBtyo38vACbhOD0zQnT-oR53e3FTvo1J_CZgbly04bYVqM_1kLU78Rx1QDqs9QmYgVVHSKUqQJreurx0SzGecClw4uQGqlkieWWm97VkqvqEnBaZMlFqk",
    "id": 2
},
{
    "domain": "www.google.com",
    "expirationDate": 1575031382,
    "hostOnly": true,
    "httpOnly": false,
    "name": "OTZ",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": true,
    "session": false,
    "storeId": "1",
    "value": "5168923_16_16__16_",
    "id": 3
}
]

(Incognito, so I am not too worried about sharing those)

benounnas commented 4 years ago

i'm using chromium Version 77.0.3865.90, same here doesn't work, is there any fix?

bijij commented 4 years ago

@needforsuv parent doesn't seem to have full URL for me anymore. Or at least not on chromium. I'll take another look tonight though might have just missed it.

needforsuv commented 4 years ago

@bijij

for reference, I'm talking about (the tile parent before you click in) tile parent before you click in

on another note, while running 3.0.4 that does work for me

I found that some related images don't show buttons at all

Example: https://www.google.com/search?as_st=y&tbm=isch&hl=en&as_q=rotodyne&as_epq=&as_oq=&as_eq=&cr=&as_sitesearch=&safe=images&tbs=isz:lt,islt:10mp#imgrc=wV-3UyHXtN_iBM:

(I also tried with this extension) https://chrome.google.com/webstore/detail/view-image-download-image/kkdejhcahmppjoakalgdnnjpnmjlahhi?utm_source=chrome-app-launcher-info-dialog

The behaviours seems similar to yours in that it grabs the image from the preview box, and doesn't show buttons on the same related images

bijij commented 4 years ago

@needforsuv no longer there for me. Class names are also completely different for me now. All being 6 char mixed case strings.

No chance you could make a PR which fixes it for you while I figure out what to do for my case where that doesn't exist.

bijij commented 4 years ago

Found a workaround for me. Uses the raw source array which is deleted at run-time. Clunky fix but seems like it'll do the trick.

Gonna release a version using it now. Let me know if it works for you.

Works for me on chrome / ff.

LOuroboros commented 4 years ago

Found a workaround for me. Uses the raw source array which is deleted at run-time. Clunky fix but seems like it'll do the trick.

Gonna release a version using it now. Let me know if it works for you.

Works for me on chrome / ff.

Can confirm. The Firefox AddOn is working on my end too using Mozilla Firefox v70.0.1 (64 Bits).

needforsuv commented 4 years ago

@bijij 3.2.0 works for me (about the same as 3.0.4 where some related images don't work and larger images with only thumbnails only link to the thumbnail)

My workaround (adapted code from this chrome extension - it redirects to the webpage which is no good, so I made it point to the image and click open link in new tab, bypassing the pesky google image 'preview' layer)

function checkandoverride() {
  var loc=window.location.href

  if(getParameterByName("imgurl") != "" && loc.indexOf("google") > 0)
    document.location=getParameterByName("imgurl");

/*
    if(getParameterByName("rurl") != "" && loc.indexOf("yahoo") > 0 )
        document.location=decodeURIComponent(getParameterByName("rurl"));

    if(getParameterByName("desturi") != "" && loc.indexOf("ask") > 0 )
        document.location=decodeURIComponent(getParameterByName("desturi")); */
}

function getParameterByName(name)
{
  name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
  var regexS = "[\\?&]" + name + "=([^&#]*)";
  var regex = new RegExp(regexS);
  var results = regex.exec(window.location.search);
  if(results == null)
    return "";
  else
    return decodeURIComponent(results[1].replace(/\+/g, " "));
}

checkandoverride();

(I'm not sure how you'd even get the image url once you clicked in on those related images, it's only there before you click in)

needforsuv commented 4 years ago

@bijij

The raw source array method doesn't work completely ('OCT19' version), I can still click through enough related images where while the preview loads the 'full' image (as indexed by google possibly with any resizing), the view image button only shows the encrypted thumbnail (also happens with large images where google doesn't load the full image.

So a fix that fixes that should also fix it for the 'JUL19' version. (If you do get the image url before a click, that'll probably naturally only work forwards not backwards... - easy enough, you just go back another step before going forwards)

(I think the raw source array only works for images present on the main search page, not the right hand side panel/related images.)

Fun fact: the 'OCT19' version doesn't work with some advanced search operators like Xmp, so I don't think it's permanent (I did see it logged in back a while ago back in august?)

Why must google make this SO hard, the image url is already in the href, anybody can see and visit it with the right extension / script, why bother obfuscating it?

PS: A lot of github features/buttons don't work for me (like edit, etc.) where it did once upon a time with my browser - the UI looks the same, but now it just doesn't work properly for me (unsupported blah blah, github should be accessible from practically anything!). So I apologise for any 'double' posts or formatting mistakes, I can only do so much with markdown...

bijij commented 4 years ago

Going to mark this as closed for now I think the issues here have either been fixed or superseded by #207