mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-05-04 08:34:07 +02:00
Fix not stripping t.co in notifications when dragging & sometimes when copying
This commit is contained in:
parent
b9318dfd8e
commit
70ca890bef
Resources/Scripts
@ -197,6 +197,10 @@
|
|||||||
html.find(".js-media").remove();
|
html.find(".js-media").remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
html.find("a[data-full-url]").each(function(){ // bypass t.co on all links
|
||||||
|
this.href = this.getAttribute("data-full-url");
|
||||||
|
});
|
||||||
|
|
||||||
html.find("a[href='#']").each(function(){ // remove <a> tags around links that don't lead anywhere (such as account names the tweet replied to)
|
html.find("a[href='#']").each(function(){ // remove <a> tags around links that don't lead anywhere (such as account names the tweet replied to)
|
||||||
this.outerHTML = this.innerHTML;
|
this.outerHTML = this.innerHTML;
|
||||||
});
|
});
|
||||||
|
@ -14,14 +14,14 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
// Block: Hook into links to bypass default open function and t.co, and handle skipping notification when opening links.
|
// Block: Hook into links to bypass default open function, and handle skipping notification when opening links.
|
||||||
//
|
//
|
||||||
(function(){
|
(function(){
|
||||||
const onLinkClick = function(e){
|
const onLinkClick = function(e){
|
||||||
if (e.button === 0 || e.button === 1){
|
if (e.button === 0 || e.button === 1){
|
||||||
let ele = e.currentTarget;
|
let ele = e.currentTarget;
|
||||||
|
|
||||||
$TD.openBrowser(ele.hasAttribute("data-full-url") ? ele.getAttribute("data-full-url") : ele.getAttribute("href"));
|
$TD.openBrowser(ele.href);
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
if ($TDX.skipOnLinkClick){
|
if ($TDX.skipOnLinkClick){
|
||||||
@ -38,13 +38,6 @@
|
|||||||
addEventListener(links, "auxclick", onLinkClick);
|
addEventListener(links, "auxclick", onLinkClick);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
//
|
|
||||||
// Block: Allow bypassing of t.co in context menus.
|
|
||||||
//
|
|
||||||
addEventListener(links, "contextmenu", function(e){
|
|
||||||
$TD.setLastRightClickInfo("link", e.currentTarget.getAttribute("data-full-url"));
|
|
||||||
});
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Block: Expand shortened links on hover or display tooltip.
|
// Block: Expand shortened links on hover or display tooltip.
|
||||||
//
|
//
|
||||||
|
Loading…
Reference in New Issue
Block a user