Last active
December 9, 2018 14:13
-
-
Save mimonelu/741180edc7a635d55b6ce73328c2fb60 to your computer and use it in GitHub Desktop.
📹 動画(videoタグ)のスナップショットをダウンロードするブックマークレット
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript: (function () { var target = document.querySelector("video"); if (target) { var canvas = document.createElement("canvas"); canvas.width = target.clientWidth; canvas.height = target.clientHeight; var context = canvas.getContext("2d"); context.drawImage(target, 0, 0, canvas.width, canvas.height); var image = new Image(); image.src = canvas.toDataURL("image/png"); var a = document.createElement("a"); a.download = location.host + "_" + (new Date()).toISOString() + ".png"; a.target = "_blank"; a.href = image.src; a.click(); } else { alert("There is no video tag."); } })(); void 0; |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
注意事項
動作確認サービス
✅ ニコニコ動画( HTML5 版のみ)
✅ ニコニコ生放送( HTML5 版のみ)
✅ Twitch
✅ YouTube
❌ Vimeo