1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-14 12:15:48 +02:00

Fix dragging links not stripping t.co shortener

Closes 
This commit is contained in:
chylex 2017-12-31 06:59:17 +01:00
parent 2f352ef9bb
commit 8d37d68770

View File

@ -420,7 +420,7 @@
})();
//
// Block: Bypass t.co when clicking links and media.
// Block: Bypass t.co when clicking/dragging links and media.
//
$(document.body).delegate("a[data-full-url]", "click auxclick", function(e){
if (e.button === 0 || e.button === 1){ // event.which seems to be borked in auxclick
@ -429,6 +429,16 @@
}
});
$(document.body).delegate("a[data-full-url]", "dragstart", function(e){
let url = $(this).attr("data-full-url");
let data = e.originalEvent.dataTransfer;
data.clearData();
data.setData("text/uri-list", url);
data.setData("text/plain", url);
data.setData("text/html", `<a href="${url}">${url}</a>`);
});
if (ensurePropertyExists(TD, "services", "TwitterUser", "prototype", "fromJSONObject")){
const prevFunc = TD.services.TwitterUser.prototype.fromJSONObject;