拇指客

拇指客

专注于发现和分享互联网的新鲜事物!! 本站建立在Crossbell 区块链上,是面向所有人的最棒-链上-开源-博客社区
twitter

飛書ドキュメントがコピーできない場合はどうすればよいですか

image

一、Edge ブラウザのインストール

Win10 および Win11 にはデフォルトで Edge ブラウザが搭載されています。他のシステムは以下のアドレスからダウンロードしてください。

https://www.microsoft.com/zh-cn/edge/download?form=MA13FJ

二、油猴プラグインのインストール

別名:Tampermonkey、Edge アプリストアのアドレスは以下の通りです:

https://microsoftedge.microsoft.com/addons/detail/%E7%AF%A1%E6%94%B9%E7%8C%B4/iikmkjmpaadaobahmlepeloendndfphd

image

三、「あなたの Feishu をより使いやすく」スクリプトのインストール

  1. オンラインインストール

以下のウェブサイトにアクセスし、「今すぐインストール」をクリックします。
https://env-00jxt5o5005s-static.normal.cloudstatic.cn/index.html#/pages/list/detail?id=473205&host=greasyfork

image
その後、スクリプトインストール画面にリダイレクトされ、「インストール」をクリックします。

image
2. ローカルインストール

油猴プラグインをクリックし、「新しいスクリプトを追加」をクリックします。

image:::div{style="max=width: 150px"}

:::
以下のコードを開いたウィンドウにコピーします。


// ==UserScript==
// @name         あなたのFeishuをより使いやすく(最適化版)
// @license      GPL License
// @namespace    https://bytedance.com
// @version      0.5
// @description  Feishuドキュメントの権限制限を解除し、任意の内容をコピーでき、右クリックメニュー(画像をコピー・ダウンロード)を開けるようにします。
// @author       NOABC
// @match        *://*.feishu.cn/*
// @match        *://*.larkoffice.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=feishu.cn
// @grant        none
// @run-at       document-start
// @downloadURL https://update.greasyfork.org/scripts/473205/%E8%AE%A9%E4%BD%A0%E7%9A%84%E9%A3%9E%E4%B9%A6%E6%9B%B4%E5%A5%BD%E7%94%A8%28%E4%BC%98%E5%8C%96%E7%89%88%29.user.js
// @updateURL https://update.greasyfork.org/scripts/473205/%E8%AE%A9%E4%BD%A0%E7%9A%84%E9%A3%9E%E4%B9%A6%E6%9B%B4%E5%A5%BD%E7%94%A8%28%E4%BC%98%E5%8C%96%E7%89%88%29.meta.js
// ==/UserScript==
(function () {
    // copyおよびcontextmenuイベントを処理するためにaddEventListenerをオーバーライド
    const overrideEventListeners = () => {
        const rawAddEventListener = EventTarget.prototype.addEventListener;
        EventTarget.prototype.addEventListener = function (type, listener, options) {
            if (type === 'copy') {
                rawAddEventListener.call(this, type, event => {
                    event.stopImmediatePropagation();
                    return null;
                }, options);
                return;
            }
            if (type === 'contextmenu') {
                rawAddEventListener.call(this, type, event => {
                    event.stopImmediatePropagation();
                    return listener(event);
                }, options);
                return;
            }
            rawAddEventListener.call(this, type, listener, options);
        };
    };
    // 権限応答を操作するためにXMLHttpRequestをオーバーライド
    const overrideXHR = () => {
        const rawOpen = XMLHttpRequest.prototype.open;
        XMLHttpRequest.prototype.open = function (method, url, ...rest) {
            this.addEventListener('readystatechange', function () {
                if (this.readyState === 4 && url.includes('space/api/suite/permission/document/actions/state/')) {
                    let response = this.responseText;
                    try {
                        response = JSON.parse(response);
                        if (response.data && response.data.actions && response.data.actions.copy !== 1) {
                            response.data.actions.copy = 1;
                            Object.defineProperty(this, 'responseText', { value: JSON.stringify(response) });
                            Object.defineProperty(this, 'response', { value: response });
                        }
                    } catch (e) {
                        console.error('応答の変更に失敗しました:', e);
                    }
                }
            }, false);
            rawOpen.call(this, method, url, ...rest);
        };
    };
    // すぐにオーバーライドを実行し、DOMContentLoaded時にも実行
    overrideEventListeners();
    overrideXHR();
    document.addEventListener('DOMContentLoaded', () => {
        overrideEventListeners();
        overrideXHR();
    });
})();

四、ブラウザで開発者モードを有効にする
Tampermonkey を正常に動作させるには、開発者モードを有効にする必要があります。拡張ボタンをクリックし、拡張機能を管理します。

image
「開発者モード」を有効にし、次に Tampermonkey プラグインをオフにして再度オンにします。

image

読み込み中...
文章は、創作者によって署名され、ブロックチェーンに安全に保存されています。