Skip to content

Fix: Share button not found on non-English browser locales#21

Open
blue-int wants to merge 1 commit intoZeroSharp:masterfrom
blue-int:fix/locale-independent-share-selector
Open

Fix: Share button not found on non-English browser locales#21
blue-int wants to merge 1 commit intoZeroSharp:masterfrom
blue-int:fix/locale-independent-share-selector

Conversation

@blue-int
Copy link

@blue-int blue-int commented Mar 4, 2026

Summary

  • Fix "Share button not found" error on non-English browser locales
  • Add locale-independent CSS selector as primary fallback
  • Remove Chrome Web Store update_url for Edge compatibility

Problem

openShareDialog() relies on button[aria-label="Share"], but chess.com localizes aria-label based on browser locale (e.g. "공유" in Korean). All selectors miss.

Changes

1. Locale-independent selector (getpgn.js)

Added [data-cy="sidebar-share-icon"] as the first selector. data-cy is not localized:

var shareButton =
    document.querySelector('[data-cy="sidebar-share-icon"]') || // Locale-independent
    document.querySelector('[data-cy="analysis-secondary-controls-menu-open-share"]') ||
    document.querySelector('button[aria-label="Share"]') || // English
    document.querySelector('button[aria-label="공유"]') || // Korean
    // ... remaining fallbacks

2. Remove update_url (manifest.json)

Removed "update_url": "https://clients2.google.com/service/update2/crx" per Microsoft's porting guide.

Test plan

  • Tested on Edge (Korean locale) — confirmed working
  • Verified [data-cy="sidebar-share-icon"] exists on chess.com game pages

@blue-int blue-int force-pushed the fix/locale-independent-share-selector branch from f234bae to 138bfdf Compare March 4, 2026 05:41
The extension fails to find the Share button when the browser language
is not English, because openShareDialog() relies on aria-label="Share"
which chess.com localizes (e.g. "공유" in Korean).

Add data-cy="sidebar-share-icon" as the primary selector, which is
locale-independent and stable across UI updates.

Also remove Chrome Web Store update_url from manifest.json, which
Microsoft's porting guide requires for Edge compatibility.
@blue-int blue-int force-pushed the fix/locale-independent-share-selector branch from 138bfdf to 7026f20 Compare March 4, 2026 05:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant