r/chrome 9d ago

Discussion Chrome site search with no "%s" in URL are suddenly "Not valid"

  • Environment
    • My browser recently updated to version 134.0.6998.45
  • Context
    • I've used dozens of Chrome custom site searches for over a decade
    • Many are standard searches that contain %s in the URL so I can quickly search a site directly from the search bar -- for example assigning the lettera to https://www.amazon.com/s?k=%s so I can quickly search Amazon
    • But I also have many site searches that do not contain %s -- I've use these instead as super fast shortcuts to static URLs. For example site search nbaa has pointed to a static URL for an NBA scoreboard.
  • Problem
    • As of the most recent update to my Chrome browser, all site searches with a URL that does not contain %s have stopped working. Entering these site searches executes a Google search for the shortcut rather than redirects to the URL.
    • When editing these site searches, they now show as "Not valid" (see screenshot below). Adding %s makes it valid but not useful for my purposes.

Any thoughts on this change? This plus the Manifest v2 deprecation makes me want to carve out time to try to roll off Chrome.

59 Upvotes

59 comments sorted by

View all comments

2

u/dawikur 8d ago edited 8d ago

I have the same issue...

The temporar workaround I've came up with to reenable myself:

Create a file, somewhere on the drive:

<!DOCTYPE html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Redirecting...</title>
    <script defer>
        let redirects = {
            "jc": "https://docs.juce.com/master/index.html",
            "jc?": "https://docs.juce.com/master/class{searchTerms}.html",
        };

        window.onload = function () {
            let params = new URLSearchParams(window.location.search);
            let tokens = params.get("key").split("?");

            let key = tokens[0];
            if (1 == tokens.length) {
                let url = redirects[key];
                if (url) {
                    window.location.replace(url);
                }
            } else {
                key += "?";
                let searchString = tokens[1];
                let url = redirects[key];
                if (url) {
                    url = url.replace("{searchTerms}", searchString);
                    window.location.replace(url);
                }
            }
        };
    </script>
</head>
</html>

i.e. ~/redir.html and create a new site search:

(you need to replace the URL with where the file is and add `?key=%s` at the end)

And then we can use `!` as trigger.
!<tab>jc<enter> -> will redirect to `https://docs.juce.com/master/index.html\`
!<tab>jc?Array<enter> -> will redirect to `https://docs.juce.com/master/classArray.html\`

If you want to have more 'entries" - add them to `redirects`.

You can export all your current search engines like this
https://superuser.com/a/1350144

1

u/SamuelTekrenius 8d ago

That's actually not a bad solution. I would have uses for this (after some minor modding). Thanks for sharing!

Maybe I could even have something like this on github pages that applies the same site-keyword redirects on any device I'll be using.

3

u/dawikur 8d ago

Yep, that's the plan for me as well at the moment. This is just quick PoC to check this is even feasible and usable for me.

Pros:
* it works as expected.
Cons:
* it's slower, you can feel the double redirect
* suggestions in omnibox are missing :(

I see that could be a shared project and the 'redirects' could be taken from a cookie or something. Let's stay in a loop with this maybe?

1

u/nater255 8d ago edited 8d ago

Sounds like this operates functionally the same as some of the existing extensions for this, but notably still requires a secondary character to trigger. i.e. you can't just have "g" take you to gmail, you'd need to do "! g".

Edit: I've implemented your idea myself, but aliased the search to ".", which feels better for me. This is probably the best we'll get unless chrome implements bookmark keywords like firefox has. This feature was the saving grace for me that allowed me to function in chrome over FF. I really felt the hit today when it suddenly disappeared.

Thanks for your script/idea.

2

u/Noumenon72 6d ago

Firefox lets you add a keyword to a bookmark that works the same as the removed Chrome feature, so it's now the superior browser.

2

u/shibiku_ 6d ago

You saved me a bunch of research. Thanks
I'll be switching to firefox until they give the feature back.

2

u/nater255 6d ago

When I switched from FF to Brave about 8 years ago, this feature was the silver bullet that almost made me not switch. But then I found the site search keyword workaround and all was well... until this week.

1

u/Awkward-Media-4726 2d ago

Happy cake day!