├── LICENSE ├── README.md ├── manifest.json ├── res ├── example.png └── icon.jpg └── src ├── main.js ├── preload.js └── renderer.js /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 FW27623 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # remove_nav_sidebar 2 | ### 删除QQNT版本左边导航栏的按钮 3 | 4 | **2023年08月11日,QQ最新版本(QQ9.9.2.15962)增加了侧边栏管理的选项,我想如果后续不再增加一些非常讨厌而且无法控制的侧边栏的话,这个插件就可以退休了😆。** 5 | 6 | 目前写的比较简陋,主要功能就是移除侧边栏按钮,不过能用就行。可以看代码自行更改,代码都写了较为详尽的注释。 7 | 8 | ### 使用方法(2023年7月16日重命名) 9 | - `git clone`或下载zip文件解压,将文件夹移动至`LiteLoaderQQNT数据目录/plugins/`目录下。 10 | - 打开`renderer.js`,然后修改`const removeIndexes = [3,4,5,6];`的内容,具体可看代码注释,里面写的非常清楚。 11 | - 重启QQNT或者打开[Chii DevTools的控制台](https://github.com/mo-jinran/chii-devtools)然后按下 `Ctrl+R` 刷新一下即可生效 12 | 13 | ![效果图](./res/example.png) 14 | 15 | P.S. 由于本项目的特殊性,必要时会删库跑路😂 16 | 17 | ## 开源协议 18 | 19 | [MIT License](./LICENSE) 20 | Copyright (c) 2023 FW27623 21 | -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 3, 3 | "type": "extension", 4 | "name": "删除侧边栏按钮", 5 | "slug": "remove_nav_sidebar", 6 | "description": "删除指定的侧边栏按钮", 7 | "thumbnail": "./res/icon.jpg", 8 | "version": "0.1.5", 9 | "author": { 10 | "name": "FW27623", 11 | "link": "https://github.com/FW27623" 12 | }, 13 | "repository": { 14 | "repo": "FW27623/remove_nav_sidebar", 15 | "branch": "main", 16 | "use_release": { 17 | "tag": "0.1.5", 18 | "name": "remove_nav_sidebar.zip" 19 | } 20 | }, 21 | "platform": [ 22 | "win32", 23 | "linux", 24 | "darwin" 25 | ], 26 | "injects": { 27 | "renderer": "./src/renderer.js", 28 | "main": "./src/main.js", 29 | "preload": "./src/preload.js" 30 | } 31 | } -------------------------------------------------------------------------------- /res/example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FW27623/remove_nav_sidebar/c36e564256efee27310908452d57fbc77a05ca46/res/example.png -------------------------------------------------------------------------------- /res/icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FW27623/remove_nav_sidebar/c36e564256efee27310908452d57fbc77a05ca46/res/icon.jpg -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | const { BrowserWindow, ipcMain } = require("electron"); 2 | 3 | function onLoad(plugin) { 4 | // 监听删除按钮请求 5 | ipcMain.handle("LiteLoader.removeLastButton", () => { 6 | // 获取主窗口 7 | const mainWindow = BrowserWindow.getAllWindows()[0]; 8 | const webContents = mainWindow.webContents; 9 | 10 | // 在主窗口的渲染进程中执行 JavaScript 11 | webContents.executeJavaScript(` 12 | // 查找所有侧边栏按钮 13 | const buttons = document.querySelectorAll('.sidebar__upper div.nav-item'); 14 | // 获取最后一个按钮 15 | const lastButton = buttons[buttons.length - 1]; 16 | // 从父节点中移除最后一个按钮 17 | lastButton.parentNode.removeChild(lastButton); 18 | `); 19 | }); 20 | } 21 | 22 | module.exports = { 23 | onLoad, 24 | }; -------------------------------------------------------------------------------- /src/preload.js: -------------------------------------------------------------------------------- 1 | const { contextBridge, ipcRenderer } = require("electron"); 2 | 3 | contextBridge.exposeInMainWorld("removeLastButton", () => ipcRenderer.invoke("LiteLoader.removeLastButton")); -------------------------------------------------------------------------------- /src/renderer.js: -------------------------------------------------------------------------------- 1 | export function onLoad() { 2 | // 定时器,用于检查按钮是否加载完成 3 | const interval = setInterval(() => { 4 | // 查找侧边栏按钮 5 | const buttons = document.querySelectorAll(".sidebar__upper div.nav-item"); 6 | if (buttons.length > 3) { 7 | clearInterval(interval); 8 | // 定义要删除的按钮的索引数组 9 | //0:聊天 1:好友界面 2:QQ空间 3:频道 4:小世界 5:QQ游戏中心 6:腾讯文档 10 | //以上按你实际按钮为准,比如要删除频道,小世界,QQ游戏中心和腾讯文档就输入[3,4,5,6] 11 | //中间以英文状态下的逗号隔开 12 | const removeIndexes = [3,4,5,6]; 13 | // 遍历索引数组并删除指定的按钮 14 | removeIndexes.forEach((index) => { 15 | const button = buttons[index]; 16 | button.parentNode.removeChild(button); 17 | }); 18 | } 19 | }, 100); 20 | } 21 | --------------------------------------------------------------------------------