Greasy Fork镜像 is available in English.

linkedIn learning video download

Allows to download learning videos you see on LinkedIn. Must be logged in.

< 腳本linkedIn learning video download的回應

評論:正評 - 腳本一切正常

§
發表於:2018-12-13

Move the download button to the bottom menu

Why didn't you move the DL button to the bottom menu, so that we can watch full screen? Here is the code, simplified and changed:

$('body').ready(function(){ (function() { var download_button = <div class="video-player__toolbar-menu"> <button id="dlbtn" title="Download video" class="add-menu-dropdown__trigger btn-tertiary btn-large dropdown-trigger ember-view"> <span class="text" aria-hidden="true">DL</span> <span class="visually-hidden">DL Vid</span> </button></div>; addDownloadButton = function(){ $('.ssplayer-right-actions').prepend(download_button); $('#dlbtn').wrap(''); $('#dlbtn').unbind(); $('#dlbtn').children().unbind(); }; checkIfReadyToLoad = function(){ if($('.ssplayer-right-actions').length && $('#dlbtn').length == 0){ addDownloadButton(); } else{ setTimeout(checkIfReadyToLoad,1000); } }; checkIfReadyToLoad(); checkForVideoPlayer = function(){ if($('.video-container video').length){ var vid_source = $('video').attr('src'); $('#dllink').attr('href', vid_source); var vid_name = vid_source; $('#dllink').attr('download', vid_name); } else { } }; $('body').on('mouseover', '#dlbtn', function(){ checkForVideoPlayer(); }); $('body').on('mouseover', '.course-body__content', function(){ checkIfReadyToLoad(); });

})();

});

發表回覆

登入以回覆

长期地址
遇到问题?请前往 GitHub 提 Issues。