一、安裝 Edge 瀏覽器
Win10 和 Win11 預設自帶 Edge 瀏覽器,其他系統可以通過下面的地址下載。
https://www.microsoft.com/zh-cn/edge/download?form=MA13FJ
二、安裝油猴插件
又名篡改猴、Tampermonkey,Edge 應用商店地址如下:
三、安裝 “讓你的飛書更好用” 腳本
- 在線安裝
訪問下面的網站,點擊 “立即安裝”。
https://env-00jxt5o5005s-static.normal.cloudstatic.cn/index.html#/pages/list/detail?id=473205&host=greasyfork
隨後會跳轉到腳本安裝界面,點擊 “安裝”。
2. 本地安裝
點擊油猴插件,然後點擊 “添加新腳本”。
:::div{style="max=width: 150px"}
:::
複製下面的代碼到打開的窗口。
// ==UserScript==
// @name 讓你的飛書更好用(優化版)
// @license GPL License
// @namespace https://bytedance.com
// @version 0.5
// @description 讓飛書文檔不受權限限制,可以複製任意內容,可以打開右鍵菜單(複製下載圖片)
// @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 () {
// Override addEventListener to handle copy and contextmenu events
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);
};
};
// Override XMLHttpRequest to manipulate permission responses
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('Failed to modify response:', e);
}
}
}, false);
rawOpen.call(this, method, url, ...rest);
};
};
// Run overrides immediately and on DOMContentLoaded
overrideEventListeners();
overrideXHR();
document.addEventListener('DOMContentLoaded', () => {
overrideEventListeners();
overrideXHR();
});
})();
四、瀏覽器開啟開發者模式
要讓篡改猴正常運行,需要開啟開發者模式。點擊擴展按鈕 - 管理擴展。
開啟 “開發人員模式”,然後將篡改猴插件關閉重新開啟。