MCPcopy Index your code
hub / github.com/hoothin/UserScripts / addBtn

Function addBtn

X-Downloader/X-Downloader.user.js:122–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120 }, 0);
121 };
122 const addBtn = e => {
123 if (e.target.dataset && e.target.dataset.testid == "card.layoutLarge.media") {
124 show(e.target.parentNode);
125 } else if (e.target.dataset && e.target.dataset.testid == "tweetPhoto") {
126 show(e.target.parentNode);
127 } else if (e.target.dataset && /^video\-player/.test(e.target.dataset.testid)) {
128 show(e.target.parentNode);
129 } else if (e.target.parentNode && e.target.parentNode.dataset && e.target.parentNode.dataset.testid == "tweetPhoto") {
130 show(e.target.parentNode.parentNode);
131 }
132 };
133 function isElementVisible(el) {
134 const rect = el.getBoundingClientRect();
135 return rect.top < window.innerHeight && rect.top > 0 && rect.bottom >= 0;

Callers 1

Calls 1

showFunction · 0.85

Tested by

no test coverage detected