IT blog Helper

对部分论坛网站实现 自动展开隐藏内容 / 免登陆复制 / 去除遮掩内容 Lite,持续更新中

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name     IT blog Helper
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  对部分论坛网站实现 自动展开隐藏内容 / 免登陆复制 / 去除遮掩内容 Lite,持续更新中
// @author       You
// @match        *.it1352.com/*
// @match        *.qianduanheidong.com/*
// @match        https://blog.csdn.net/*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// @require           https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js
// @license MIT

// ==/UserScript==

// console.log("===============>>>>>>>>>>自动展开隐藏内容 / 去除遮掩内容 脚本触发");

// console.log($.cookie)

var map = {}
map['^https?:\/\/.*?\.it1352.com.*?'] = ()=>{
    var cookies = document.cookie.split('; ');
    //if(!cookies.some(cookie => cookie==='olduser=1')){ // compatible backup
    if(!cookies.includes('olduser=1')){
        document.cookie = 'olduser=1';
        window.location.reload();
    }
}
// const regx = /^https?:\/\/.*?\.qianduanheidong\.com.*?/g
map['^https?:\/\/.*?\.qianduanheidong\.com.*?'] = ()=>{
    $("#layui-layer1").css('display','none');
    $("#layui-layer-shade1").css('display','none');
    $("body").append("<script> if(user_login) {user_login = true} else {var user_login = true;}</script>");
    $("html").removeAttr("style");
}

// https://blog.csdn.net/chengqiuming/article/details/109958407
map['^https?:\/\/blog\.csdn\.net.*?'] = ()=>{

    // 免登录复制
    var cookies = document.cookie.split('; ');
    //if(!cookies.some(cookie => cookie==='olduser=1')){ // compatible backup
    if(!cookies.includes('hide_login=1')){
        document.cookie = 'hide_login=1;path=/';
        window.location.reload();
    }

    $('#content_views pre').attr("style","-webkit-touch-callout: inherit; -webkit-user-select: inherit; -khtml-user-select: inherit; -moz-user-select: inherit; -ms-user-select: inherit; user-select: inherit;");
    $('#content_views pre code').attr("style","-webkit-touch-callout: inherit; -webkit-user-select: inherit; -khtml-user-select: inherit; -moz-user-select: inherit; -ms-user-select: inherit; user-select: inherit;");


    // 非登录展开所有内容
    $('#article_content').removeAttr('style')
    $('div.hide-article-box').attr("style","display: none;")

}



const url = window.location.href
Object.keys(map).forEach( regxStr => {

    const regx = new RegExp(regxStr);
    if(regx.test(url)){
        map[regxStr]()
    }
});