Closed Bug 953431 Opened 10 years ago Closed 5 years ago

canonical url may not be the best url to use for share

Categories

(Firefox Graveyard :: SocialAPI, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: ben, Unassigned)

Details

I suspect this may be to do with the way sites like Twitter simulate pageloads with Javascript.

Directly load any page on Twitter, eg an individual tweet: https://twitter.com/hondanhon/status/417417610037182465

Click on share, and the referrer URL and title is correct. For me (using Idno), this is: http://werd.io/firefox/share?share_url=https%3A%2F%2Ftwitter.com%2Fhondanhon%2Fstatus%2F417417610037182465&share_title=Twitter%20%2F%20hondanhon%3A%20Writing%20a%20business%20plan%20on%20...

Then click to any other page on Twitter, for example by clicking "Home".

The URL displayed in the address bar is now: https://twitter.com

But when you click share, the URL is still that of the previous page: http://werd.io/firefox/share?share_url=https%3A%2F%2Ftwitter.com%2Fhondanhon%2Fstatus%2F417417610037182465&share_title=Twitter

Note that the *title* is correct. Only the URL has remained unchanged.

If you reload the page, the correct URL is passed. That suggests that Twitter is doing something with JS rather than actually reloading the page. It might be better, in these situations, to take the *displayed* URL rather than the actual base URL serving the JS.
I'm able to reproduce this in Firefox Nightly 29.0a1 on Ubuntu 13.10 64-bit with the following steps:

1. Active the Demo Provider and sign-in: http://mixedpuppy.github.io/socialapi-demo/
2. Open a new tab to twitter.com and sign-in
3. Load https://twitter.com/hondanhon/status/417417610037182465 and click the Share button
> Sharing: ?url=https%3A%2F%2Ftwitter.com%2Fhondanhon%2Fstatus%2F417417610037182465
4. Click the Home tab in twitter
5. Click the Share button
> Sharing: ?url=https%3A%2F%2Ftwitter.com%2Fhondanhon%2Fstatus%2F417417610037182465

Thinking about this some more though this might be completely expected and working as designed. In other words, it won't let you share the top-level domain so it's keeping the most recently shareable page in cache. If I open a new tweet and click the Share button the share URL is updated.

Over to Shane to confirm this is working as designed.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(mixedpuppy)
OS: Mac OS X → All
Hardware: x86 → All
This is happening because we use the canonical url if defined, and twitter is setting the canonical url for all their pages to http://twitter.com.  I'm not sure why they would set the canonical for my specific page to the top level of their site, seems weird and wrong to me.  This could probably be updated to send both the url the browser is using and the canonical.
Flags: needinfo?(mixedpuppy)
Summary: Social API doesn't always share the correct URL → canonical url may not be the best url to use for share
Aha! Thanks for the clarification. Using the canonical URL does make obvious sense, and it does seem like an odd decision at Twitter's end. Raising it with them.
SocialAPI was removed from Firefox 57 and is no longer available in any current release.
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → WONTFIX
Product: Firefox → Firefox Graveyard
You need to log in before you can comment on or make changes to this bug.