您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
让飞书文档不受权限限制,可以复制任意内容,可以打开右键菜单(复制下载图片)
当前为
// ==UserScript== // @name 让你的飞书更好用(优化版) // @license GPL License // @namespace https://bytedance.com // @version 0.3 // @description 让飞书文档不受权限限制,可以复制任意内容,可以打开右键菜单(复制下载图片) // @author NOABC // @match *://*.feishu.cn/* // @icon https://www.google.com/s2/favicons?sz=64&domain=feishu.cn // @grant none // @run-at document-start // ==/UserScript== (function () { document.addEventListener('DOMContentLoaded', function () { const rawAddEventListener = document.addEventListener; document.addEventListener = function (type, listener, options) { if(type === 'copy') { rawAddEventListener.call( document, type, event => { return null; }, options, ); return } rawAddEventListener.call( document, type, listener, options, ); }; const bodyAddEventListener = document.body.addEventListener; document.body.addEventListener = function (type, listener, options) { bodyAddEventListener.call( document.body, type, event => { if (type === 'contextmenu') { return true; } return listener(event); }, options, ); }; }); XMLHttpRequest.prototype._open = XMLHttpRequest.prototype.open; XMLHttpRequest.prototype.open = function (...args) { const [ method, url ] = args; if (method !== 'POST' || !url.includes('space/api/suite/permission/document/actions/state/')) { return this._open(...args); } this.addEventListener("readystatechange", function() { if (this.readyState !== 4) return; let response = this.response; try { response = JSON.parse(response); } catch(e) {}; console.log('debug:', response); if (response.data.actions.copy === 1) { return; } response.data.actions.copy = 1; Object.defineProperty(this, 'response', { get() { return response; } }); Object.defineProperty(this, 'responseText', { get() { return JSON.stringify(response); } }); }, false); return this._open(...args); }; })();