-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathelectron-api.json
20323 lines (20323 loc) · 662 KB
/
electron-api.json
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
[
{
"name": "app",
"description": "Control your application's event lifecycle.",
"process": {
"main": true,
"renderer": false
},
"version": "2.0.2",
"type": "Module",
"slug": "app",
"websiteUrl": "http://electron.atom.io/docs/api/app",
"repoUrl": "https://github.com/electron/electron/blob/v2.0.2/docs/api/app.md",
"methods": [
{
"name": "quit",
"signature": "()",
"description": "Try to close all windows. The before-quit event will be emitted first. If all windows are successfully closed, the will-quit event will be emitted and by default the application will terminate. This method guarantees that all beforeunload and unload event handlers are correctly executed. It is possible that a window cancels the quitting by returning false in the beforeunload event handler."
},
{
"name": "exit",
"signature": "([exitCode])",
"description": "Exits immediately with exitCode. exitCode defaults to 0. All windows will be closed immediately without asking user and the before-quit and will-quit events will not be emitted.",
"parameters": [
{
"name": "exitCode",
"type": "Integer",
"collection": false,
"required": false
}
]
},
{
"name": "relaunch",
"signature": "([options])",
"description": "Relaunches the app when current instance exits. By default the new instance will use the same working directory and command line arguments with current instance. When args is specified, the args will be passed as command line arguments instead. When execPath is specified, the execPath will be executed for relaunch instead of current app. Note that this method does not quit the app when executed, you have to call app.quit or app.exit after calling app.relaunch to make the app restart. When app.relaunch is called for multiple times, multiple instances will be started after current instance exited. An example of restarting current instance immediately and adding a new command line argument to the new instance:",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "args",
"type": "String",
"collection": true,
"description": "",
"required": false
},
{
"name": "execPath",
"type": "String",
"collection": false,
"description": "",
"required": false
}
]
}
]
},
{
"name": "isReady",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "true if Electron has finished initializing, false otherwise."
}
},
{
"name": "focus",
"signature": "()",
"description": "On Linux, focuses on the first visible window. On macOS, makes the application the active app. On Windows, focuses on the application's first window."
},
{
"name": "hide",
"signature": "()",
"platforms": [
"macOS"
],
"description": "Hides all application windows without minimizing them."
},
{
"name": "show",
"signature": "()",
"platforms": [
"macOS"
],
"description": "Shows application windows after they were hidden. Does not automatically focus them."
},
{
"name": "getAppPath",
"signature": "()",
"returns": {
"type": "String",
"collection": false,
"description": "The current application directory."
}
},
{
"name": "getPath",
"signature": "(name)",
"description": "You can request the following paths by the name:",
"parameters": [
{
"name": "name",
"type": "String",
"collection": false,
"required": true
}
],
"returns": {
"type": "String",
"collection": false,
"description": "A path to a special directory or file associated with name. On failure an Error is thrown."
}
},
{
"name": "getFileIcon",
"signature": "(path[, options], callback)",
"description": "Fetches a path's associated icon. On Windows, there a 2 kinds of icons: On Linux and macOS, icons depend on the application associated with file mime type.",
"parameters": [
{
"name": "path",
"type": "String",
"collection": false,
"required": true
},
{
"name": "options",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "size",
"type": "String",
"collection": false,
"description": "",
"required": true,
"possibleValues": [
{
"value": "small",
"description": "16x16"
},
{
"value": "normal",
"description": "32x32"
},
{
"value": "large",
"description": "48x48 on <em>Linux</em>, 32x32 on <em>Windows</em>, unsupported on <em>macOS</em>."
}
]
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "error",
"type": "Error",
"collection": false,
"description": "",
"required": true
},
{
"name": "icon",
"type": "NativeImage",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "setPath",
"signature": "(name, path)",
"description": "Overrides the path to a special directory or file associated with name. If the path specifies a directory that does not exist, the directory will be created by this method. On failure an Error is thrown. You can only override paths of a name defined in app.getPath. By default, web pages' cookies and caches will be stored under the userData directory. If you want to change this location, you have to override the userData path before the ready event of the app module is emitted.",
"parameters": [
{
"name": "name",
"type": "String",
"collection": false,
"required": true
},
{
"name": "path",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "getVersion",
"signature": "()",
"returns": {
"type": "String",
"collection": false,
"description": "The version of the loaded application. If no version is found in the application's package.json file, the version of the current bundle or executable is returned."
}
},
{
"name": "getName",
"signature": "()",
"description": "Usually the name field of package.json is a short lowercased name, according to the npm modules spec. You should usually also specify a productName field, which is your application's full capitalized name, and which will be preferred over name by Electron.",
"returns": {
"type": "String",
"collection": false,
"description": "The current application's name, which is the name in the application's package.json file."
}
},
{
"name": "setName",
"signature": "(name)",
"description": "Overrides the current application's name.",
"parameters": [
{
"name": "name",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "getLocale",
"signature": "()",
"description": "To set the locale, you'll want to use a command line switch at app startup, which may be found here. Note: When distributing your packaged app, you have to also ship the locales folder. Note: On Windows you have to call it after the ready events gets emitted.",
"returns": {
"type": "String",
"collection": false,
"description": "The current application locale. Possible return values are documented here."
}
},
{
"name": "addRecentDocument",
"signature": "(path)",
"platforms": [
"macOS",
"Windows"
],
"description": "Adds path to the recent documents list. This list is managed by the OS. On Windows you can visit the list from the task bar, and on macOS you can visit it from dock menu.",
"parameters": [
{
"name": "path",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "clearRecentDocuments",
"signature": "()",
"platforms": [
"macOS",
"Windows"
],
"description": "Clears the recent documents list."
},
{
"name": "setAsDefaultProtocolClient",
"signature": "(protocol[, path, args])",
"description": "This method sets the current executable as the default handler for a protocol (aka URI scheme). It allows you to integrate your app deeper into the operating system. Once registered, all links with your-protocol:// will be opened with the current executable. The whole link, including protocol, will be passed to your application as a parameter. On Windows you can provide optional parameters path, the path to your executable, and args, an array of arguments to be passed to your executable when it launches. Note: On macOS, you can only register protocols that have been added to your app's info.plist, which can not be modified at runtime. You can however change the file with a simple text editor or script during build time. Please refer to Apple's documentation for details. The API uses the Windows Registry and LSSetDefaultHandlerForURLScheme internally.",
"parameters": [
{
"name": "protocol",
"type": "String",
"collection": false,
"description": "The name of your protocol, without `://`. If you want your app to handle `electron://` links, call this method with `electron` as the parameter.",
"required": true
},
{
"name": "path",
"type": "String",
"collection": false,
"description": "Defaults to `process.execPath`",
"required": false
},
{
"name": "args",
"type": "String",
"collection": true,
"description": "Defaults to an empty array",
"required": false
}
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the call succeeded."
}
},
{
"name": "removeAsDefaultProtocolClient",
"signature": "(protocol[, path, args])",
"platforms": [
"macOS",
"Windows"
],
"description": "This method checks if the current executable as the default handler for a protocol (aka URI scheme). If so, it will remove the app as the default handler.",
"parameters": [
{
"name": "protocol",
"type": "String",
"collection": false,
"description": "The name of your protocol, without `://`.",
"required": true
},
{
"name": "path",
"type": "String",
"collection": false,
"description": "Defaults to `process.execPath`",
"required": false
},
{
"name": "args",
"type": "String",
"collection": true,
"description": "Defaults to an empty array",
"required": false
}
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the call succeeded."
}
},
{
"name": "isDefaultProtocolClient",
"signature": "(protocol[, path, args])",
"platforms": [
"macOS",
"Windows"
],
"description": "This method checks if the current executable is the default handler for a protocol (aka URI scheme). If so, it will return true. Otherwise, it will return false. Note: On macOS, you can use this method to check if the app has been registered as the default protocol handler for a protocol. You can also verify this by checking ~/Library/Preferences/com.apple.LaunchServices.plist on the macOS machine. Please refer to Apple's documentation for details. The API uses the Windows Registry and LSCopyDefaultHandlerForURLScheme internally.",
"parameters": [
{
"name": "protocol",
"type": "String",
"collection": false,
"description": "The name of your protocol, without `://`.",
"required": true
},
{
"name": "path",
"type": "String",
"collection": false,
"description": "Defaults to `process.execPath`",
"required": false
},
{
"name": "args",
"type": "String",
"collection": true,
"description": "Defaults to an empty array",
"required": false
}
],
"returns": {
"type": "Boolean",
"collection": false
}
},
{
"name": "setUserTasks",
"signature": "(tasks)",
"platforms": [
"Windows"
],
"description": "Adds tasks to the Tasks category of the JumpList on Windows. tasks is an array of Task objects. Note: If you'd like to customize the Jump List even more use app.setJumpList(categories) instead.",
"parameters": [
{
"name": "tasks",
"type": "Task",
"collection": true,
"description": "Array of `Task` objects",
"required": true
}
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the call succeeded."
}
},
{
"name": "getJumpListSettings",
"signature": "()",
"platforms": [
"Windows"
],
"returns": {
"type": "Object",
"collection": false,
"properties": [
{
"name": "minItems",
"type": "Integer",
"collection": false,
"description": "The minimum number of items that will be shown in the Jump List (for a more detailed description of this value see the ).",
"required": true
},
{
"name": "removedItems",
"type": "JumpListItem",
"collection": true,
"description": "Array of JumpListItem objects that correspond to items that the user has explicitly removed from custom categories in the Jump List. These items must not be re-added to the Jump List in the call to app.setJumpList(), Windows will not display any custom category that contains any of the removed items.",
"required": true
}
]
}
},
{
"name": "setJumpList",
"signature": "(categories)",
"platforms": [
"Windows"
],
"description": "Sets or removes a custom Jump List for the application, and returns one of the following strings: If categories is null the previously set custom Jump List (if any) will be replaced by the standard Jump List for the app (managed by Windows). Note: If a JumpListCategory object has neither the type nor the name property set then its type is assumed to be tasks. If the name property is set but the type property is omitted then the type is assumed to be custom. Note: Users can remove items from custom categories, and Windows will not allow a removed item to be added back into a custom category until after the next successful call to app.setJumpList(categories). Any attempt to re-add a removed item to a custom category earlier than that will result in the entire custom category being omitted from the Jump List. The list of removed items can be obtained using app.getJumpListSettings(). Here's a very simple example of creating a custom Jump List:",
"parameters": [
{
"name": "categories",
"type": "JumpListCategory",
"collection": true,
"description": "or `null` Array of `JumpListCategory` objects.",
"required": true
}
]
},
{
"name": "makeSingleInstance",
"signature": "(callback)",
"description": "This method makes your application a Single Instance Application - instead of allowing multiple instances of your app to run, this will ensure that only a single instance of your app is running, and other instances signal this instance and exit. callback will be called by the first instance with callback(argv, workingDirectory) when a second instance has been executed. argv is an Array of the second instance's command line arguments, and workingDirectory is its current working directory. Usually applications respond to this by making their primary window focused and non-minimized. The callback is guaranteed to be executed after the ready event of app gets emitted. This method returns false if your process is the primary instance of the application and your app should continue loading. And returns true if your process has sent its parameters to another instance, and you should immediately quit. On macOS the system enforces single instance automatically when users try to open a second instance of your app in Finder, and the open-file and open-url events will be emitted for that. However when users start your app in command line the system's single instance mechanism will be bypassed and you have to use this method to ensure single instance. An example of activating the window of primary instance when a second instance starts:",
"parameters": [
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "argv",
"type": "String",
"collection": true,
"description": "An array of the second instance's command line arguments",
"required": true
},
{
"name": "workingDirectory",
"type": "String",
"collection": false,
"description": "The second instance's working directory",
"required": true
}
]
}
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "."
}
},
{
"name": "releaseSingleInstance",
"signature": "()",
"description": "Releases all locks that were created by makeSingleInstance. This will allow multiple instances of the application to once again run side by side."
},
{
"name": "setUserActivity",
"signature": "(type, userInfo[, webpageURL])",
"platforms": [
"macOS"
],
"description": "Creates an NSUserActivity and sets it as the current activity. The activity is eligible for Handoff to another device afterward.",
"parameters": [
{
"name": "type",
"type": "String",
"collection": false,
"description": "Uniquely identifies the activity. Maps to .",
"required": true
},
{
"name": "userInfo",
"type": "Object",
"collection": false,
"description": "App-specific state to store for use by another device.",
"required": true
},
{
"name": "webpageURL",
"type": "String",
"collection": false,
"description": "The webpage to load in a browser if no suitable app is installed on the resuming device. The scheme must be `http` or `https`.",
"required": false
}
]
},
{
"name": "getCurrentActivityType",
"signature": "()",
"platforms": [
"macOS"
],
"returns": {
"type": "String",
"collection": false,
"description": "The type of the currently running activity."
}
},
{
"name": "invalidateCurrentActivity",
"signature": "()",
"platforms": [
"macOS"
],
"description": "Invalidates the current Handoff user activity.",
"parameters": [
{
"name": "type",
"type": "String",
"collection": false,
"description": "Uniquely identifies the activity. Maps to .",
"required": true
}
]
},
{
"name": "updateCurrentActivity",
"signature": "(type, userInfo)",
"platforms": [
"macOS"
],
"description": "Updates the current activity if its type matches type, merging the entries from userInfo into its current userInfo dictionary.",
"parameters": [
{
"name": "type",
"type": "String",
"collection": false,
"description": "Uniquely identifies the activity. Maps to .",
"required": true
},
{
"name": "userInfo",
"type": "Object",
"collection": false,
"description": "App-specific state to store for use by another device.",
"required": true
}
]
},
{
"name": "setAppUserModelId",
"signature": "(id)",
"platforms": [
"Windows"
],
"description": "Changes the Application User Model ID to id.",
"parameters": [
{
"name": "id",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "importCertificate",
"signature": "(options, callback)",
"platforms": [
"LINUX"
],
"description": "Imports the certificate in pkcs12 format into the platform certificate store. callback is called with the result of import operation, a value of 0 indicates success while any other value indicates failure according to chromium net_error_list.",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "certificate",
"type": "String",
"collection": false,
"description": "Path for the pkcs12 file.",
"required": true
},
{
"name": "password",
"type": "String",
"collection": false,
"description": "Passphrase for the certificate.",
"required": true
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "result",
"type": "Integer",
"collection": false,
"description": "Result of import.",
"required": true
}
]
}
]
},
{
"name": "disableHardwareAcceleration",
"signature": "()",
"description": "Disables hardware acceleration for current app. This method can only be called before app is ready."
},
{
"name": "disableDomainBlockingFor3DAPIs",
"signature": "()",
"description": "By default, Chromium disables 3D APIs (e.g. WebGL) until restart on a per domain basis if the GPU processes crashes too frequently. This function disables that behaviour. This method can only be called before app is ready."
},
{
"name": "getAppMetrics",
"signature": "()",
"returns": {
"type": "ProcessMetric",
"collection": true,
"description": "Array of ProcessMetric objects that correspond to memory and cpu usage statistics of all the processes associated with the app."
}
},
{
"name": "getGPUFeatureStatus",
"signature": "()",
"returns": {
"type": "GPUFeatureStatus",
"collection": false,
"description": "The Graphics Feature Status from chrome://gpu/."
}
},
{
"name": "setBadgeCount",
"signature": "(count)",
"platforms": [
"Linux",
"macOS"
],
"description": "Sets the counter badge for current app. Setting the count to 0 will hide the badge. On macOS it shows on the dock icon. On Linux it only works for Unity launcher, Note: Unity launcher requires the existence of a .desktop file to work, for more information please read Desktop Environment Integration.",
"parameters": [
{
"name": "count",
"type": "Integer",
"collection": false,
"required": true
}
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the call succeeded."
}
},
{
"name": "getBadgeCount",
"signature": "()",
"platforms": [
"Linux",
"macOS"
],
"returns": {
"type": "Integer",
"collection": false,
"description": "The current value displayed in the counter badge."
}
},
{
"name": "isUnityRunning",
"signature": "()",
"platforms": [
"Linux"
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the current desktop environment is Unity launcher."
}
},
{
"name": "getLoginItemSettings",
"signature": "([options])",
"platforms": [
"macOS",
"Windows"
],
"description": "If you provided path and args options to app.setLoginItemSettings then you need to pass the same arguments here for openAtLogin to be set correctly.",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "path",
"type": "String",
"collection": false,
"description": "The executable path to compare against. Defaults to process.execPath.",
"required": false
},
{
"name": "args",
"type": "String",
"collection": true,
"description": "The command-line arguments to compare against. Defaults to an empty array.",
"required": false
}
]
}
],
"returns": {
"type": "Object",
"collection": false,
"properties": [
{
"name": "options",
"type": "Object",
"collection": false,
"description": "",
"required": false,
"properties": [
{
"name": "path",
"type": "String",
"collection": false,
"description": "The executable path to compare against. Defaults to process.execPath.",
"required": false
},
{
"name": "args",
"type": "String",
"collection": true,
"description": "The command-line arguments to compare against. Defaults to an empty array.",
"required": false
}
]
},
{
"name": "openAtLogin",
"type": "Boolean",
"collection": false,
"description": "true if the app is set to open at login.",
"required": true
},
{
"name": "openAsHidden",
"type": "Boolean",
"collection": false,
"description": "true if the app is set to open as hidden at login. This setting is not available on .",
"required": true
},
{
"name": "wasOpenedAtLogin",
"type": "Boolean",
"collection": false,
"description": "true if the app was opened at login automatically. This setting is not available on .",
"required": true
},
{
"name": "wasOpenedAsHidden",
"type": "Boolean",
"collection": false,
"description": "true if the app was opened as a hidden login item. This indicates that the app should not open any windows at startup. This setting is not available on .",
"required": true
},
{
"name": "restoreState",
"type": "Boolean",
"collection": false,
"description": "true if the app was opened as a login item that should restore the state from the previous session. This indicates that the app should restore the windows that were open the last time the app was closed. This setting is not available on .",
"required": true
}
]
}
},
{
"name": "setLoginItemSettings",
"signature": "(settings)",
"platforms": [
"macOS",
"Windows"
],
"description": "Set the app's login item settings. To work with Electron's autoUpdater on Windows, which uses Squirrel, you'll want to set the launch path to Update.exe, and pass arguments that specify your application name. For example:",
"parameters": [
{
"name": "settings",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "openAtLogin",
"type": "Boolean",
"collection": false,
"description": "true to open the app at login, false to remove the app as a login item. Defaults to false.",
"required": false
},
{
"name": "openAsHidden",
"type": "Boolean",
"collection": false,
"description": "true to open the app as hidden. Defaults to false. The user can edit this setting from the System Preferences so app.getLoginItemStatus().wasOpenedAsHidden should be checked when the app is opened to know the current value. This setting is not available on .",
"required": false
},
{
"name": "path",
"type": "String",
"collection": false,
"description": "The executable to launch at login. Defaults to process.execPath.",
"required": false
},
{
"name": "args",
"type": "String",
"collection": true,
"description": "The command-line arguments to pass to the executable. Defaults to an empty array. Take care to wrap paths in quotes.",
"required": false
}
]
}
]
},
{
"name": "isAccessibilitySupportEnabled",
"signature": "()",
"platforms": [
"macOS",
"Windows"
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "true if Chrome's accessibility support is enabled, false otherwise. This API will return true if the use of assistive technologies, such as screen readers, has been detected. See https://www.chromium.org/developers/design-documents/accessibility for more details."
}
},
{
"name": "setAccessibilitySupportEnabled",
"signature": "(enabled)",
"platforms": [
"macOS",
"Windows"
],
"description": "Manually enables Chrome's accessibility support, allowing to expose accessibility switch to users in application settings. https://www.chromium.org/developers/design-documents/accessibility for more details. Disabled by default. Note: Rendering accessibility tree can significantly affect the performance of your app. It should not be enabled by default.",
"parameters": [
{
"name": "enabled",
"type": "Boolean",
"collection": false,
"description": "Enable or disable rendering",
"required": true
}
]
},
{
"name": "setAboutPanelOptions",
"signature": "(options)",
"platforms": [
"macOS"
],
"description": "Set the about panel options. This will override the values defined in the app's .plist file. See the Apple docs for more details.",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "applicationName",
"type": "String",
"collection": false,
"description": "The app's name.",
"required": false
},
{
"name": "applicationVersion",
"type": "String",
"collection": false,
"description": "The app's version.",
"required": false
},
{
"name": "copyright",
"type": "String",
"collection": false,
"description": "Copyright information.",
"required": false
},
{
"name": "credits",
"type": "String",
"collection": false,
"description": "Credit information.",
"required": false
},
{
"name": "version",
"type": "String",
"collection": false,
"description": "The app's build version number.",
"required": false
}
]
}
]
},
{
"name": "startAccessingSecurityScopedResource",
"signature": "(bookmarkData)",
"platforms": [
"macOS (mas)"
],
"description": "Start accessing a security scoped resource. With this method electron applications that are packaged for the Mac App Store may reach outside their sandbox to access files chosen by the user. See Apple's documentation for a description of how this system works.",
"parameters": [
{
"name": "bookmarkData",
"type": "String",
"collection": false,
"description": "The base64 encoded security scoped bookmark data returned by the `dialog.showOpenDialog` or `dialog.showSaveDialog` methods.",
"required": true
}
],
"returns": {
"type": "Function",
"collection": false,
"description": "This function must be called once you have finished accessing the security scoped file. If you do not remember to stop accessing the bookmark, kernel resources will be leaked and your app will lose its ability to reach outside the sandbox completely, until your app is restarted."
}
},
{
"name": "enableMixedSandbox",
"signature": "()",
"platforms": [
"Experimental",
"macOS",
"Windows"
],
"description": "Enables mixed sandbox mode on the app. This method can only be called before app is ready."
},
{
"name": "isInApplicationsFolder",
"signature": "()",
"platforms": [
"macOS"
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the application is currently running from the systems Application folder. Use in combination with app.moveToApplicationsFolder()"
}
},
{
"name": "moveToApplicationsFolder",
"signature": "()",
"platforms": [
"macOS"
],
"description": "No confirmation dialog will be presented by default, if you wish to allow the user to confirm the operation you may do so using the dialog API. NOTE: This method throws errors if anything other than the user causes the move to fail. For instance if the user cancels the authorization dialog this method returns false. If we fail to perform the copy then this method will throw an error. The message in the error should be informative and tell you exactly what went wrong",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the move was successful. Please note that if the move is successful your application will quit and relaunch."
}
}
],
"events": [
{
"name": "will-finish-launching",
"description": "Emitted when the application has finished basic startup. On Windows and Linux, the will-finish-launching event is the same as the ready event; on macOS, this event represents the applicationWillFinishLaunching notification of NSApplication. You would usually set up listeners for the open-file and open-url events here, and start the crash reporter and auto updater. In most cases, you should just do everything in the ready event handler."
},
{
"name": "ready",
"description": "Emitted when Electron has finished initializing. On macOS, launchInfo holds the userInfo of the NSUserNotification that was used to open the application, if it was launched from Notification Center. You can call app.isReady() to check if this event has already fired.",
"returns": [
{
"name": "launchInfo",
"type": "Object",