Greasy Fork

Greasy Fork is available in English.

移除飞书网页水印 | Remove watermarks of lark

移除飞书文档、工作台水印

当前为 2025-02-19 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name              移除飞书网页水印 | Remove watermarks of lark
// @description       移除飞书文档、工作台水印
// @name:zh-CN        移除飞书网页水印
// @description:zh-CN 移除飞书文档、工作台水印
// @name:en           Remove watermarks of lark
// @description:en    Remove watermarks from Lark documents and workspace.
// @version           0.7.2
// @license           The Unlicense
// @author            lbb00
// @homepage          https://github.com/lbb00/remove-feishu-watermark
// @match             https://*.feishu.cn/*
// @match             https://*.larksuite.com/*
// @match             https://*.larkoffice.com/*
// @run-at            document-start
// @grant             GM_addStyle
// @namespace http://greasyfork.icu/users/793340
// ==/UserScript==

// GM_addStyle has removed from Greasemonkey v4.0
// https://groups.google.com/g/greasemonkey-users/c/KW71DL6Yjng
if (typeof GM_addStyle === 'undefined') {
  this.GM_addStyle = (aCss) => {
    'use strict'
    const head = document.getElementsByTagName('head')[0]
    if (head) {
      const style = document.createElement('style')
      style.setAttribute('type', 'text/css')
      style.textContent = aCss
      head.appendChild(style)
      return style
    }
    return null
  }
}

const bgImageNone = '{background-image: none !important;}'
function genStyle(selector) {
  return `${selector}${bgImageNone}`
}

// global
GM_addStyle(genStyle('[class*="watermark"]'))
GM_addStyle(genStyle('[style*="pointer-events: none"]'))

// 飞书文档
GM_addStyle(genStyle('.ssrWaterMark'))
GM_addStyle(genStyle('body>div>div>div>div[style*="position: fixed"]:not(:has(*))'))
// firefox not support :has()
GM_addStyle(genStyle('[class*="TIAWBFTROSIDWYKTTIAW"]'))

// fixed for https://github.com/lbb00/remove-feishu-watermark/issues/3
GM_addStyle(genStyle('body>div[style*="position: fixed"]:not(:has(*))')) // for readonly

// 工作台
GM_addStyle(genStyle('#watermark-cache-container'))
GM_addStyle(genStyle('body>div[style*="inset: 0px;"]:not(:has(*))'))

// Web 聊天
GM_addStyle(genStyle('.chatMessages>div[style*="inset: 0px;"]'))