bam1279 / share-switch

Redirect X (Twitter) share buttons to your favorite microblogging platforms
MIT License
2 stars 0 forks source link

[Bug]: Fails to redirect from embedded AddToAny share buttons #8

Open bam1279 opened 2 months ago

bam1279 commented 2 months ago

Prerequisites

Describe the bug

When attempting to use the extension via AddToAny's embedded share buttons on a web page, the redirection does not occur as expected.

To Reproduce

  1. Navigate to a webpage with embedded AddToAny share buttons.
  2. Click on the Twitter share button provided by AddToAny.
  3. Observe that the ShareSwitch extension does not redirect to the intended social media page.

Expected behavior

The ShareSwitch extension should intercept the action and redirect to the user's chosen social media posting site.

Screenshots

Screenshot(s)

Desktop (please complete the following information):

- OS: MacOS Sonoma
- Browser: Google Chrome
- Browser Version: 124

Additional context

No response

Do you want to address this bug yourself?

bam1279 commented 2 months ago

The issue seems to stem from the way AddToAny handles share button clicks.

When a share button is clicked, a request is sent to AddToAny’s server, which then responds with a 302 redirect to Twitter. This 302 redirect does not trigger the webNavigation event, preventing ShareSwitch from overriding the navigation as intended.