Firefox browser plug-in study notes

Instructions:

  1. Create a manifest.json file, set the properties according to the following example, pay attention to the version in the future maintenance and update, remember to increase, so that it is easy to manage
  2. Create the app.js file, write the functions to be implemented, and then package the two files into "GJL2CJ_Plugin.zip", GJL2CJ_Plugin is the plug-in name I set
  3. Open https://addons.mozilla.org/zh-CN/developers/ and log in. If you don’t have an account, register first and then log in to submit new add-ons
  4. Choose public or private, PC or Android (or both), and upload the zip file, choose whether to use certain functions, upload the zip file again, and confirm
  5. Wait a while, open the email link, click the xpi file, click install, you can use it

manifest.json

{
    
    
    "manifest_version": 2,
    "name": "GJL2CJ_Plugin",
    "version": "4.0",
    "content_scripts": [
      {
    
    
        "matches": ["https://blog.csdn.net/cj1064789374/article/details/*"],
        "js": ["app.js"]
      }
    ]
  }

app.js

/* 上 */
document.getElementById("csdn-toolbar").style.backgroundColor="black"/* 标题栏 */
document.getElementById("toolbar-search-input").style.backgroundColor="black"/* 搜索框 */

/* 左 */
document.getElementsByClassName("blog_container_aside")[0].style.opacity=0/* 左边全空(单独用会无效) */
document.getElementById("asideProfile").style.opacity=0/* 个人信息 */
document.getElementById("asideSearchArticle").style.opacity=0/* 搜索框 */
document.getElementById("asideHotArticle").style.opacity=0/* 热门文章 */
document.getElementById("asideNewComments").style.opacity=0/* 最新评论 */
document.getElementById("asideCategory").style.opacity=0/* 分类专栏(目录页才有) */
document.getElementById("asideArchive").style.opacity=0/* 最新文章 */

/* 浮 */
document.getElementsByClassName("csdn-side-toolbar")[0].style.opacity=0/* 四个按钮 */

/* 中 */
document.getElementsByClassName("article-header-box")[0].style.backgroundColor="black"/* 标题 */
document.getElementsByClassName("article-info-box")[0].style.backgroundColor="black"/* 副标题 */
document.getElementsByClassName("blog-content-box")[0].style.backgroundColor="black"/* 文章背景色 */
document.getElementsByClassName("blog-content-box")[0].style.color="white"/* 文章正文色 */
document.getElementsByClassName("left-toolbox")[0].style.backgroundColor="black"/* 点赞 */
document.getElementsByClassName("comment-box")[0].style.backgroundColor="black"/* 评论 */
document.getElementsByClassName("recommend-tit-mod")[0].style.backgroundColor="black"/* 相关推荐标题 */
document.getElementsByClassName("recommend-box insert-baidu-box")[0].style.opacity=0/* 相关推荐 */
document.getElementsByClassName("first-recommend-box recommend-box")[0].style.opacity=0/* 第一推荐 */
document.getElementsByClassName("second-recommend-box recommend-box")[0].style.opacity=0/* 第二推荐 */

/* 右 */
document.getElementById("rightAside").style.opacity=0/* 右边全空 */

/* 底 */
document.getElementsByClassName("template-box")[0].style.opacity=0/* 底一 */
document.getElementById("copyright-box").style.opacity=0/* 底二 */

Guess you like

Origin blog.csdn.net/cj1064789374/article/details/114580252