summaryrefslogtreecommitdiffstats
path: root/extensions/common/api/web_view_internal.json
blob: a33f500d22142a7e2e673e35b5131783ac1d7a02 (plain)
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
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

[
  {
    "namespace": "webViewInternal",
    "description": "none",
    "compiler_options": {
      "implemented_in": "extensions/browser/api/guest_view/web_view/web_view_internal_api.h"
    },
    "types": [
      {
        "id": "DataTypeSet",
        "type": "object",
        "description": "A set of data types. Missing data types are interpreted as <code>false</code>.",
        "properties": {
          "appcache": {
            "type": "boolean",
            "optional": true,
            "description": "Websites' appcaches."
          },
          "cookies": {
            "type": "boolean",
            "optional": true,
            "description": "The browser's cookies."
          },
          "fileSystems": {
            "type": "boolean",
            "optional": true,
            "description": "Websites' file systems."
          },
          "indexedDB": {
            "type": "boolean",
            "optional": true,
            "description": "Websites' IndexedDB data."
          },
          "localStorage": {
            "type": "boolean",
            "optional": true,
            "description": "Websites' local storage data."
          },
          "webSQL": {
            "type": "boolean",
            "optional": true,
            "description": "Websites' WebSQL data."
          },
          "cache": {
            "type": "boolean",
            "optional": true,
            "description": "The Websites' cache data. Note: when removing data, this clears the <em>entire</em> cache: it is not limited to the range you specify."
          }
        }
      },
      {
        "id": "RemovalOptions",
        "type": "object",
        "description": "Options that determine exactly what data will be removed.",
        "properties": {
          "since": {
            "type": "number",
            "optional": true,
            "description": "Remove data accumulated on or after this date, represented in milliseconds since the epoch (accessible via the <code>getTime</code> method of the JavaScript <code>Date</code> object). If absent, defaults to 0 (which would remove all browsing data)."
          }
        }
      },
      {
        "id": "ZoomMode",
        "type": "string",
        "description": "Defines the how zooming is handled in the webview.",
        "enum": [
          {
            "name": "per-origin",
            "description": "Zoom changes will persist in the zoomed page's origin, i.e. all other webviews in the same partition that are navigated to that same origin will be zoomed as well. Moreover, <code>per-origin</code> zoom changes are saved with the origin, meaning that when navigating to other pages in the same origin, they will all be zoomed to the same zoom factor."
          },
          {
            "name": "per-view",
            "description": "Zoom changes only take effect in this webview, and zoom changes in other webviews will not affect the zooming of this webview. Also, <code>per-view</code> zoom changes are reset on navigation; navigating a webview will always load pages with their per-origin zoom factors (within the scope of the partition)."
          },
          {
            "name": "disabled",
            "description": "Disables all zooming in the webview. The content will revert to the default zoom level, and all attempted zoom changes will be ignored."
          }
        ]
      },
      {
        "id": "StopFindingAction",
        "type": "string",
        "description": "Determines what to do with the active match after the find session has ended. 'clear' will clear the highlighting over the active match; 'keep' will keep the active match highlighted; 'activate' will keep the active match highlighted and simulate a user click on that match.",
        "enum": ["clear", "keep", "activate"]
      },
      {
        "id": "SetPermissionAction",
        "type": "string",
        "enum": ["allow", "deny", "default"]
      },
      {
        "id": "InjectionItems",
        "type": "object",
        "description": "The type of injection item: code or a set of files.",
        "properties": {
          "code": {
            "type": "string",
            "optional": true,
            "description": "JavaScript code or CSS to be injected into matching pages."
          },
          "files": {
            "type": "array",
            "items": { "type": "string"},
            "optional": true,
            "description": "The list of JavaScript or CSS files to be injected into matching pages. These are injected in the order they appear in this array."
          }
        }
      },
      {
        "id": "ContentScriptDetails",
        "type": "object",
        "description": "Details of the content script to inject.",
        "properties": {
          "name": {
            "type": "string",
            "description": "The name of the content script to inject."
          },
          "matches": {
            "type": "array",
            "items": { "type": "string"},
            "description": "Specifies which pages this content script will be injected into."
          },
          "exclude_matches": {
            "type": "array",
            "items": { "type": "string"},
            "optional": true,
            "description": "Excludes pages that this content script would otherwise be injected into."
          },
          "match_about_blank": {
            "type": "boolean",
            "optional": true,
            "description": "Whether to insert the content script on about:blank and about:srcdoc. Content scripts will only be injected on pages when their inherit URL is matched by one of the declared patterns in the matches field. The inherit URL is the URL of the document that created the frame or window. Content scripts cannot be inserted in sandboxed frames."
          },
          "css": {
            "$ref": "InjectionItems",
            "optional": true,
            "description": "The CSS code or a list of CSS files to be injected into matching pages. These are injected in the order they appear, before any DOM is constructed or displayed for the page."
          },
          "js": {
            "$ref": "InjectionItems",
            "optional": true,
            "description": "The JavaScript code or a list of JavaScript files to be injected into matching pages. These are injected in the order they appear."
          },
          "run_at": {
            "$ref": "extensionTypes.RunAt",
            "optional": true,
            "description": "The soonest that the JavaScript or CSS will be injected into the tab. Defaults to \"document_idle\"."
          },
          "all_frames": {
            "type": "boolean",
            "optional": true,
            "description": "If allFrames is <code>true</code>, implies that the JavaScript or CSS should be injected into all frames of current page. By default, it's <code>false</code> and is only injected into the top frame."
          },
          "include_globs": {
            "type": "array",
            "items": { "type": "string"},
            "optional": true,
            "description": "Applied after matches to include only those URLs that also match this glob. Intended to emulate the @include Greasemonkey keyword."
          },
          "exclude_globs": {
            "type": "array",
            "items": { "type": "string"},
            "optional": true,
            "description": "Applied after matches to exclude URLs that match this glob. Intended to emulate the @exclude Greasemonkey keyword."
          }
        },
        "required": ["name", "matches"]
      }
    ],
    "functions": [
      {
        "name": "executeScript",
        "type": "function",
        "description": "Injects JavaScript code into a <webview> page.",
        "parameters": [
          {
            "type": "integer",
            "name": "instanceId",
            "description": "The instance ID of the guest <webview> process."
          },
          {
            "type": "string",
            "name": "src",
            "description": "The src of the guest <webview> tag."
          },
          {
            "$ref": "extensionTypes.InjectDetails",
            "name": "details",
            "description": "Details of the script to run."
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "description": "Called after all the JavaScript has been executed.",
            "parameters": [
              {
                "name": "result",
                "optional": true,
                "type": "array",
                "items": {"type": "any", "minimum": 0},
                "description": "The result of the script in every injected frame."
              }
            ]
          }
        ]
      },
      {
        "name": "insertCSS",
        "type": "function",
        "description": "Injects CSS into a <webview> page. For details, see the <a href='/extensions/content_scripts#pi'>programmatic injection</a> section of the content scripts doc.",
        "parameters": [
          {
            "type": "integer",
            "name": "instanceId",
            "description": "The instance ID of the guest <webview> process."
          },
          {
            "type": "string",
            "name": "src",
            "description": "The src of the guest <webview> tag."
          },
          {
            "$ref": "extensionTypes.InjectDetails",
            "name": "details",
            "description": "Details of the CSS text to insert."
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "description": "Called when all the CSS has been inserted.",
            "parameters": []
          }
        ]
      },
      {
        "name": "addContentScripts",
        "type": "function",
        "description": "Adds content scripts into a <webview> page. For details, see the <a href='/extensions/content_scripts#pi'>programmatic injection</a> section of the content scripts doc.",
        "parameters": [
          {
            "type": "integer",
            "name": "instanceId",
            "description": "The instance ID of the guest <webview> process."
          },
          {
            "type": "array",
            "name": "contentScriptList",
            "items": {
              "$ref": "ContentScriptDetails",
              "name": "contentScriptDetails"
            },
            "description": "Details of the content scripts to add.",
            "minItems": 1
          }
        ]
      },
      {
        "name": "removeContentScripts",
        "type": "function",
        "description": "Removes specified content scripts from a <webview> page. For details, see the <a href='/extensions/content_scripts#pi'>programmatic injection</a> section of the content scripts doc.",
        "parameters": [
          {
            "type": "integer",
            "name": "instanceId",
            "description": "The instance ID of the guest <webview> process."
          },
          {
            "type": "array",
            "name": "scriptNameList",
            "items": {
              "type": "string",
              "description": "The name of a content script that will be removed."
            },
            "optional": true,
            "description": "A list of names of content scripts that will be removed. If the list is empty, all the content scripts added to the <webview> page will be removed."
          }
        ]
      },
      {
        "name": "setZoom",
        "type": "function",
        "parameters": [
          {
            "type": "integer",
            "name": "instanceId",
            "description": "The instance ID of the guest <webview> process."
          },
          {
            "type": "number",
            "name": "zoomFactor",
            "description" : "The new zoom factor."
          },
          {
            "type": "function",
            "name": "callback",
            "description": "Called after the zoom message has been sent to the guest process.",
            "optional": true,
            "parameters": []
          }
        ]
      },
      {
        "name": "getZoom",
        "type": "function",
        "parameters": [
          {
            "type": "integer",
            "name": "instanceId",
            "description": "The instance ID of the guest <webview> process."
          },
          {
            "type": "function",
            "name": "callback",
            "description": "Called after the current zoom factor is retrieved.",
            "parameters": [
              {
                "type": "number",
                "name": "zoomFactor",
                "description": "The current zoom factor."
              }
            ]
          }
        ]
      },
      {
        "name": "setZoomMode",
        "type": "function",
        "description": "Sets the zoom mode of the webview.",
        "parameters": [
          {
            "type": "integer",
            "name": "instanceId",
            "description": "The instance ID of the guest <webview> process."
          },
          {
            "$ref": "ZoomMode",
            "name": "ZoomMode",
            "description": "Defines how zooming is handled in the webview."
          },
          {
            "type": "function",
            "name": "callback",
            "description": "Called after the zoom mode has been changed.",
            "optional": true,
            "parameters": []
          }
        ]
      },
      {
        "name": "getZoomMode",
        "type": "function",
        "description": "Gets the current zoom mode.",
        "parameters": [
          {
            "type": "integer",
            "name": "instanceId",
            "description": "The instance ID of the guest <webview> process."
          },
          {
            "type": "function",
            "name": "callback",
            "description": "Called with the webview's current zoom mode.",
            "parameters": [
              {
                "$ref": "ZoomMode",
                "name": "ZoomMode",
                "description": "The webview's current zoom mode."
              }
            ]
          }
        ]
      },
      {
        "name": "find",
        "type": "function",
        "description": "Initiates a find-in-page request.",
        "parameters": [
          {
            "type": "integer",
            "name": "instanceId",
            "description": "The instance ID of the guest <webview> process."
          },
          {
            "type": "string",
            "name": "searchText",
            "description": "The string to find in the page."
          },
          {
            "type": "object",
            "name": "options",
            "optional": true,
            "properties": {
              "backward": {
                "type": "boolean",
                "description": "Flag to find matches in reverse order.",
                "optional": true
              },
              "matchCase": {
                "type": "boolean",
                "description": "Flag to match |searchText| with case-sensitivity.",
                "optional": true
              }
            }
          },
          {
            "type": "function",
            "name": "callback",
            "description": "Called after all find results have been returned for this find request.",
            "optional": true,
            "parameters": [
              {
                "type": "object",
                "name": "results",
                "optional": true,
                "properties": {
                  "numberOfMatches": {
                    "type": "integer",
                    "description": "The number of times |searchText| was matched on the page."
                  },
                  "activeMatchOrdinal": {
                    "type": "integer",
                    "description": "The ordinal number of the current match."
                  },
                  "selectionRect": {
                    "type": "object",
                    "description": "Describes a rectangle around the active match.",
                    "properties": {
                      "left": {
                        "type": "integer"
                      },
                      "top": {
                        "type": "integer"
                      },
                      "width": {
                        "type": "integer"
                      },
                      "height": {
                        "type": "integer"
                      }
                    }
                  },
                  "canceled": {
                    "type": "boolean",
                    "description": "Indicates whether this find request was canceled."
                  }
                }
              }
            ]
          }
        ]
      },
      {
        "name": "stopFinding",
        "type": "function",
        "description": "Ends the current find session (clearing all highlighting) and cancels all find requests in progress.",
        "parameters": [
          {
            "type": "integer",
            "name": "instanceId",
            "description": "The instance ID of the guest <webview> process."
          },
          {
            "$ref": "StopFindingAction",
            "name": "action",
            "description": "Determines what to do with the active match after the find session has ended.",
            "optional": true
          }
        ]
      },
      {
	"name": "loadDataWithBaseUrl",
	"type": "function",
	"description": "Loads a data URL with a specified base URL used for relative links. Optionally, a virtual URL can be provided to be shown to the user instead of the data URL.",
	"parameters": [
          {
            "type": "integer",
            "name": "instanceId",
            "description": "The instance ID of the guest <webview> process."
          },
          {
            "type": "string",
            "name": "dataUrl",
            "description" : "The data URL to load."
          },
          {
            "type": "string",
            "name": "baseUrl",
            "description": "The base URL that will be used for relative links."
          },
	  {
            "type": "string",
            "name": "virtualUrl",
            "description": "The URL that will be displayed to the user.",
	    "optional": true
          },
	  {
            "type": "function",
            "name": "callback",
            "description": "Called internally for the purpose of reporting errors to console.error().",
            "parameters": []
          }
        ]
      },
      {
        "name": "go",
        "type": "function",
        "parameters": [
          {
            "type": "integer",
            "name": "instanceId"
          },
          {
            "type": "integer",
            "name": "relativeIndex"
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "parameters": [
              {
                "name": "success",
                "type": "boolean",
                "description": "Indicates whether the navigation was successful."
              }
            ]
          }
        ]
      },
      {
        "name": "overrideUserAgent",
        "type": "function",
        "parameters": [
          {
            "type": "integer",
            "name": "instanceId"
          },
          {
            "type": "string",
            "name": "userAgentOverride"
          }
        ]
      },
      {
        "name": "reload",
        "type": "function",
        "parameters": [
          {
            "type": "integer",
            "name": "instanceId"
          }
        ]
      },
      {
        "name": "setAllowTransparency",
        "type": "function",
        "parameters": [
          {
            "type": "integer",
            "name": "instanceId"
          },
          {
            "type": "boolean",
            "name": "allow"
          }
        ]
      },
      {
        "name": "setAllowScaling",
        "type": "function",
        "parameters": [
          {
            "type": "integer",
            "name": "instanceId"
          },
          {
            "type": "boolean",
            "name": "allow"
          }
        ]
      },
      {
        "name": "setName",
        "type": "function",
        "parameters": [
          {
            "type": "integer",
            "name": "instanceId"
          },
          {
            "type": "string",
            "name": "frameName"
          }
        ]
      },
      {
        "name": "setPermission",
        "type": "function",
        "parameters": [
          {
            "type": "integer",
            "name": "instanceId"
          },
          {
            "type": "integer",
            "name": "requestId"
          },
          {
            "$ref": "SetPermissionAction",
            "name": "action"
          },
          {
            "type": "string",
            "name": "userInput",
            "optional": true
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "parameters": [
              {
                "name": "allowed",
                "type": "boolean"
              }
            ]
          }
        ]
      },
      {
        "name": "navigate",
        "type": "function",
        "parameters": [
          {
            "type": "integer",
            "name": "instanceId"
          },
          {
            "type": "string",
            "name": "src"
          }
        ]
      },
      {
        "name": "stop",
        "type": "function",
        "parameters": [
          {
            "type": "integer",
            "name": "instanceId"
          }
        ]
      },
      {
        "name": "terminate",
        "type": "function",
        "parameters": [
          {
            "type": "integer",
            "name": "instanceId"
          }
        ]
      },
      {
        "name": "clearData",
        "type": "function",
        "description": "Clears various types of browsing data stored in a storage partition of a <webview>.",
        "parameters": [
          {
            "type": "integer",
            "name": "instanceId",
            "description": "The instance ID of the guest <webview> process."
          },
          {
            "$ref": "RemovalOptions",
            "name": "options"
          },
          {
            "name": "dataToRemove",
            "$ref": "DataTypeSet",
            "description": "The set of data types to remove."
          },
          {
            "name": "callback",
            "type": "function",
            "description": "Called when deletion has completed.",
            "optional": true,
            "parameters": []
          }
        ]
      }
    ]
  }
]