-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfeishu_enable_copy.js
53 lines (51 loc) · 1.8 KB
/
feishu_enable_copy.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// ==UserScript==
// @name 解除飞书复制和右键复制
// @license GPL License
// @namespace http://tampermonkey.net/
// @version 0.5
// @description 让飞书文档不受权限限制,可以复制任意内容,可以打开右键菜单(复制下载图片),
// @author chunqiu031
// @match *.feishu.cn/*
// @icon https://sf3-scmcdn2-cn.feishucdn.com/ccm/pc/web/resource/bear/src/common/assets/favicons/icon_file_doc_nor-32x32.8cb0fef16653221e74b9.png
// @grant none
// @run-at document-start
// ==/UserScript==
(function() {
console.log('已解除飞书文档的复制和右键屏蔽!!!!');
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,
);
};
});
})();