Skip to content

Instantly share code, notes, and snippets.

@mkizka
Last active January 12, 2021 11:07
Show Gist options
  • Save mkizka/5eabfbaa95f0a3528b387c7c2b5cd321 to your computer and use it in GitHub Desktop.
Save mkizka/5eabfbaa95f0a3528b387c7c2b5cd321 to your computer and use it in GitHub Desktop.
TweetDeckの画像ツイートボタンを無効化する
const drawer = document.querySelector(".js-drawer[data-drawer=compose]");
const observer = new MutationObserver(() => {
const imageButton = document.querySelector(".js-add-image-button");
if (imageButton) {
const cloneImageButton = imageButton.cloneNode(true)
cloneImageButton.addEventListener("click", () => {
alert("使えません");
});
imageButton.parentNode.replaceChild(cloneImageButton, imageButton)
}
});
observer.observe(drawer, {
childList: true,
attributes: false,
characterData: false,
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment