atcoder_all_open

問題Tabの隣に全ての問題を(ワンクリックで)開く全ての問題Tabを作成します。うまく動かない場合はatcoder上でのポップアップ制限を外して下さい

25.04.2021 itibariyledir. En son verisyonu görün.

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

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 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.

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

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     atcoder_all_open
// @namespace jp.misw
// @author hotman
// @description 問題Tabの隣に全ての問題を(ワンクリックで)開く全ての問題Tabを作成します。うまく動かない場合はatcoder上でのポップアップ制限を外して下さい
// @version  1.0.6
// @include  https://atcoder.jp/contests/*
// @exclude  https://atcoder.jp/contests/
// @exclude  https://atcoder.jp/contests/archive
// @grant    none
// @description 問題Tabの隣に全ての問題を(ワンクリックで)開く全ての問題Tabを作成します。うまく動かない場合はatcoder上でのポップアップ制限を外して下さい
// ==/UserScript==


function toURL(){
    var url=location.href;
    var contest_name=location.href.split('/')[4];
    var req=`https://asia-northeast1-atcoder-all-open-api.cloudfunctions.net/api?id=${contest_name}`;
    let xhr = new XMLHttpRequest();
    xhr.open('GET',req);
    xhr.onload = () => {
      let res = JSON.parse(xhr.response);
      for(let url in res){
          window.open(url);
      }
    }
    xhr.send();
}


function all_open(){
    var url=location.href;
    var parent=document.getElementsByClassName("nav nav-tabs")[0];
    var add=document.createElement("li");
    parent.insertBefore(add,parent.children[2]);
    var a=document.createElement("a");
    add.appendChild(a);
    a.textContent="全ての問題";
    a.setAttribute("href","javascript:void(0);");
    a.addEventListener('click',toURL, false);
}
all_open();