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

View Image no longer works when logged into Google on Firefox #268

Closed zleonov closed 1 year ago

zleonov commented 1 year ago

Describe the bug View Image stopped working in Firefox. After trying to debug the issue, I noticed that works in private mode.

That gave me a clue, so I cleared all my cache and it started working again. Then all of a sudden it stopped. I realized that it stops working once you login into your Google account. Clearing the history completely makes it work again, until the next time you login.

So it must be something in the cache or a cookie. I have replicated the issue on several computers, so it doesn't look like it's specific to my setup.

System Information

zleonov commented 1 year ago

Update

It seems that it may be related to my particular Google account. I used a different account in Edge and it worked fine. But when I logged into my account in Edge, it stopped working until I logged out, then it was working again.

So it's not a matter of simply being logged in, it's my particular account. Let me know if I can help you debug.

ner00 commented 1 year ago

This has been happening to quite a few users, unfortunately dev wasn't able to reproduce it yet due to the "random" nature of the bug - https://github.com/bijij/ViewImage/issues/254#issuecomment-1456071397

zleonov commented 1 year ago

@ner00 ah yes, I see.

If this is at all helpful, I tried this Edge addon: https://microsoftedge.microsoft.com/addons/detail/view-image-button/jhglddilleefffeidcidhgaijkgjokfe, and while it works:

When I am logged in, it looks like this (pay attention to the View image text not being centered on the button): view_image1

When I am logged out, it looks normal: view_image2

@bijij I could save the page, zip it up, and attach it here to debug if it will be useful.

ner00 commented 1 year ago

@bijij I have now been able to replicate this on accident. I opened Google in Edge without any account and went to the Search settings and changed the language to English and saved, after that there was no more button. I tried using the userscript to debug, it appears to fail when parsing the data source and creating the source images array, but since you're the expert on the matter have a look at this:

msedge_qMBscbpelB

Some HTML just in case: https://gist.githubusercontent.com/ner00/da32f5958d2e67ba08c0d3e8e4a476de/raw/2313c836812e88af37ae2334348f9008ed810c6a/google_images.html

ner00 commented 1 year ago

I think I found the class that changed, but not sure if someone else can corroborate this. Before it was (and some times still is) class n3VNCb but now I'm seeing class r48jcc, and adding that class to the script allows the data source to be processed. Also, the Visit button has also a new class: uZ49bd whereas before it used jAklOc, so the button also needs the new class.

If someone can try this, do the following:

Search an image and above the Visit button, in the image preview square, right-click and Inspect, see if it highlights something like this: <img src="https://cdn.mos.cms.futurecdn.net/xXp45gLeBTBt4jPuZcawUJ-1200-80.jpg" jsaction="VQAsE" class="r48jcc pT0Scc iPVvYb" style="max-width: ...

the important part would be class="r48jcc pT0Scc iPVvYb", specifically the first class r48jcc, just to see if this is one variation of many or if everyone getting the failure as the same new class name.

If you can, do the same for the Visit button, right-click on it and Inspect, then see if you get highlighted something like this:

<a role="link" tabindex="0" class="uZ49bd hsGDOd" data-ved="..." rel="noopener" target="_blank" href="..." aria-label=...>
    <div class="Rp89He legCh legCh">
        <span class="Is9g1b K8E1Be cS4Vcb-pGL6qe-lfQAOe dCBVl K8E1Be cS4Vcb-pGL6qe-lfQAOe">Visit</span>
    </div>
</a>

The important part is class="uZ49bd hsGDOd", specifically uZ49bd, this should be 2 levels above what is highlighted at first.

zleonov commented 1 year ago

@ner00 I am getting r48jcc pT0Scc iPVvYb when I am logged in and n3VNCb pT0Scc KAlRDb when in private mode.

Which explains the behavior I am seeing.

The old class n3VNCb... is detected while the new class r48jcc... is not.

ner00 commented 1 year ago

@zleonov can you try to confirm the visit button class too?

zleonov commented 1 year ago

@ner00 confirmed. Same as you got: Rp89He legCh legCh for the outer div and Is9g1b K8E1Be cS4Vcb-pGL6qe-lfQAOe dCBVl K8E1Be cS4Vcb-pGL6qe-lfQAOe for the inner span.

It does not seem to change whether I am logged in or not.

ner00 commented 1 year ago

That's the class from the div, you need to check the class from the parent a

zleonov commented 1 year ago

Same as yours when logged in: uZ49bd hsGDOd But in a private window it's: jAklOc hsGDOd

ner00 commented 1 year ago

That clarifies the issue. Now we must wait for the dev to push an update, but what's worse is the time Chrome Store takes to approve extensions and updates.

ner00 commented 1 year ago

In the meantime, I updated the script to be used with extensions such as GreaseMonkey, TamperMonkey, etc. You can grab the script here: https://gist.github.com/ner00/ec9ae47e202b8e99f19be44a5af6baf3

NOTE: The script linked above will not work if the extension is running at the same time. While the extension isn't updated, you can disable it and use the script instead.

For those who might not know how to install user scripts to run in your browser, like an extension, follow this:

  1. Make sure to disable or uninstall the View Image extension in your browser (go to settings, find the section with extensions, and disable or uninstall it).

    • Firefox extensions URL: about:addons
    • Chrome extensions URL: chrome://extensions/
    • Edge extensions URL: edge://extensions/
  2. Install an extension that allows to add user scripts, most popular are Tampermonkey and Greasemonkey (choose one):

  3. Install the user script mentioned, which can be installed directly by clicking here: https://gist.github.com/ner00/ec9ae47e202b8e99f19be44a5af6baf3/raw/viewimage.user.js

zleonov commented 1 year ago

@bijij I guess it's in your hands :)

TheBauwssss commented 1 year ago

@ner00 The instructions you provided have indeed restored the 'View Image' button functionality for me in literally just a few clicks. Thank you, man! 😄 You're a true godsend!

mzso commented 1 year ago

@ner00 commented on Mar 20, 2023, 3:04 PM GMT+1:

In the meantime, I updated the script to be used with extensions such as GreaseMonkey, TamperMonkey, etc. You can grab the script here: https://gist.github.com/ner00/ec9ae47e202b8e99f19be44a5af6baf3

NOTE: The script linked above will not work if the extension is running at the same time. While the extension isn't updated, you can disable it and use the script instead.

Thanks! This seems to work fine. It even helps with the failure of loading high res images for the preview, I only got ridiculously pixellated ones for most pictures. (Either this or the addon broke it before.)

(It was broken for many months for me, very annoying...)

ner00 commented 1 year ago

It even helps with the failure of loading high res images for the preview, I only got ridiculously pixellated ones for most pictures.

The script is almost a 1:1 of the add-on, I think that what is happening in those situations is that Google is linking a lowres preview, embedded or otherwise, for whatever reason.

Someone had complained about this in relation to the add-on and the example they game me, when inspected, showed that Google wasn't previewing the endpoint image either which made it impossible for the add-on to do what Google itself doesn't.

Anyway, glad that at least the button is working for you.

mzso commented 1 year ago

@ner00 commented on Apr 10, 2023, 2:39 AM GMT+2:

It even helps with the failure of loading high res images for the preview, I only got ridiculously pixellated ones for most pictures.

The script is almost a 1:1 of the add-on, I think that what is happening in those situations is that Google is linking a lowres preview, embedded or otherwise, for whatever reason.

Someone had complained about this in relation to the add-on and the example they game me, when inspected, showed that Google wasn't previewing the endpoint image either which made it impossible for the add-on to do what Google itself doesn't.

Anyway, glad that at least the button is working for you.

Originally posted by @ner00 in https://github.com/bijij/ViewImage/issues/268#issuecomment-1501256208

No. I actually meant that the preview were low res before. Now with your updated script I typically get proper high-res ones.

I checked right now, and I also get high res previews with the most part. So I guess the addon failing broke this as well. (Or my impressions are wrong, which is always possible...)

ner00 commented 1 year ago

So I guess the addon failing broke this as well

This is a possibility, I only used the "broken" add-on for about 30 minutes, so I might have completely missed a collateral like that.

apampuch commented 1 year ago

I'm not seeing the button at all, logged in OR logged out.

softyoda commented 1 year ago

Same for me, firefox last version, on google up to data page, on windows 10 x64 architecture, with the firefox addon up to date.

ner00 commented 1 year ago

@softyoda https://github.com/bijij/ViewImage/issues/268#issuecomment-1476294452

lost-books commented 1 year ago

i dont have any google account & this plugin stopped working in firefox

CarlosTorch commented 1 year ago

In the meantime, I updated the script to be used with extensions such as GreaseMonkey, TamperMonkey, etc. You can grab the script here: https://gist.github.com/ner00/ec9ae47e202b8e99f19be44a5af6baf3

NOTE: The script linked above will not work if the extension is running at the same time. While the extension isn't updated, you can disable it and use the script instead.

For those who might not know how to install user scripts to run in your browser, like an extension, follow this:

1. Make sure to disable or uninstall the View Image extension in your browser (go to settings, find the section with extensions, and disable or uninstall it).

   * Firefox extensions URL: `about:addons`
   * Chrome extensions URL: `chrome://extensions/`
   * Edge extensions URL: `edge://extensions/`

2. Install an extension that allows to add user scripts, most popular are Tampermonkey and Greasemonkey (choose one):

   * Tampermonkey for Firefox: https://addons.mozilla.org/firefox/addon/tampermonkey/
   * Greasemonkey for Firefox: https://addons.mozilla.org/firefox/addon/greasemonkey/
   * Tampermonkey for Chrome: https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo
   * Tampermonkey for Edge: https://microsoftedge.microsoft.com/addons/detail/tampermonkey/iikmkjmpaadaobahmlepeloendndfphd

3. Install the user script mentioned, which can be installed directly by clicking here: https://gist.github.com/ner00/ec9ae47e202b8e99f19be44a5af6baf3/raw/viewimage.user.js

works great, thanks

raniesantos commented 1 year ago

Is bijij out on vacation?

ner00 commented 1 year ago

Is bijij out on vacation?

Doesn't look like it since he has been active on other projects, maybe he got bored with this or maybe he's waiting for something.

Reonu commented 1 year ago

@bijij hi, is this project still in development?

absay commented 1 year ago

Any notable forks that are in active development? Or similar add-ons at least?

Seems like this add-on is dead.

ner00 commented 1 year ago

Any notable forks that are in active development? Or similar add-ons at least?

Use the updated userscript that I'm maintaining https://github.com/bijij/ViewImage/issues/268#issuecomment-1476294452

bijij commented 1 year ago

@bijij hi, is this project still in development?

Hi yes, sorry I've been somewhat busy recently. I'm hoping to push out a new version end of week.

Though google and Mozilla may take more than a week to review and approve the update.

Unfortunately the issue still isn't occurring on any of my Google accounts so haven't been able to test it but I'll (assuming it's okay) base changes off what @ner00's done.

Thanks all.

ner00 commented 1 year ago

Myself and some of the users have had success with those changes after I was able to reproduce the issue, seems to be working so far. The most recent complaints seem to be from users who are not aware of the userscript and probably expected an update to the extension would have automatically happened by now.

One thing I have noticed lately, which I am not sure if it's new in general or not, is that often times I won't get the button to show because Google itself will only have a lowres base64 embed instead of an actual source link to the full image.

Some of these cases seem to be in social media sites or the likes that probably have some form of no-crawling policy or w/e.

bijij commented 1 year ago

Hi all, I've just released a new update. It's rolled out to chrome and hopefully should be available on Firefox soon.

Thanks for your patience.

ner00 commented 1 year ago

Just tried it, works fine with Chrome!

Note: class r48jcc for image source and Rp89He for Visit button.

onmyouji commented 1 year ago

I've updated to 3.7.0 on Firefox but it still doesn't work. Any Firefox users can confirm?

gioxx commented 1 year ago

I've updated to 3.7.0 on Firefox but it still doesn't work. Any Firefox users can confirm?

Firefox Nightly (115.0a1 (2023-05-24) (64 bit)) with View Image 3.7.0, seems to work perfectly immagine

Same test, authenticated with a Google Account: immagine

onmyouji commented 1 year ago

Sorry, I forgot it doesn't work if the images are from instagram. Other websites work just fine.

Thanks

gioxx commented 1 year ago

Sorry, I forgot it doesn't work if the images are from instagram. Other websites work just fine.

Thanks

Yes, in this case I can confirm the problem using UserScript version updated by @ner00 and also the official addon (3.7.0) by @bijij.

ner00 commented 1 year ago

Yes, in this case I can confirm the problem using UserScript version updated by @ner00 and also the official addon (3.7.0) by @bijij.

This is probably because Instagram (and Facebook to some extent) can deny crawling profiles' content, although Google still ends up providing an embedded base64 miniature. This is likely to become increasingly common, particularly with regards to privacy laws cracking down on the scope of crawling done to social media platforms.

I tested the Firefox extension too and there are two things I notice in comparison to Chrome's (and possibly other Chromium-based browsers in general):

This last one isn't a deal breaker given that Google now includes the camera icon in the bottom left of all images which pretty much achieves the same purpose as the context-menu option. Still, I'm mentioning it because it works in Chrome but not FF.

ner00 commented 1 year ago

New class for the Visit button: e0XTue - according to https://gist.github.com/ner00/ec9ae47e202b8e99f19be44a5af6baf3?permalink_comment_id=4624558#gistcomment-4624558

zleonov commented 1 year ago

Something very weird is going on. The view image button is gone, because of the new class as @ner0 said.

But, now, I can right-click on the image now, and just click "Open Image in New Tab" (FireFox) and it opens the full-resolution image. When I am not logged in using Edge, the image button is still there (I guess getting the old class there) but I can still right-click and open the image in a new tab, and it shows the full-resolution image.

On Mon, Jul 10, 2023 at 10:04 AM ner0 @.***> wrote:

New class for the Visit button: e0XTue - according to https://gist.github.com/ner00/ec9ae47e202b8e99f19be44a5af6baf3?permalink_comment_id=4624558#gistcomment-4624558

— Reply to this email directly, view it on GitHub https://github.com/bijij/ViewImage/issues/268#issuecomment-1629369024, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPO6UBLIOPHASARCDPLKWLXPQY2NANCNFSM6AAAAAAWAOUDDQ . You are receiving this because you were mentioned.Message ID: @.***>

ner00 commented 1 year ago

now, I can right-click on the image now, and just click "Open Image in New Tab" (FireFox) and it opens the full-resolution image

This has worked for me for a long time, both in Firefox and Chrome, although I can't precise since when. A couple reasons why I don't use the right-click often in Google images:

It's still better than nothing though.

zleonov commented 1 year ago

@ner0 My memory must be playing tricks on me. If this is the case, isn't it easier to make an addon that reasigns like, the middle click button to open images in a new tab? or something? if it works consistently?

I open images in a new tab a lot, i was thinking i want a shortcut anyway.

On Mon, Jul 10, 2023 at 12:57 PM ner0 @.***> wrote:

now, I can right-click on the image now, and just click "Open Image in New Tab" (FireFox) and it opens the full-resolution image

This has worked for me for a long time, both in Firefox and Chrome, although I can't precise since when. A couple reasons why I don't use the right-click often in Google images:

  • Requires two clicks instead of one;
  • More often than not I mistakenly click on "Open link in New Tab" instead of "Open image in New Tab"

It's still better than nothing though.

— Reply to this email directly, view it on GitHub https://github.com/bijij/ViewImage/issues/268#issuecomment-1629642646, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPO6UHN6SJB7TIJVJEJVALXPRNDFANCNFSM6AAAAAAWAOUDDQ . You are receiving this because you were mentioned.Message ID: @.***>

ner00 commented 1 year ago

I would assume that making an addon to reassign whatever action to open the image in a new tab would take a similar approach as the current one. After all, the only difference would be the button itself, but it would still always need to scan the page and use pretty much the same elements as anchors to extract the URL and use it inside the action.

zleonov commented 1 year ago

@ner0 I was thinking that "Open Image in New Tab" already exists in the firefox context menu. For any image, regardless of the website. Simply re-assign that functionality. I am not well versed in the add-on APIs and if that's possible.

On Mon, Jul 10, 2023 at 2:53 PM ner0 @.***> wrote:

I would assume that making an addon to reassign whatever action to open the image in a new tab would take a similar approach as the current one. After all, the only difference would be the button itself, but it would still always need to scan the page and use pretty much the same elements as anchors to extract the URL and use it inside the action.

— Reply to this email directly, view it on GitHub https://github.com/bijij/ViewImage/issues/268#issuecomment-1629782030, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPO6UB3J4DHEP6ILS4EQ73XPR2WBANCNFSM6AAAAAAWAOUDDQ . You are receiving this because you were mentioned.Message ID: @.***>

horse14t commented 1 year ago

@ner00 Thank you!!! Though I noticed that the script doesn't work with this new Google update that displays multiple images. Such images can't even be right clicked. Capture