mozilla / SocialShare

Protect users' privacy - share user data only when people are ready to share.
BSD 3-Clause "New" or "Revised" License
27 stars 10 forks source link

Make URL configurable #3

Closed fwenzel closed 12 years ago

fwenzel commented 12 years ago

Sharing the current URL is an obvious choice for most cases. However, sometimes we might want to specifically define the share URL (to include a tracking code, for example). Bonus points for being able to specify the URL per service (twitter, fb, g+).

fwenzel commented 12 years ago

Possible that this is not supported unless you use OpenGraph tags. In that case, you can wontfix this bug.

tallowen commented 12 years ago

I need to implement OpenGraph tag data stripping for the twitters.

fwenzel commented 12 years ago

I accidentally all of the twitters.

craigcook commented 12 years ago

It would be good if we could pass a specific URL into the sharing widget, rather than simply sharing the current page. On a blog, for example, there could be multiple instances of the sharing widget on a single page. and each one should share the permalink for an individual post. There are other cases where one might want to share a URL that isn't necessarily the URL of the current page.

My first thought is that we could add another attribute to the widget instance, like data-url="foo". And if that attribute is missing or empty, look for an og:url meta element in the document to share the current page. And if THAT is missing, maybe even fall back to the location.href, which could make sharing still sort of work even if the page doesn't have OpenGraph metadata.

tallowen commented 12 years ago

This has actually been implemented - instead of having a data-url I'm stripping content from the open graph tags and passing that to twitter. I think this will be easier than asking developers to put the information in two places.

fwenzel commented 12 years ago

I agree