first commit
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
index.html
|
||||
27
README.md
Normal file
27
README.md
Normal file
@@ -0,0 +1,27 @@
|
||||
## 🚀 Fuck Code Blog👎👎👎
|
||||
|
||||
一款谷歌浏览器插件,精简一些技术网站的烦人操作,目前支持:
|
||||
|
||||
- 知乎问答 & 知乎专栏
|
||||
- csdn博客
|
||||
- 简书
|
||||
- 掘金
|
||||
- 更多网站持续增加中...
|
||||
|
||||
移除上述技术网站的一些功能:
|
||||
|
||||
- **未登录禁止复制**
|
||||
- 复制弹窗提示登录
|
||||
- **各种 复制代码 带 版权信息**
|
||||
- 手动展开代码全文
|
||||
- 各种广告信息,下载app,关注博主,阅读全文,小提示,干扰阅读的动画
|
||||
- **打开外站链接的提示**
|
||||
- 等...
|
||||
|
||||
## 使用
|
||||
|
||||
右上角 **下载zip** --> 解压缩包,得到文件夹,放到一个常年不动的路径 --> 然后打开 **更多工具** --> **拓展程序** --> 打开 **开发者模式** --> **加载已解压的拓展程序** --> 找到刚解压的文件夹即可。
|
||||
|
||||
> **安装好后,不需要登录,打开一篇CSDN的博客文章详情,尽情的随意复制吧!Ctrl + V 走起...**
|
||||
|
||||
**还不会操作,可以百度。。。。**
|
||||
1
css/.pydio
Normal file
1
css/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
5bbf4b30-33e8-4abc-86c0-00a02e8ed1b9
|
||||
61
css/cover.css
Normal file
61
css/cover.css
Normal file
@@ -0,0 +1,61 @@
|
||||
/* csdn */
|
||||
#content_views,
|
||||
#content_views pre,
|
||||
#content_views pre code {
|
||||
user-select: text !important;
|
||||
}
|
||||
|
||||
#article_content {
|
||||
height: auto !important;
|
||||
overflow: auto !important;
|
||||
}
|
||||
|
||||
.hljs-button,
|
||||
.signin,
|
||||
.hide-article-box,
|
||||
.tool-active-list,
|
||||
.programmer1Box,
|
||||
#articleSearchTip,
|
||||
.passport-login-container,
|
||||
.box-shadow,
|
||||
.mb8, #kp_box_www_swiper_ban, .blog-top-banner,
|
||||
#kp_box_blog_up, .blog-slide-ad-box,
|
||||
#asideNewNps,
|
||||
#recommendAdBox,
|
||||
#asideWriteGuide,
|
||||
#footerRightAds,
|
||||
.passport-login-tip-container,
|
||||
.sidetool-writeguide-box,
|
||||
.common-nps-box{
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* 知乎 */
|
||||
html,
|
||||
body{
|
||||
overflow-y: scroll !important;
|
||||
overflow-x: hidden !important;
|
||||
margin-right: 0px !important;
|
||||
}
|
||||
.Modal-wrapper,
|
||||
.AppBanner,
|
||||
.css-1wq6v87{
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* 简书 */
|
||||
div[class$=mask]{
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
div[class$=mask]+div {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
|
||||
/* 掘金 */
|
||||
.bottom-login-guide,
|
||||
.meiqia-btn,
|
||||
.vip-entry {
|
||||
display: none !important;
|
||||
}
|
||||
22
js/cover.js
Normal file
22
js/cover.js
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* 版权所有:bmy
|
||||
* 邮箱:2271608011@qq.com
|
||||
* 备注:代码没啥好看的,写给自己用
|
||||
*/
|
||||
|
||||
// 注入js文件
|
||||
|
||||
let scriptUrl = [
|
||||
'/js/jquery-1.9.1.min.js',
|
||||
'/js/script.js'
|
||||
]
|
||||
|
||||
if(document.head) {
|
||||
scriptUrl.forEach(v => createdScript(v))
|
||||
}
|
||||
|
||||
function createdScript(path) {
|
||||
let script = document.createElement('script');
|
||||
script.src = chrome.runtime.getURL(path);
|
||||
document.head.appendChild(script)
|
||||
}
|
||||
20
js/jquery-1.9.1.min.js
vendored
Normal file
20
js/jquery-1.9.1.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
92
js/script.js
Normal file
92
js/script.js
Normal file
@@ -0,0 +1,92 @@
|
||||
/**
|
||||
* 版权所有:bmy
|
||||
* 邮箱:2271608011@qq.com
|
||||
* 备注:代码没啥好看的,写给自己用
|
||||
*/
|
||||
|
||||
setTimeout(() => {
|
||||
let currentURL = location.href;
|
||||
let webSiteUrl = {
|
||||
csdn: "blog.csdn.net",
|
||||
zhihu: {
|
||||
home: "www.zhihu.com",
|
||||
zhuanlan: "zhuanlan.zhihu.com",
|
||||
},
|
||||
jianshu: "www.jianshu.com",
|
||||
juejin: "juejin.cn",
|
||||
};
|
||||
|
||||
let clearHref = (el, tarAttr = "?target=") => {
|
||||
$(el)
|
||||
.eq(0)
|
||||
.find("a")
|
||||
.each(function () {
|
||||
let href = $(this).attr("href");
|
||||
if (href != undefined && href.includes(tarAttr)) {
|
||||
// 针对掘金的一些特殊情况进行处理,href会莫名其妙多出一次target
|
||||
if ( (href.split("target").length - 1) == 2) {
|
||||
let url = decodeURIComponent(decodeURIComponent(href).split("?target=")[2])
|
||||
$(this).attr("href", url);
|
||||
} else {
|
||||
$(this).attr("href", decodeURIComponent(href.split(tarAttr)[1]));
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
let clearCopy = (el) => {
|
||||
let newArticle = $(el).eq(0).clone();
|
||||
$(el).eq(0).replaceWith(newArticle);
|
||||
};
|
||||
|
||||
if (currentURL.includes(webSiteUrl.csdn)) {
|
||||
// 分析源网站的代码,链接是这个:
|
||||
// https://csdnimg.cn/release/blogv2/dist/pc/js/detail-0ce0e42bff.min.js
|
||||
|
||||
// https://csdnimg.cn/release/blogv2/dist/pc/js/detail-4c4f40c1d8.min.js
|
||||
// https://g.csdnimg.cn/common/csdn-toolbar/csdn-toolbar.js
|
||||
|
||||
// 自动展开所有折叠的代码
|
||||
$(".hide-preCode-bt").click();
|
||||
|
||||
window.articleType = -1;
|
||||
window.copyPopSwitch = false;
|
||||
|
||||
clearCopy("#content_views");
|
||||
|
||||
// 重新修复文章正文a标签的所有点击事件
|
||||
$("#content_views").on("click", "a", function (t) {
|
||||
var a = $(this).attr("href") || "";
|
||||
t.preventDefault();
|
||||
window.open(a, "_blank");
|
||||
});
|
||||
} else if (
|
||||
currentURL.includes(webSiteUrl.zhihu.zhuanlan) ||
|
||||
currentURL.includes(webSiteUrl.zhihu.home)
|
||||
) {
|
||||
// 展开问题的全文
|
||||
$(".QuestionRichText-more").click();
|
||||
|
||||
// 展开阅读全文 需要登录才可以
|
||||
$(".ContentItem-expandButton").click();
|
||||
|
||||
|
||||
clearHref("body");
|
||||
|
||||
let eachContent = () =>
|
||||
$(".RichContent").each(function () {
|
||||
clearCopy(this);
|
||||
});
|
||||
eachContent();
|
||||
|
||||
let Observe = new MutationObserver((mutations, observer) => eachContent());
|
||||
Observe.observe($(".css-0")[0], { childList: true, attributes: true });
|
||||
|
||||
} else if (currentURL.includes(webSiteUrl.jianshu)) {
|
||||
clearCopy("div[role=main] section");
|
||||
clearHref("div[role=main] section", "?t=");
|
||||
} else if (currentURL.includes(webSiteUrl.juejin)) {
|
||||
clearCopy("#article-root");
|
||||
clearHref(".main-area .article")
|
||||
}
|
||||
}, 300);
|
||||
21
manifest.json
Normal file
21
manifest.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"manifest_version": 3,
|
||||
"name": "🚀 Fuck Code Blog👎👎👎",
|
||||
"version": "1.0.0",
|
||||
"author": "2271608011@qq.com",
|
||||
"description": "去除一些技术网站的恶心操作!!",
|
||||
"web_accessible_resources": [
|
||||
{
|
||||
"resources": [ "/js/*.js" ],
|
||||
"matches": [ "https://blog.csdn.net/*","https://zhuanlan.zhihu.com/*", "https://www.zhihu.com/*", "https://www.jianshu.com/*", "https://juejin.cn/*" ]
|
||||
}
|
||||
],
|
||||
"content_scripts": [
|
||||
{
|
||||
|
||||
"matches": ["https://blog.csdn.net/*", "https://zhuanlan.zhihu.com/*", "https://www.zhihu.com/*", "https://www.jianshu.com/*", "https://juejin.cn/*"],
|
||||
"css": ["./css/cover.css"],
|
||||
"js": ["./js/cover.js"]
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user