KevinPayravi / indie-wiki-buddy

Browser extension that automatically notifies and redirects you to independent wikis.
https://getindie.wiki
MIT License
262 stars 72 forks source link

Extension freezes Google image search #778

Open propfeds opened 1 month ago

propfeds commented 1 month ago

When opening a result from a Google image search that contains a deprecated wiki link, the page freezes.

Browser: Chrome OS: Windows 11

How to Reproduce

  1. Search for 'minecraft wiki' and navigate to the Images tab.
  2. Click on a result that's from Fandom.com.
  3. The search page freezes.
KevinPayravi commented 1 month ago

Thanks for the report! I haven't been able to replicate the freezing, but I do notice a slowdown + entire image results being hidden when expanding an image result.

We were previously ignoring image search results by detecting if imgurl= was present in the URL, but Google seems to no longer be including that so we can't rely on it. I'll try to get a fix in ASAP to avoid filtering image results based on the DOM.

Razboy20 commented 1 month ago

Looks like this issue is not expressed the same with the code changes introduced by #776, but it might be beneficial to modify it to still not look at images (there is no noticeable performance impact, but I notice that it tries to reorder elements)

KevinPayravi commented 1 month ago

From my previous comment, I mentioned experiencing the following bug:

entire image results being hidden when expanding an image result.

I believe this bug was introduced when I changed our search result container selection to use the parentNode (see https://github.com/KevinPayravi/indie-wiki-buddy/commit/1affa19c9c5c881b0f5396318b4886d384c8ee82). This was done to resolve some other UI bugs when filtering on Google (like https://github.com/KevinPayravi/indie-wiki-buddy/issues/758), but this also caused entire image search results to be selected when doing an image search.

Need to fix not filtering on Google image results and/or adjust the query to not select entire image results as the container.

KevinPayravi commented 1 month ago

I'm still testing, but we may be able to include the closest div with a jsname attribute as an option for the search container. const closestJsName = searchResult.closest('div[jsname]');