CSDN-copy-without-login

Allow copying code in CSDN posts without logging in.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         CSDN-copy-without-login
// @namespace    lytning98_CSDN-copy-without-login
// @version      0.1
// @description  Allow copying code in CSDN posts without logging in.
// @author       lytning98
// @source       https://github.com/lytning98/CSDN-copy-without-login
// @match        https://blog.csdn.net/*/article/details/*
// @require      https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    var engine = hljs.copyCode ? 'hljs' : 'mdcp';
    var $bindee = engine == 'hljs' ? $('.hljs-button.signin') : $('.prettyprint > code');

    eval(engine).signin = Function();
    $bindee.attr('onclick', engine + '.copyCode(event)');
    $('.hljs-button.signin').attr('class', 'hljs-button {2}').attr('data-title', '不登录也复制');

})();