-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathRestrictedShortcuts.js
182 lines (181 loc) · 3.84 KB
/
RestrictedShortcuts.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
export const restricted = [
{
key: 'ctrl+1',
desc: 'Multiple. switching tabs'
},
{
key: 'ctrl+2',
desc: 'Multiple. switching tabs'
},
{
key: 'ctrl+3',
desc: 'Multiple. switching tabs'
},
{
key: 'ctrl+4',
desc: 'Multiple. switching tabs'
},
{
key: 'ctrl+5',
desc: 'Multiple. switching tabs'
},
{
key: 'ctrl+6',
desc: 'Multiple. switching tabs'
},
{
key: 'ctrl+7',
desc: 'Multiple. switching tabs'
},
{
key: 'ctrl+8',
desc: 'Multiple. switching tabs'
},
{
key: 'ctrl+9',
desc: 'Multiple. switching tabs'
},
{
key: 'ctrl+tab',
desc: 'Multiple. switching tabs'
},
{
key: 'ctrl+shift+tab',
desc: 'Multiple. switching tabs'
},
{
key: 'ctrl+w ctrl+f4 mod+w mod+f4 command+w command+f4',
desc: 'Multiple browsers. Switching tabs'
},
{
key: 'ctrl+shift+t mod+shift+t',
desc: 'Multiple browsers. switching tabs'
},
{
key: 'ctrl+t mod+t command+t',
desc: 'Multiple browsers. new tab'
},
{
key: 'ctrl+n mod+n command+n',
desc: 'Multiple browsers. new browser window'
},
{
key: 'alt+f4',
desc: 'All applications. close the current window'
},
{
key: 'alt+right shift+backspace',
desc: 'Multiple browsers. Forward'
},
{
key: 'alt+f4',
desc: 'All applications. close the current window'
},
{
key: 'alt+left backspace',
desc: 'Multiple browsers. Back.'
},
{
key: 'f5',
desc: 'Multiple browsers. Reload.'
},
{
key: 'ctrl+f5 mod+f5 command+f5',
desc: 'Multiple browsers. Reload and clear cache.'
},
{
key: 'alt+home',
desc: 'Multiple browsers. Open homepage. Access browser help.'
},
{
key: 'ctrl+plus',
desc: 'Multiple browsers. Zoom in.'
},
{
key: 'ctrl+-',
desc: 'Multiple browsers. Zoom out.'
},
{
key: 'ctrl+plus',
desc: 'Multiple browsers. Zoom in.'
},
{
key: 'ctrl+0',
desc: 'Multiple browsers. Reset zoom to defaults.'
},
{
key: 'f11',
desc: 'Multiple browsers. Fullscreen mode.'
},
{
key: 'pagedown',
desc: 'Multiple browsers. Scroll down one frame.'
},
{
key: 'pageup',
desc: 'Multiple browsers. Scroll up one frame.'
},
{
key: 'ctrl+l alt+D f6 ctrl+k ctrl+e',
desc: 'Multiple browsers. Focus address bar.'
},
{
key: 'ctrl+f mod+f command+f f3',
desc: 'Multiple browsers. Search within page.'
},
{
key: 'ctrl+g mod+g command+g',
desc: 'Multiple browsers. Find next match within page text (find-in browser).'
},
{
key: 'shift+ctrl+g shift+mod+g shift+command+g',
desc: 'Multiple browsers. Find previous match within page text (find-in browser).'
},
{
key: 'ctrl+h mod+h command+h',
desc: 'Multiple browsers. Open browsing history.'
},
{
key: 'ctrl+j mod+j command+j',
desc: 'Multiple browsers. Open download history.'
},
{
key: 'ctrl+d mod+d command+d',
desc: 'Multiple browsers. Bookmark the page.'
},
{
key: 'shift+ctrl+del ctrl+shift+del shift+mod+del mod+shift+del command+shift+del shift+command+del',
desc: 'Multiple browsers. Open clear browsing history window.'
},
{
key: 'ctrl+p mod+p command+p',
desc: 'Applications. Print the current page.'
},
{
key: 'ctrl+s mod+s command+s',
desc: 'Applications. Save the page to your computer.'
},
{
key: 'ctrl+o mod+o command+o',
desc: 'Applications. Open a file from your compunter.'
},
{
key: 'ctrl+u mod+u command+u',
desc: 'Multiple Browsers. View page source.'
},
{
key: 'f12',
desc: 'Multiple Browsers. Open developer tools.'
}
];
export function isRestricted(str) {
const keyIndex = restricted.findIndex(hk => {
const list = hk.key.split(' ');
return list.includes(str);
});
if (keyIndex === -1) {
return keyIndex;
} else {
return restricted[keyIndex];
}
}