1
0
mirror of https://gitee.com/bitdance-team/chrome-extension synced 2025-01-10 13:48:14 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

阅读全文自动展开关联主面版开关

This commit is contained in:
程序员小墨 2022-02-10 04:38:18 +08:00
parent 5552577c0b
commit 9c13cb1fe9
2 changed files with 31 additions and 15 deletions

View File

@ -42,7 +42,7 @@ GitHub仓库https://github.com/bitdance-team/chrome-extension
郑丽天气展示功能翻译功能使用轻服务云函数构建Api
张君秋:网页截图功能
张君秋:网页截图功能PPT制作
张松:确认页直接跳转功能,番茄钟

View File

@ -1,5 +1,5 @@
$(function() {
console.log("[BitDance extension] 学生助手插件 - 阅读全文自动展开模块加载成功");
(async function() {
// 删除DOM
function removeDOM(querySelector) {
let element = document.querySelector(querySelector)
@ -7,11 +7,26 @@ $(function() {
element.parentNode.removeChild(element);
}
}
// 插件刚开始加载时,先读取一次状态
var isExpandFulltextActived = true;
isExpandFulltextActived = await new Promise((resolve) => {
chrome.storage.sync.get('State_ExpandFulltext', function (State) {
resolve(State.State_ExpandFulltext);
});
});
console.log(`isExpandFulltextActived: ${isExpandFulltextActived}`);
if(!isExpandFulltextActived)
return;
console.log("[BitDance extension] 学生助手插件 - 阅读全文自动展开模块加载成功");
switch (window.location.host) {
default:
break;
case "blog.csdn.net": // CSDN博客
$(function () {
removeDOM(".hide-article-box");
$(".article_content").removeAttr('style');
window.onload = () => {
@ -23,6 +38,7 @@ $(function() {
}
})
}
})
break;
case "www.it1352.com": // it1352
@ -34,4 +50,4 @@ $(function() {
break;
}
})
})();