1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-18 06:15:49 +02:00

Fix middle-clicking on links in desktop notifications not skipping them or stripping t.co

This commit is contained in:
chylex 2018-02-19 17:31:28 +01:00
parent 8c168c9ad7
commit 89e92dab59

View File

@ -14,9 +14,11 @@
};
//
// Block: Hook into links to bypass default open function and t.co.
// Block: Hook into links to bypass default open function and t.co, and handle skipping notification when opening links.
//
addEventListener(links, "click", function(e){
(function(){
const onLinkClick = function(e){
if (e.button === 0 || e.button === 1){
let ele = e.currentTarget;
$TD.openBrowser(ele.hasAttribute("data-full-url") ? ele.getAttribute("data-full-url") : ele.getAttribute("href"));
@ -29,7 +31,12 @@
$TD.loadNextNotification();
}
}
});
}
};
addEventListener(links, "click", onLinkClick);
addEventListener(links, "auxclick", onLinkClick);
})();
//
// Block: Allow bypassing of t.co in context menus.