CodeHS Video Skipper

Skips videos in CodeHS assignments.

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         CodeHS Video Skipper
// @namespace    https://thetridentguy.com
// @version      1.0.1
// @description  Skips videos in CodeHS assignments.
// @author       TheTridentGuy
// @match        https://codehs.com/student/*/section/*/assignment/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=codehs.com
// @run-at document-idle
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
    let done_button = document.getElementById("done-button");
    if(done_button){
        fetch("/lms/ajax/submit_assignment", {
            method: "POST",
            headers: {
                "X-Csrftoken": new RegExp(/(?<=csrftoken=)[a-zA-Z0-9]+/gm).exec(document.cookie)[0],
                "X-Requested-With": "XMLHttpRequest",
                "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
            },
            body: `student_assignment_id=${document.querySelector("[data-said].current").dataset.said}&method=submit_assignment`
        });
        done_button.click();
    }
})();