Advertisement
mufuuuu

[Bookmarklet] 時間指定メモ (クリップボード使用版)

Aug 9th, 2019
1,006
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. javascript:(function(){
  2.     var video = document.querySelector('#movie_player > div.html5-video-container > video');
  3.     var time = Math.floor(video.currentTime);
  4.     var h = Math.floor(time / 3600);
  5.     var m = Math.floor((time / 60) % 60);
  6.     var s = time % 60;
  7.     var formattedTime = (h > 0) ? h + ':' + zeroPadding(m) + ':' + zeroPadding(s) : zeroPadding(m) + ':' + zeroPadding(s);
  8.     function zeroPadding(num){return (Array(2).join('0') + num).slice(-2);}
  9.     navigator.clipboard.writeText(formattedTime + ' ');
  10. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement