B站专栏复制解锁

B站专栏文章内容复制解锁

// ==UserScript==
// @name         B站专栏复制解锁
// @namespace    limgmk/bilibili-article-copy-unlock
// @version      0.0.1
// @description  B站专栏文章内容复制解锁
// @author       Limgmk
// @include     http*://www.bilibili.com/read/cv*
// @run-at      document-end
// ==/UserScript==

(function () {
    unlock();
})();

function unlock() {
    var head = getElementByXpath("//head");
    var style = document.createElement("style");
    style.innerHTML = `
        .article-holder.unable-reprint {
            user-select: text;
            -webkit-user-select: text;
        }
    `
    head.insertBefore(style, null);
}

function getElementByXpath(xpath) {
    return document.evaluate(xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
}