Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Making twitter work with the new best practices for share

  • Loading branch information...
commit d213df4dbb6de6be54d12436f23bcabf11fd12c9 1 parent a899e49
Paul Kinlan authored
Showing with 10 additions and 2 deletions.
  1. +10 −2 tools/chrome/extensions/share-services/twitter/twitter_inline.html
View
12 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") {
Please sign in to comment.
Something went wrong with that request. Please try again.