Userscripts icon indicating copy to clipboard operation
Userscripts copied to clipboard

[Google YouTube search link] No longer working after Google's latest update

Open lednerg opened this issue 1 year ago • 8 comments

Please ensure:

  • [X] I included in the issue title the script name I'm referring to.
  • [X] I performed a search of the issue tracker and in the relevant Greasyfork feedback page to avoid opening a duplicate issue.
  • [X] The bug is caused by the script itself. It doesn't happen if I disable the script, or in a fresh browser profile.

Include in this issue:

  • [X] Screenshots/video/gif demonstrating the bug, if it’s visual
  • [ ] Console errors, if any

Describe the problem and how to replicate it

Google has been changing how their search pages look and the latest version unfortunately breaks this script. They are slowly unveiling the new look, so some people may still be seeing the old one. The new version looks like this: image

Example URL

https://www.google.com/search?q=test

Script Manager

Violentmonkey

Browser(s) used

Chrome 111

lednerg avatar Mar 22 '23 03:03 lednerg

Thanks for letting me know. 👍 I still have the old layout so the script is still working fine for me: When the new look rolls out for me I'll update the script.

darkred avatar Mar 22 '23 21:03 darkred

image

I've gone ahead and made a new script from scratch which adds buttons for several different searches next to Google's search form. I'm not putting it on a userscripts site because frankly I don't have time to deal with support. You're free to copy it or parts of it if you want. I don't know for sure if it would work on the older version of Google. Maybe it would be cool to have an options window where people could easily change the buttons around. So yeah, use it or don't, and thanks for maintaining the other script!

https://pastebin.com/JqjSbqgY

lednerg avatar Apr 12 '23 06:04 lednerg

Of course within hours of me posting that to Pastebin, Google decided to change their search box to a textarea (after 25 years of it being an input), thus breaking the script. Anyway, it's working again now.

lednerg avatar Apr 12 '23 23:04 lednerg

I've gone ahead and made a new script from scratch which adds buttons for several different searches next to Google's search form. I'm not putting it on a userscripts site because frankly I don't have time to deal with support.

I really like this format: elegant & efficient use of space.

(This is a shoutout to everyone, who ever can assist!)

I'ld like to add a Button to use GSearch for 'site' searches: e.g. I'm trying to make one for HN, but the following formats are not working--

'Search URLs':

'https://www.google.com/', 'search?site%3Anews.ycombinator.com&q='

'search?q=%s+site%3Anews.ycombinator.com' 'search?+site%3Anews.ycombinator.com&q=' 'search?complete=0&site%3Anews.ycombinator.com&q='

Then moved 'search?' over to 'Domains', tried: 'https://www.google.com/search?', 'complete=0&site%3Anews.ycombinator.com&q=', 'https://news.ycombinator.com/favicon.ico'

Still no-go. In all cases, the links open a gsearch page with just the vale of 'q=' in the textbox.

realAzazello avatar Apr 24 '23 18:04 realAzazello

I'ld like to add a Button to use GSearch for 'site' searches: e.g. I'm trying to make one for HN, but the following formats are not working--

To do site searches, try this: 'https://www.google.com/', 'search?q=site:news.ycombinator.com ' Include that space at the end. You don't have to worry about using stuff like "%3A" since the script will do that itself.

And to search HN directly, you can do: 'https://hn.algolia.com/', '?q='

lednerg avatar Apr 25 '23 14:04 lednerg

To do site searches, try this: 'https://www.google.com/', 'search?q=site:news.ycombinator.com ' Include that space at the end. You don't have to worry about using stuff like "%3A" since the script will do that itself.

Thank you! That works perfectly.

I'm also converting the favicons to base64 embeds -- the calls to the sites' urls every page load are too annoying & inefficient.

realAzazello avatar Apr 25 '23 18:04 realAzazello

@lednerg Eventually I got the new layout: 2023-07-08_212029

Unfortunately the buttons no longer have icons (as in the screenshot in your OP). You see, I was relying to the Google's 'Videos' SVG icon: 2023-07-08_212248 in order to identify the relevant 'Videos' node for the various Google localizations. That's unfortunately no longer possible.

So, I have deleted the script from Greasyfork. When/if I find a solution I'll update and restore it. I'm always open for PR of course.

Side note:

the buttons now are displayed in two steps, not all at once, e.g. initially: 2023-07-08_212642 and then as in my former screenshot. This also complicates things.

darkred avatar Jul 08 '23 18:07 darkred

@darkred I think video search links always have &tbm=vid. So you could probably use something like: document.querySelectorAll('a[href*="&tbm=vid"]')

alpe12 avatar Aug 09 '23 20:08 alpe12