Permalink
Browse files

Making twitter work with the new best practices for share

  • Loading branch information...
PaulKinlan committed Aug 23, 2012
1 parent a899e49 commit d213df4dbb6de6be54d12436f23bcabf11fd12c9
Showing with 10 additions and 2 deletions.
  1. +10 −2 tools/chrome/extensions/share-services/twitter/twitter_inline.html
@@ -5,8 +5,16 @@
var intent = window.intent || window.webkitIntent;
if(intent) {
if(intent.type === "text/uri-list") {
- var href = "https://twitter.com/intent/tweet?url=" +
- encodeURI(intent.data);
+ var url;
+ if(intent.data instanceof String) {
+ url = intent.data;
+ }
+ else {
+ url = intent.data.url;
+ }
+
+ var href = "https://twitter.com/intent/tweet?url=" + encodeURIComponent(url);
+
window.location = href;
}
else if(intent.type === "text/plain") {

0 comments on commit d213df4

Please sign in to comment.