在 CF 题目界面显示两个通往洛谷该题目的题面/ 题解的按钮
当前为
// ==UserScript==
// @name Codeforces to Luogu
// @namespace Perfect-Izayoi-Sakuya
// @version 0.1
// @description 在 CF 题目界面显示两个通往洛谷该题目的题面/ 题解的按钮
// @author LaoMang
// @license MIT
// @match https://codeforces.com/problemset/problem/*
// @icon https://img.atcoder.jp/assets/logo.png
// @grant none
// ==/UserScript==
(function() {
'use strict';
let hrf = window.location.href.split('/')
let idx = 'CF' + hrf.slice(-2)[0] + hrf.slice(-1)
let lst = document.querySelector('ul.second-level-menu-list')
let node1 = document.createElement('li'), node2 = document.createElement('li')
node1.innerHTML = '<a href="https://www.luogu.com.cn/problem/' + idx + '">Luogu statement</a>'
node2.innerHTML = '<a href="https://www.luogu.com.cn/problem/solution/' + idx + '">Luogu solution</a>'
lst.appendChild(node1)
lst.appendChild(node2)
})();