Greasy Fork

Greasy Fork is available in English.

【飞书文档】真的兼容我的浏览器 | Feishu doc is really compatible with my browser

隐藏“浏览器不兼容”提示 | Hide "not compatible" banner

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         【飞书文档】真的兼容我的浏览器 | Feishu doc is really compatible with my browser
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  隐藏“浏览器不兼容”提示 | Hide "not compatible" banner
// @author       lideming
// @match        https://*.feishu.cn/docx/*
// @match        https://*.feishu.cn/drive/*
// @match        https://*.feishu.cn/wiki/*
// @icon         https://www.feishu.cn/favicon.ico
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
    waitForElm('.not-compatible__announce').then(dom => {
        // dom.querySelector('.not-compatible__announce .ud__notice__close').click();
        dom.hidden = true;
    });

    function waitForElm(selector) {
        return new Promise(resolve => {
            if (document.querySelector(selector)) {
                return resolve(document.querySelector(selector));
            }

            let found = false;
            const timer = setTimeout(() => {
                observer.disconnect();
                console.error("waitForElm timeout");
                // not resolving/rejecting
            }, 5000);
            const observer = new MutationObserver(mutations => {
                for (const m of mutations) {
                    for (const node of m.addedNodes) {
                        if (node.matches(selector)) {
                            clearTimeout(timer);
                            found = true;
                            observer.disconnect();
                            return resolve(node);
                        }
                    }
                }
            });

            observer.observe(document.body, {
                childList: true,
                subtree: true
            });
        });
    }
})();