// ==UserScript==
// @name ☄️拷贝漫画增强☄️
// @namespace http://tampermonkey.net/
// @version 5.4
// @description 拷贝漫画去广告🚫,对日漫版漫画页进行增强:并排布局📖、图片高度自适应↕️、辅助翻页↔️、页码显示⏱、侧边目录栏📑、暗夜模式🌙,请设置即时注入模式以避免页面闪烁⚠️
// @author Byaidu
// @match *://*.copymanga.com/*
// @license GNU General Public License v3.0 or later
// @resource animate_css https://cdn.jsdelivr.net/npm/animate.css@4.1.1/animate.min.css
// @resource element_css https://unpkg.com/element-ui@2.15.0/lib/theme-chalk/index.css
// @require https://cdn.jsdelivr.net/npm/vue@2.6.12/dist/vue.min.js
// @require https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js
// @require https://cdn.jsdelivr.net/npm/jquery.cookie@1.4.1/jquery.cookie.js
// @require https://unpkg.com/element-ui@2.15.0/lib/index.js
// @require https://cdn.jsdelivr.net/npm/crypto-js@4.1.1/crypto-js.js
// @grant GM_addStyle
// @grant GM_getResourceText
// @grant GM_xmlhttpRequest
// @run-at document-start
// @downloadURL none
// ==/UserScript==
unsafeWindow.eval=()=>{}
$(function() {
var AES_Encrypt = document['querySelector']('.disData')['getAttribute']('contentKey')
, AES_Key_ = (document['querySelector']('.disUrlPrefix')['getAttribute']('contentKey'),
document['querySelector']('.disUrlSuffix')['getAttribute']('contentKey'),
document['querySelector']('.disPass')['getAttribute']('contentKey'))
, AES_IV_ = AES_Encrypt['substring'](0x0, 0x10)
, AES_Content_ = AES_Encrypt['substring'](0x10, AES_Encrypt['length'])
, AES_Key = CryptoJS['enc']['Utf8']['parse'](AES_Key_)
, AES_IV = CryptoJS['enc']['Utf8']['parse'](AES_IV_)
, AES_Decrypt_JSON = function(AES_Content) {
var AES_Content_Hex = CryptoJS['enc']['Hex']['parse'](AES_Content)
, AES_Content_Base64 = CryptoJS['enc']['Base64']['stringify'](AES_Content_Hex);
return CryptoJS['AES']['decrypt'](AES_Content_Base64, AES_Key, {
'iv': AES_IV,
'mode': CryptoJS['mode']['CBC'],
'padding': CryptoJS['pad']['Pkcs7']
})['toString'](CryptoJS['enc']['Utf8'])['toString']()
}(AES_Content_)
, AES_Decrypt = JSON['parse'](AES_Decrypt_JSON)
, content = document['querySelector']('.comicContent-list')
, idx = 0x0;
function createContent() {
var el = document['createElement']('li');
//_0x4c700e['innerHTML'] = '',
el['innerHTML'] = '
',
idx++,
content['append'](el)
}
for (var i = 0x0; i < AES_Decrypt['length']; i++) {
createContent()
}
});
(function() {
'use strict';
//去广告
GM_addStyle('*[style*="position: relative;"]{display:none !important;}')
GM_addStyle('.header-jum{display:none !important;}')
GM_addStyle('.comicContainerAds{display:none !important;}')
//漫画页检测
if(location.href.indexOf("chapter")>=0){
//固定header
GM_addStyle('.header{position:unset !important;}')
//去除footer
GM_addStyle('.footer{display:none !important;}')
//文字居中
GM_addStyle('body{text-align:center !important;font-size:12px !important;line-height: normal !important;}')
//图片居中
GM_addStyle('ul{padding:0px !important;}')
//body全屏
GM_addStyle('body{height:unset !important;}')
//修改滚动条样式
GM_addStyle('::-webkit-scrollbar {width: 4px;height: 0px;}')
GM_addStyle('::-webkit-scrollbar-thumb {background-color: rgb(48,48,48);border-radius: 2px;}')
//修改element-ui样式
GM_addStyle('.el-menu{border-right:0px !important;}')
GM_addStyle('.el-drawer__wrapper{width:20%;}')
GM_addStyle('.el-drawer{background:transparent !important;}')
GM_addStyle('.el-drawer__body{background:rgba(0,0,0,.8) !important;overflow-y: auto}')
//去除图片边框
GM_addStyle('.comicContent{margin-top:20px;user-select: none;}')
GM_addStyle('.comicContent img{margin-bottom: 50px !important;width:unset !important;}')
//漫画双页排布
GM_addStyle('.page_double .comicContent ul{justify-content:center;flex-direction: row-reverse;display: flex;flex-wrap: wrap;}')
GM_addStyle('.page_double .comicContent img{height:100vh !important;}')
GM_addStyle('.comicContent-image-list{width:unset !important;}')
//引入css
const animate_css = GM_getResourceText("animate_css");
const element_css = GM_getResourceText("element_css");
GM_addStyle(animate_css);
GM_addStyle(element_css);
GM_addStyle(':root{--animate-duration:500ms;}')
//添加空页
GM_addStyle('.page_skip .blank{display:none !important;}')
//日间模式
GM_addStyle("body{background:#edecea !important;}")
//夜间模式
GM_addStyle("html{background:transparent !important;}")
GM_addStyle(".dark_mode body{background:#212121 !important;}")
//读取cookie
if ($.cookie('dark_mode') === undefined) { $.cookie('dark_mode',true,{expires:999999,path:'/'}); }
if ($.cookie('page_skip') === undefined) { $.cookie('page_skip',true,{expires:999999,path:'/'}); }
if ($.cookie('page_double') === undefined) { $.cookie('page_double',true,{expires:999999,path:'/'}); }
var dark_mode = $.cookie('dark_mode')=='true';
var page_skip = $.cookie('page_skip')=='true';
var page_double = $.cookie('page_double')=='true';
//暗夜模式
if (dark_mode){
$('html').addClass('dark_mode');
}else{
$('html').removeClass('dark_mode');
}
//插入空页
if (page_skip){
$('html').addClass('page_skip');
}else{
$('html').removeClass('page_skip');
}
//双页显示
if (page_double){
$('html').addClass('page_double');
}else{
$('html').removeClass('page_double');
}
$(()=>{
let img_id=0;
let id_lock=0;
let middle=0;
let ch_id=0;
//计算页数
window.g_max_pic_count=$('.comicContent ul img').length;
window.el = $( '' );
$('body').append(el);
//添加右下角菜单
let info = `