AtCoder Add link to Problems

Add links to AtCoder Problems Userpage on AtCoder profile.

נכון ליום 23-06-2023. ראה הגרסה האחרונה.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name           AtCoder Add link to Problems
// @namespace      https://github.com/yi7242
// @version        1.0
// @description    Add links to AtCoder Problems Userpage on AtCoder profile.
// @description:ja AtCoderのプロフィールページにAtCoder Problemsへのリンクを追加するユーザースクリプトです。
// @author         yi7242
// @match          https://atcoder.jp/users/*
// @license        MIT
// @exclude        https://atcoder.jp/users/?/history
// @exclude        https://atcoder.jp/users/?/history/*
// ==/UserScript==

(function() {
    'use strict';
    let dlTables = document.getElementsByClassName('dl-table');
    let tbody = dlTables[0].getElementsByTagName('tbody')[0];
    let userName = document.getElementsByClassName('username')[0].getElementsByTagName('span')[0].textContent;
    let link = "https://kenkoooo.com/atcoder/#/user/" + userName;
    let insertPoint = document.getElementsByClassName("col-md-3 col-sm-12")[0].getElementsByTagName('h3')[0];
    let newTr = '<tr><th class="no-break">Problems</th><td><a href=' +link+' target="_blank" style="">' + userName + '</a></td></tr>'
    tbody.insertAdjacentHTML("beforeend", newTr)
})();