Skip to content

"Global search" example seems outdated #1653

@ferdnyc

Description

@ferdnyc

The api-samples/contextMenus/global_context_search example describes itself as, "letting a user switch between searching different countries' versions of Google", but that's no longer something that Google supports. While it's still possible to perform a regional Google search (see below), switching the domain for the request isn't how.

  • I get that it's just an example.
  • I get that different search URLs ARE still generated based on the user's selections.
  • I get that it's still an effective demonstration of the contextMenus APIs that it's meant to be demonstrating.

But, it's not really a great example anymore. The best examples demonstrate how to do something trivial but useful, letting the user experience why these APIs exist and would be of interest to developers.

And because Google has globalized its service offerings, beyond the string displayed in the URL bar there is no longer any visible difference loading any of these URLs:

(They used to be different, long ago. I assume they still were, when the example was originally written. But no longer.)

In all cases today, Google will show the exact same search results, localized based on an approximate geolocation derived from the requesting IP address. Which makes the example seem pointless.

Perhaps a more current example would be useful. Like:

  • Setting a Region parameter for the search. (&cr=countryCA vs. &cr=countryJP vs. &cr=countryRU etc.) That will have the effect that switching the TLD used to have. (Although the results will still be in the user's presumed language, unless a corresponding &lr=lang_en / &lr=lang_jp / &lr=lang_ru / etc. parameter is also set.)
  • Switching between different Google search categories via the &udm= parameter, though as that's largely undocumented (from official sources, at least) it may not be the best or more future-proof choice.
  • Something else entirely?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions