Menu

#1689 Update global search sample region handling

closed
nobody
None
2026-06-02
2026-05-25
Anonymous
No

Originally created by: KirtiRamchandani

Problem

The global context search sample still suggested that selecting a country switched to that country's Google domain. As noted in [#1653], country-specific Google domains no longer provide a useful visible difference for this sample.

Root cause

The sample encoded locale choice as Google Search hostnames such as google.ca or google.co.jp, so the UI described obsolete domain switching instead of an explicit search-region behavior.

Solution

Use https://www.google.com/search for all searches and add the Google Search cr=countryXX country restriction parameter based on the selected context-menu item. Rename the sample UI/storage identifiers from TLDs to countries and refresh the README/manifest copy to describe country-restricted results.

Tests run

  • npx eslint --no-warn-ignored api-samples/contextMenus/global_context_search/background.js api-samples/contextMenus/global_context_search/popup.js --quiet
  • npx prettier --check api-samples/contextMenus/global_context_search/background.js api-samples/contextMenus/global_context_search/locales.js api-samples/contextMenus/global_context_search/popup.js api-samples/contextMenus/global_context_search/popup.html api-samples/contextMenus/global_context_search/manifest.json api-samples/contextMenus/global_context_search/README.md
  • git diff --check HEAD~1..HEAD
  • Node smoke test with mocked chrome.* APIs verifying menu creation, cr=countryCA search URLs, and country storage updates

Fixes [#1653]

Related

Tickets: #1653
Tickets: #1696

Discussion

  • Anonymous

    Anonymous - 2026-06-02

    Originally posted by: KirtiRamchandani

    Closing this in favor of the cleaned-up follow-up in [#1697], which keeps the same issue focused but removes the extra unrelated file touch and has the latest verification. Thanks.

     

    Related

    Tickets: #1697

  • Anonymous

    Anonymous - 2026-06-02

    Ticket changed by: KirtiRamchandani

    • status: open --> closed
     

Log in to post a comment.