CodeHS Video Skipper

Skips videos in CodeHS assignments.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==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();
    }
})();