AbemaTVの見逃し配信でフルスクリーン + コメント表示をするブックマークレットを雑に作った

AbemaTV面白いですよね。ネット配信も比較的早くて、コメントも見れるので重宝しています。
便利で面白いのでちょっと前にプレミアム会員になりました。
 

AbemaTVでは見逃し配信機能があって、過去の放送をコメント付きで見ることができます。

 

が、なぜかこの見逃し配信ではフルスクリーンにしつつコメントを表示することができません。
せっかくなのでフルスクリーンのコメント付きで見たいところです。

なので解決するブックマークレットを作りました。
Chromeでのみ動作確認済みです。

以下のソースコードをコピペしてブックマークのURLに保存することで使用できます。
コメントのロードが完了してからコメント欄が開かれるので、フルスクリーンになってからコメント欄が表示されるまで少し時間がかかります。

javascript:(()=>{showComment = function () {document.querySelector('.c-tv-SlotPlayerContainer').style.position='inherit';document.querySelector('.com-a-Video__video').style.position='fixed';document.querySelector('.c-tv-TimeshiftSlotContainerView-detail').style.display='none';ret = function() {if(document.querySelector('.com-archive-comment-ArchiveCommentList--zero')){document.querySelector('.com-a-Button--secondary').click();setTimeout(ret,500);}};ret();};waitVideo = function() {setTimeout(() => {if(!document.querySelector('.c-tv-TimeshiftSlotContainerView-player')){waitVideo();} else {showComment();}},500);};waitVideo();})();

f:id:masa_charcoal:20190831114946p:plain

保存したブックマークレットを、AbemaTVの見逃し配信ページでクリックすることで見逃し配信の動画がコメント付きで全画面表示になります。

とりあえず雑にえいやーで自分用に作ったので仕様変更などで使えなくなるかもしれません。

一応、フォーマットしたコードも下に貼っておきますね。

javascript:(() => {
    // 画面をフルスクリーンにしてコメントの読み込みを待機して表示する
    showComment = function () {
        document.querySelector('.c-tv-SlotPlayerContainer').style.position = 'inherit';
        document.querySelector('.com-a-Video__video').style.position = 'fixed';
        document.querySelector('.c-tv-TimeshiftSlotContainerView-detail').style.display = 'none';
        ret = function () {
            if (document.querySelector('.com-archive-comment-ArchiveCommentList--zero')) {
                document.querySelector('.com-a-Button--secondary').click();
                setTimeout(ret, 500);
            }
        };
        ret();
    };
    // 動画の読み込みを待機
    waitVideo = function () {
        setTimeout(() => {
            if (!document.querySelector('.c-tv-TimeshiftSlotContainerView-player')) {
                waitVideo();
            } else {
                showComment();
            }
        }, 500);
    };
    waitVideo();
})();