You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何用Tampermonkey永久隐藏Google Docs侧边栏切换按钮DIV

使用Tampermonkey永久隐藏Google Docs侧边栏切换按钮容器

步骤1:准备Tampermonkey

确保你已经在Chrome浏览器中安装了Tampermonkey扩展,未安装的话直接在Chrome应用商店搜索安装即可。

步骤2:创建用户脚本

  1. 点击浏览器右上角的Tampermonkey图标,选择「管理面板」进入脚本管理页面
  2. 点击左侧菜单栏的「+」按钮,创建新的空白脚本
  3. 删除页面中默认的模板代码,替换为以下脚本:
// ==UserScript==
// @name         隐藏Google Docs侧边栏切换按钮
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  永久隐藏Google Docs右下角的侧边栏切换按钮容器,让文档居中显示
// @author       自定义你的名字
// @match        https://docs.google.com/document/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // 注入自定义CSS样式
    const customStyle = document.createElement('style');
    customStyle.textContent = `
        .companion-collapser-button-container {
            display: none !important;
        }
    `;
    document.head.appendChild(customStyle);
})();

步骤3:保存并生效

  1. 按下Ctrl+S(Windows)或Cmd+S(Mac)保存脚本
  2. 刷新你的Google Docs文档页面,右下角的<按钮容器就会被永久隐藏,文档也会自动居中显示

说明

  • @match 字段确保脚本只会在Google Docs的文档页面生效,不会影响其他网站
  • 添加!important是为了确保我们的CSS样式优先级高于页面原有样式,避免被覆盖

内容的提问来源于stack exchange,提问作者Bastiaan Quast

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.25 10:33:13