Skip to content

Instantly share code, notes, and snippets.

@kenzo-tanaka
Last active February 27, 2021 01:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kenzo-tanaka/7f0681cd33230c63c338df5faeaaa044 to your computer and use it in GitHub Desktop.
Save kenzo-tanaka/7f0681cd33230c63c338df5faeaaa044 to your computer and use it in GitHub Desktop.
GitHub Issueのコメントbodyをクリックしたら即編集できるようにするJavaScript
javascript: (function () {
document.querySelectorAll(".comment-body").forEach((comment) => {
comment.addEventListener("click", (e) => {
const editLink = e.target
.closest(".edit-comment-hide")
.parentElement.querySelectorAll(".timeline-comment-action")[1];
editLink.click();
setTimeout(() => {
editLink.parentElement.querySelector(".js-comment-edit-button").click();
}, 1000);
});
});
})();
@kenzo-tanaka
Copy link
Author

Bookmarkletを使って実行する。
参考: Bookmarkletを作ろう(準備編) - Qiita

@kenzo-tanaka
Copy link
Author

Closure Compiler Service
コンパイルしたら結構安定するようになった。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment