forked from marktext/marktext
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTHIRD-PARTY-LICENSES.txt
More file actions
14418 lines (10686 loc) · 684 KB
/
THIRD-PARTY-LICENSES.txt
File metadata and controls
14418 lines (10686 loc) · 684 KB
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Third Party Notices
-------------------------------------------------
This file contains all third-party packages that are bundled and shipped with MarkText.
-------------------------------------------------
# Summary
-------------------------------------------------
1. @braintree/sanitize-url (MIT)
2. @electron/get (MIT)
3. @electron/remote (MIT)
4. @hfelix/electron-localshortcut (MIT)
5. @hfelix/electron-spellchecker (MIT)
6. @hfelix/spellchecker (MIT)
7. @marktext/file-icons (MIT)
8. @octokit/auth-token (MIT)
9. @octokit/core (MIT)
10. @octokit/endpoint (MIT)
11. @octokit/graphql (MIT)
12. @octokit/openapi-types (MIT)
13. @octokit/plugin-paginate-rest (MIT)
14. @octokit/plugin-request-log (MIT)
15. @octokit/plugin-rest-endpoint-methods (MIT)
16. @octokit/request-error (MIT)
17. @octokit/request (MIT)
18. @octokit/rest (MIT)
19. @octokit/types (MIT)
20. @sindresorhus/is (MIT)
21. @szmarczak/http-timer (MIT)
22. @types/clone (MIT)
23. @types/content-type (MIT)
24. @types/estree (MIT)
25. @types/node (MIT)
26. agent-base (MIT)
27. ajv-formats (MIT)
28. ajv (MIT)
29. animation-frame-polyfill (MIT)
30. ansi-regex (MIT)
31. ansi-styles (MIT)
32. anymatch (ISC)
33. aproba (ISC)
34. are-we-there-yet (ISC)
35. arg (MIT)
36. array-flat-polyfill (CC0-1.0)
37. array-from (MIT)
38. async-validator (MIT)
39. at-least-node (ISC)
40. atoa (MIT)
41. atom-fs (ISC)
42. atomically (MIT)
43. axios (MIT)
44. babel-runtime (MIT)
45. balanced-match (MIT)
46. base64-js (MIT)
47. batch-processor (MIT)
48. bcp47 (MIT)
49. before-after-hook (Apache-2.0)
50. binary-extensions (MIT)
51. bindings (MIT)
52. bl (MIT)
53. boolean (MIT)
54. brace-expansion (MIT)
55. braces (MIT)
56. browser-split (MIT)
57. buffer-crc32 (MIT)
58. buffer-from (MIT)
59. buffer (MIT)
60. cacheable-request (MIT)
61. ced ((ISC AND Apache-2.0))
62. chokidar (MIT)
63. chownr (ISC)
64. cld (Apache)
65. cliui (ISC)
66. clone-regexp (MIT)
67. clone-response (MIT)
68. clone (MIT)
69. code-point-at (MIT)
70. codemirror (MIT)
71. color-convert (MIT)
72. color-name (MIT)
73. command-exists (MIT)
74. commander (MIT)
75. concat-map (MIT)
76. concat-stream (MIT)
77. conf (MIT)
78. config-chain (MIT)
79. console-control-strings (ISC)
80. content-type (MIT)
81. contra (MIT)
82. core-js (MIT)
83. core-util-is (MIT)
84. create-point-cb (MIT)
85. cross-spawn (MIT)
86. crossvent (MIT)
87. custom-event (MIT)
88. d3-array (BSD-3-Clause)
89. d3-axis (BSD-3-Clause)
90. d3-brush (BSD-3-Clause)
91. d3-chord (BSD-3-Clause)
92. d3-collection (BSD-3-Clause)
93. d3-color (BSD-3-Clause)
94. d3-contour (BSD-3-Clause)
95. d3-delaunay (ISC)
96. d3-dispatch (BSD-3-Clause)
97. d3-drag (BSD-3-Clause)
98. d3-dsv (BSD-3-Clause)
99. d3-ease (BSD-3-Clause)
100. d3-fetch (BSD-3-Clause)
101. d3-force (BSD-3-Clause)
102. d3-format (BSD-3-Clause)
103. d3-geo-projection (BSD-3-Clause)
104. d3-geo (BSD-3-Clause)
105. d3-hierarchy (BSD-3-Clause)
106. d3-interpolate (BSD-3-Clause)
107. d3-path (BSD-3-Clause)
108. d3-polygon (BSD-3-Clause)
109. d3-quadtree (BSD-3-Clause)
110. d3-random (BSD-3-Clause)
111. d3-scale-chromatic (BSD-3-Clause)
112. d3-scale (BSD-3-Clause)
113. d3-selection (BSD-3-Clause)
114. d3-shape (BSD-3-Clause)
115. d3-time-format (BSD-3-Clause)
116. d3-time (BSD-3-Clause)
117. d3-timer (BSD-3-Clause)
118. d3-transition (BSD-3-Clause)
119. d3-voronoi (BSD-3-Clause)
120. d3-zoom (BSD-3-Clause)
121. d3 (BSD-3-Clause)
122. dagre-d3 (MIT)
123. dagre (MIT)
124. dayjs (MIT)
125. debounce-fn (MIT)
126. debug (MIT)
127. decompress-response (MIT)
128. deep-extend (MIT)
129. deepmerge (MIT)
130. defer-to-connect (MIT)
131. define-properties (MIT)
132. delaunator (ISC)
133. delegates (MIT)
134. deprecation (ISC)
135. detect-libc (Apache-2.0)
136. detect-node (ISC)
137. dom-autoscroller (MIT)
138. dom-mousemove-dispatcher (MIT)
139. dom-plane (MIT)
140. dom-set (WTFPL)
141. domino (BSD-2-Clause)
142. dompurify ((MPL-2.0 OR Apache-2.0))
143. dot-prop (MIT)
144. dragula (MIT)
145. duplexer3 (BSD-3-Clause)
146. electron-log (MIT)
147. electron-store (MIT)
148. electron-window-state (MIT)
149. electron (MIT)
150. element-resize-detector (MIT)
151. element-ui (MIT)
152. emoji-regex (MIT)
153. encodeurl (MIT)
154. end-of-stream (MIT)
155. env-paths (MIT)
156. es6-error (MIT)
157. escalade (MIT)
158. escape-string-regexp (MIT)
159. eve-raphael (Apache*)
160. event-kit (MIT)
161. execa (MIT)
162. execall (MIT)
163. expand-template ((MIT OR WTFPL))
164. extract-zip (BSD-2-Clause)
165. fast-deep-equal (MIT)
166. fast-json-patch (MIT)
167. fast-json-stable-stringify (MIT)
168. fd-slicer (MIT)
169. file-uri-to-path (MIT)
170. fill-range (MIT)
171. find-up (MIT)
172. flowchart.js (MIT)
173. follow-redirects (MIT)
174. fontmanager-redux (MIT)
175. fs-constants (MIT)
176. fs-extra (MIT)
177. fs.realpath (ISC)
178. function-bind (MIT)
179. fuzzaldrin (MIT)
180. gauge (ISC)
181. get-caller-file (ISC)
182. get-stream (MIT)
183. github-from-package (MIT)
184. github-markdown-css (MIT)
185. glob-parent (ISC)
186. glob (ISC)
187. global-agent (BSD-3-Clause)
188. global-tunnel-ng (BSD-3-Clause)
189. globalthis (MIT)
190. got (MIT)
191. graceful-fs (ISC)
192. graphlib (MIT)
193. has-unicode (ISC)
194. has (MIT)
195. html-tags (MIT)
196. http-cache-semantics (BSD-2-Clause)
197. https-proxy-agent (MIT)
198. iconv-lite (MIT)
199. ieee754 (BSD-3-Clause)
200. inflight (ISC)
201. inherits (ISC)
202. ini (ISC)
203. internmap (ISC)
204. is-array (MIT)
205. is-binary-path (MIT)
206. is-core-module (MIT)
207. is-extglob (MIT)
208. is-fullwidth-code-point (MIT)
209. is-glob (MIT)
210. is-number (MIT)
211. is-obj (MIT)
212. is-plain-object (MIT)
213. is-regexp (MIT)
214. is-stream (MIT)
215. isarray (MIT)
216. iselement (MIT)
217. isexe (ISC)
218. iso-639-1 (MIT)
219. isobject (MIT)
220. joplin-turndown-plugin-gfm (MIT)
221. json-buffer (MIT)
222. json-schema-traverse (MIT)
223. json-schema-typed (BSD-2-Clause)
224. json-stringify-pretty-compact (MIT)
225. json-stringify-safe (ISC)
226. jsonfile (MIT)
227. katex (MIT)
228. keyboard-layout (MIT)
229. keytar (MIT)
230. keyv (MIT)
231. khroma (MIT)
232. locate-path (MIT)
233. lodash.escape (MIT)
234. lodash.forown (MIT)
235. lodash.kebabcase (MIT)
236. lodash.remove (MIT)
237. lodash.uniq (MIT)
238. lodash (MIT)
239. lowercase-keys (MIT)
240. lru-cache (ISC)
241. macos-release (MIT)
242. mapped-disposable (ISC)
243. matcher (MIT)
244. mermaid (MIT)
245. micromatch (MIT)
246. mimic-fn (MIT)
247. mimic-response (MIT)
248. minimatch (ISC)
249. minimist (MIT)
250. minipass (ISC)
251. minizlib (MIT)
252. mkdirp-classic (MIT)
253. mkdirp (MIT)
254. moment-mini (MIT)
255. ms (MIT)
256. nan (MIT)
257. napi-build-utils (MIT)
258. native-keymap (MIT)
259. nice-try (MIT)
260. node-abi (MIT)
261. node-addon-api (MIT)
262. node-fetch (MIT)
263. normalize-path (MIT)
264. normalize-url (MIT)
265. normalize-wheel (BSD-3-Clause)
266. npm-conf (MIT)
267. npm-run-path (MIT)
268. npmlog (ISC)
269. number-is-nan (MIT)
270. object-assign (MIT)
271. object-keys (MIT)
272. once (ISC)
273. onetime (MIT)
274. os-name (MIT)
275. p-cancelable (MIT)
276. p-finally (MIT)
277. p-limit (MIT)
278. p-locate (MIT)
279. p-throttle (MIT)
280. p-try (MIT)
281. parse-sel (MIT)
282. path-exists (MIT)
283. path-is-absolute (MIT)
284. path-key (MIT)
285. path-parse (MIT)
286. pend (MIT)
287. picomatch (MIT)
288. pify (MIT)
289. pkg-up (MIT)
290. plist (MIT)
291. popper.js (MIT)
292. prebuild-install (MIT)
293. prepend-http (MIT)
294. prismjs (MIT)
295. process-nextick-args (MIT)
296. progress (MIT)
297. proto-list (ISC)
298. proxy-from-env (MIT)
299. pump (MIT)
300. punycode (MIT)
301. raphael (MIT)
302. rc ((BSD-2-Clause OR MIT OR Apache-2.0))
303. readable-stream (MIT)
304. readdirp (MIT)
305. regenerator-runtime (MIT)
306. require-directory (MIT)
307. require-from-string (MIT)
308. resize-observer-polyfill (MIT)
309. resolve (MIT)
310. responselike (MIT)
311. roarr (BSD-3-Clause)
312. robust-predicates (Unlicense)
313. rw (BSD-3-Clause)
314. safe-buffer (MIT)
315. safer-buffer (MIT)
316. semver-compare (MIT)
317. semver (ISC)
318. serialize-error (MIT)
319. set-blocking (ISC)
320. shebang-command (MIT)
321. shebang-regex (MIT)
322. signal-exit (ISC)
323. simple-concat (MIT)
324. simple-get (MIT)
325. snabbdom-to-html (MIT)
326. snabbdom (MIT)
327. source-map-support (MIT)
328. source-map (BSD-3-Clause)
329. sprintf-js (BSD-3-Clause)
330. string-width (MIT)
331. string_decoder (MIT)
332. strip-ansi (MIT)
333. strip-eof (MIT)
334. strip-json-comments (MIT)
335. stylis (MIT)
336. sumchecker (Apache-2.0)
337. supports-preserve-symlinks-flag (MIT)
338. tar-fs (MIT)
339. tar-stream (MIT)
340. throttle-debounce (MIT)
341. ticky (MIT)
342. to-readable-stream (MIT)
343. to-regex-range (MIT)
344. topojson-client (ISC)
345. tslib (0BSD)
346. tunnel-agent (Apache-2.0)
347. tunnel (MIT)
348. turndown (MIT)
349. type-fest ((MIT OR CC0-1.0))
350. type-func (MIT)
351. typedarray (MIT)
352. underscore (MIT)
353. universal-user-agent (ISC)
354. universalify (MIT)
355. unsplash-js (MIT)
356. uri-js (BSD-2-Clause)
357. url-parse-lax (MIT)
358. util-deprecate (MIT)
359. vega-canvas (BSD-3-Clause)
360. vega-crossfilter (BSD-3-Clause)
361. vega-dataflow (BSD-3-Clause)
362. vega-embed (BSD-3-Clause)
363. vega-encode (BSD-3-Clause)
364. vega-event-selector (BSD-3-Clause)
365. vega-expression (BSD-3-Clause)
366. vega-force (BSD-3-Clause)
367. vega-format (BSD-3-Clause)
368. vega-functions (BSD-3-Clause)
369. vega-geo (BSD-3-Clause)
370. vega-hierarchy (BSD-3-Clause)
371. vega-interpreter (BSD-3-Clause)
372. vega-label (BSD-3-Clause)
373. vega-lite (BSD-3-Clause)
374. vega-loader (BSD-3-Clause)
375. vega-parser (BSD-3-Clause)
376. vega-projection (BSD-3-Clause)
377. vega-regression (BSD-3-Clause)
378. vega-runtime (BSD-3-Clause)
379. vega-scale (BSD-3-Clause)
380. vega-scenegraph (BSD-3-Clause)
381. vega-schema-url-parser (BSD-3-Clause)
382. vega-selections (BSD-3-Clause)
383. vega-statistics (BSD-3-Clause)
384. vega-themes (BSD-3-Clause)
385. vega-time (BSD-3-Clause)
386. vega-tooltip (BSD-3-Clause)
387. vega-transforms (BSD-3-Clause)
388. vega-typings (BSD-3-Clause)
389. vega-util (BSD-3-Clause)
390. vega-view-transforms (BSD-3-Clause)
391. vega-view (BSD-3-Clause)
392. vega-voronoi (BSD-3-Clause)
393. vega-wordcloud (BSD-3-Clause)
394. vega (BSD-3-Clause)
395. vscode-ripgrep (MIT)
396. vue-electron (ISC)
397. vue-router (MIT)
398. vue (MIT)
399. vuex (MIT)
400. webfontloader (Apache-2.0)
401. which (ISC)
402. wide-align (ISC)
403. windows-release (MIT)
404. wrap-ansi (MIT)
405. wrappy (ISC)
406. xmlbuilder (MIT)
407. y18n (ISC)
408. yallist (ISC)
409. yargs-parser (ISC)
410. yargs (MIT)
411. yauzl (MIT)
412. hunspell (LGPL 2.1)
-------------------------------------------------
# Licenses
-------------------------------------------------
# @braintree/sanitize-url (MIT)
-------------------------------------------------
MIT License
Copyright (c) 2017 Braintree
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
# @electron/get (MIT)
-------------------------------------------------
MIT License
Copyright (c) Contributors to the Electron project
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
# @electron/remote (MIT)
-------------------------------------------------
# @electron/remote
`@electron/remote` is an [Electron](https://electronjs.org) module that bridges
JavaScript objects from the main process to the renderer process. This lets you
access main-process-only objects as if they were available in the renderer
process.
> ⚠️ **Warning!** This module has [many subtle
> pitfalls][remote-considered-harmful]. There is almost always a better way to
> accomplish your task than using this module. For example, [`ipcRenderer.invoke`](https://www.electronjs.org/docs/api/ipc-renderer#ipcrendererinvokechannel-args) can serve many common use cases.
`@electron/remote` is a replacement for the built-in `remote` module in
Electron, which is deprecated and will eventually be removed.
## Migrating from `remote`
> **NOTE:** `@electron/remote` requires Electron 10 or higher.
There are three things you need to do to migrate from the built-in `remote`
module to `@electron/remote`.
First, you need to install it from NPM:
```shell
$ npm install --save @electron/remote
```
Second, `@electron/remote/main` must be initialized in the main
process before it can be used from the renderer:
```javascript
// in the main process:
require('@electron/remote/main').initialize()
```
Third, `require('electron').remote` in the renderer process must be
replaced with `require('@electron/remote')`.
```javascript
// in the renderer process:
// Before
const { BrowserWindow } = require('electron').remote
// After
const { BrowserWindow } = require('@electron/remote')
```
**Note:** Since this is requiring a module through npm rather than a built-in
module, if you're using `remote` from a sandboxed process, you'll need to
configure your bundler appropriately to package the code of `@electron/remote`
in the preload script. Of course, [using `@electron/remote` makes the sandbox
much less effective][remote-considered-harmful].
**Note:** In `electron >= 14.0.0`, you must use the new `enable` API to enable the remote module for each desired `WebContents` separately: `require("@electron/remote/main").enable(webContents)`.
In `electron < 14.0.0`, `@electron/remote` respects the `enableRemoteModule` WebPreferences
value. You must pass `{ webPreferences: { enableRemoteModule: true } }` to
the constructor of `BrowserWindow`s that should be granted permission to use
`@electron/remote`.
# API Reference
The `remote` module provides a simple way to do inter-process communication
(IPC) between the renderer process (web page) and the main process.
In Electron, GUI-related modules (such as `dialog`, `menu` etc.) are only
available in the main process, not in the renderer process. In order to use them
from the renderer process, the `ipc` module is necessary to send inter-process
messages to the main process. With the `remote` module, you can invoke methods
of the main process object without explicitly sending inter-process messages,
similar to Java's [RMI][rmi]. An example of creating a browser window from a
renderer process:
```javascript
const { BrowserWindow } = require('@electron/remote')
let win = new BrowserWindow({ width: 800, height: 600 })
win.loadURL('https://github.com')
```
In order for this to work, you first need to initialize the main-process side
of the remote module:
```javascript
// in the main process:
require('@electron/remote/main').initialize()
```
**Note:** In `electron >= 14.0.0` the remote module is disabled by default for any `WebContents` instance and is only enabled for specified `WebContents` after explicitly calling `require("@electron/remote/main").enable(webContents)`.
In `electron < 14.0.0` the remote module can be disabled for security reasons in the following contexts:
- [`BrowserWindow`](browser-window.md) - by setting the `enableRemoteModule` option to `false`.
- [`<webview>`](webview-tag.md) - by setting the `enableremotemodule` attribute to `false`.
## Remote Objects
Each object (including functions) returned by the `remote` module represents an
object in the main process (we call it a remote object or remote function).
When you invoke methods of a remote object, call a remote function, or create
a new object with the remote constructor (function), you are actually sending
synchronous inter-process messages.
In the example above, both `BrowserWindow` and `win` were remote objects and
`new BrowserWindow` didn't create a `BrowserWindow` object in the renderer
process. Instead, it created a `BrowserWindow` object in the main process and
returned the corresponding remote object in the renderer process, namely the
`win` object.
**Note:** Only [enumerable properties][enumerable-properties] which are present
when the remote object is first referenced are accessible via remote.
**Note:** Arrays and Buffers are copied over IPC when accessed via the `remote`
module. Modifying them in the renderer process does not modify them in the main
process and vice versa.
## Lifetime of Remote Objects
Electron makes sure that as long as the remote object in the renderer process
lives (in other words, has not been garbage collected), the corresponding object
in the main process will not be released. When the remote object has been
garbage collected, the corresponding object in the main process will be
dereferenced.
If the remote object is leaked in the renderer process (e.g. stored in a map but
never freed), the corresponding object in the main process will also be leaked,
so you should be very careful not to leak remote objects.
Primary value types like strings and numbers, however, are sent by copy.
## Passing callbacks to the main process
Code in the main process can accept callbacks from the renderer - for instance
the `remote` module - but you should be extremely careful when using this
feature.
First, in order to avoid deadlocks, the callbacks passed to the main process
are called asynchronously. You should not expect the main process to
get the return value of the passed callbacks.
For instance you can't use a function from the renderer process in an
`Array.map` called in the main process:
```javascript
// main process mapNumbers.js
exports.withRendererCallback = (mapper) => {
return [1, 2, 3].map(mapper)
}
exports.withLocalCallback = () => {
return [1, 2, 3].map(x => x + 1)
}
```
```javascript
// renderer process
const mapNumbers = require('@electron/remote').require('./mapNumbers')
const withRendererCb = mapNumbers.withRendererCallback(x => x + 1)
const withLocalCb = mapNumbers.withLocalCallback()
console.log(withRendererCb, withLocalCb)
// [undefined, undefined, undefined], [2, 3, 4]
```
As you can see, the renderer callback's synchronous return value was not as
expected, and didn't match the return value of an identical callback that lives
in the main process.
Second, the callbacks passed to the main process will persist until the
main process garbage-collects them.
For example, the following code seems innocent at first glance. It installs a
callback for the `close` event on a remote object:
```javascript
require('@electron/remote').getCurrentWindow().on('close', () => {
// window was closed...
})
```
But remember the callback is referenced by the main process until you
explicitly uninstall it. If you do not, each time you reload your window the
callback will be installed again, leaking one callback for each restart.
To make things worse, since the context of previously installed callbacks has
been released, exceptions will be raised in the main process when the `close`
event is emitted.
To avoid this problem, ensure you clean up any references to renderer callbacks
passed to the main process. This involves cleaning up event handlers, or
ensuring the main process is explicitly told to dereference callbacks that came
from a renderer process that is exiting.
## Accessing built-in modules in the main process
The built-in modules in the main process are added as getters in the `remote`
module, so you can use them directly like the `electron` module.
```javascript
const app = require('@electron/remote').app
console.log(app)
```
## Methods
The `remote` module has the following methods:
### `remote.require(module)`
* `module` String
Returns `any` - The object returned by `require(module)` in the main process.
Modules specified by their relative path will resolve relative to the entrypoint
of the main process.
e.g.
```sh
project/
├── main
│ ├── foo.js
│ └── index.js
├── package.json
└── renderer
└── index.js
```
```js
// main process: main/index.js
const { app } = require('@electron/remote')
app.whenReady().then(() => { /* ... */ })
```
```js
// some relative module: main/foo.js
module.exports = 'bar'
```
```js
// renderer process: renderer/index.js
const foo = require('@electron/remote').require('./foo') // bar
```
### `remote.getCurrentWindow()`
Returns `BrowserWindow` - The window to which this web page belongs.
**Note:** Do not use `removeAllListeners` on `BrowserWindow`. Use of this can
remove all [`blur`](https://developer.mozilla.org/en-US/docs/Web/Events/blur)
listeners, disable click events on touch bar buttons, and other unintended
consequences.
### `remote.getCurrentWebContents()`
Returns `WebContents` - The web contents of this web page.
### `remote.getGlobal(name)`
* `name` String
Returns `any` - The global variable of `name` (e.g. `global[name]`) in the main
process.
## Properties
### `remote.process` _Readonly_
A `NodeJS.Process` object. The `process` object in the main process. This is the same as
`remote.getGlobal('process')` but is cached.
# Overriding exposed objects
Without filtering, `@electron/remote` will provide access to any JavaScript
object that any renderer requests. In order to control what can be accessed,
`@electron/remote` provides an opportunity to the app to return a custom result
for any of `getGlobal`, `require`, `getCurrentWindow`, `getCurrentWebContents`,
or any of the builtin module properties.
The following events will be emitted first on the `app` Electron module, and
then on the specific `WebContents` which requested the object. When emitted on
the `app` module, the first parameter after the `Event` object will be the
`WebContents` which originated the request. If any handler calls
`preventDefault`, the request will be denied. If a `returnValue` parameter is
set on the result, then that value will be returned to the renderer instead of
the default.
## Events
### Event: 'remote-require'
Returns:
* `event` Event
* `moduleName` String
Emitted when `remote.require()` is called in the renderer process of `webContents`.
Calling `event.preventDefault()` will prevent the module from being returned.
Custom value can be returned by setting `event.returnValue`.
### Event: 'remote-get-global'
Returns:
* `event` Event
* `globalName` String
Emitted when `remote.getGlobal()` is called in the renderer process of `webContents`.
Calling `event.preventDefault()` will prevent the global from being returned.
Custom value can be returned by setting `event.returnValue`.
### Event: 'remote-get-builtin'
Returns:
* `event` Event
* `moduleName` String
Emitted when `remote.getBuiltin()` is called in the renderer process of
`webContents`, including when a builtin module is accessed as a property (e.g.
`require("@electron/remote").BrowserWindow`).
Calling `event.preventDefault()` will prevent the module from being returned.
Custom value can be returned by setting `event.returnValue`.
### Event: 'remote-get-current-window'
Returns:
* `event` Event
Emitted when `remote.getCurrentWindow()` is called in the renderer process of `webContents`.
Calling `event.preventDefault()` will prevent the object from being returned.
Custom value can be returned by setting `event.returnValue`.
### Event: 'remote-get-current-web-contents'
Returns:
* `event` Event
Emitted when `remote.getCurrentWebContents()` is called in the renderer process of `webContents`.
Calling `event.preventDefault()` will prevent the object from being returned.
Custom value can be returned by setting `event.returnValue`.
[rmi]: https://en.wikipedia.org/wiki/Java_remote_method_invocation
[enumerable-properties]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Enumerability_and_ownership_of_properties
[remote-considered-harmful]: https://medium.com/@nornagon/electrons-remote-module-considered-harmful-70d69500f31
# @hfelix/electron-localshortcut (MIT)
-------------------------------------------------
The MIT License (MIT)
Copyright (c) 2022 Felix Häusler
Copyright (c) 2017 Andrea Parodi
Copyright (c) 2016 Thomas Brouard
Copyright (c) 2014 GitHub Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER DEALINGS IN THE SOFTWARE.
# @hfelix/electron-spellchecker (MIT)
-------------------------------------------------
Copyright (c) 2016 Paul Betts
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# @hfelix/spellchecker (MIT)
-------------------------------------------------
Copyright (c) 2013 GitHub Inc.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# @marktext/file-icons (MIT)
-------------------------------------------------
MIT License
Copyright (c) 2021 Mark Text
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
# @octokit/auth-token (MIT)
-------------------------------------------------
The MIT License
Copyright (c) 2019 Octokit contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
# @octokit/core (MIT)
-------------------------------------------------
The MIT License
Copyright (c) 2019 Octokit contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
# @octokit/endpoint (MIT)
-------------------------------------------------
The MIT License
Copyright (c) 2018 Octokit contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
# @octokit/graphql (MIT)