1/* 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * Provides methods for controlling the web controller. 18 * 19 * @syscap SystemCapability.Web.Webview.Core 20 * @since 9 21 */ 22/** 23 * Provides methods for controlling the web controller. 24 * 25 * @syscap SystemCapability.Web.Webview.Core 26 * @crossplatform 27 * @since 10 28 */ 29/** 30 * Provides methods for controlling the web controller. 31 * 32 * @syscap SystemCapability.Web.Webview.Core 33 * @crossplatform 34 * @atomicservice 35 * @since 11 36 */ 37declare type WebviewController = import('../api/@ohos.web.webview').default.WebviewController; 38 39/** 40 * The callback of load committed. 41 * 42 * @syscap SystemCapability.Web.Webview.Core 43 * @atomicservice 44 * @since 11 45 */ 46type OnNavigationEntryCommittedCallback = (loadCommittedDetails: LoadCommittedDetails) => void; 47 48/** 49 * Enum type supplied to {@link getMessageLevel} for receiving the console log level of JavaScript. 50 * 51 * @enum { number } 52 * @syscap SystemCapability.Web.Webview.Core 53 * @since 8 54 */ 55/** 56 * Enum type supplied to {@link getMessageLevel} for receiving the console log level of JavaScript. 57 * 58 * @enum { number } 59 * @syscap SystemCapability.Web.Webview.Core 60 * @crossplatform 61 * @atomicservice 62 * @since 11 63 */ 64declare enum MessageLevel { 65 /** 66 * Debug level. 67 * 68 * @syscap SystemCapability.Web.Webview.Core 69 * @since 8 70 */ 71 /** 72 * Debug level. 73 * 74 * @syscap SystemCapability.Web.Webview.Core 75 * @crossplatform 76 * @atomicservice 77 * @since 11 78 */ 79 Debug, 80 81 /** 82 * Error level. 83 * 84 * @syscap SystemCapability.Web.Webview.Core 85 * @since 8 86 */ 87 /** 88 * Error level. 89 * 90 * @syscap SystemCapability.Web.Webview.Core 91 * @crossplatform 92 * @atomicservice 93 * @since 11 94 */ 95 Error, 96 97 /** 98 * Info level. 99 * 100 * @syscap SystemCapability.Web.Webview.Core 101 * @since 8 102 */ 103 /** 104 * Info level. 105 * 106 * @syscap SystemCapability.Web.Webview.Core 107 * @crossplatform 108 * @atomicservice 109 * @since 11 110 */ 111 Info, 112 113 /** 114 * Log level. 115 * 116 * @syscap SystemCapability.Web.Webview.Core 117 * @since 8 118 */ 119 /** 120 * Log level. 121 * 122 * @syscap SystemCapability.Web.Webview.Core 123 * @crossplatform 124 * @atomicservice 125 * @since 11 126 */ 127 Log, 128 129 /** 130 * Warn level. 131 * 132 * @syscap SystemCapability.Web.Webview.Core 133 * @since 8 134 */ 135 /** 136 * Warn level. 137 * 138 * @syscap SystemCapability.Web.Webview.Core 139 * @crossplatform 140 * @atomicservice 141 * @since 11 142 */ 143 Warn, 144} 145 146/** 147 * The Web's behavior to load from HTTP or HTTPS. Defaults to MixedMode.None. 148 * 149 * @enum { number } 150 * @syscap SystemCapability.Web.Webview.Core 151 * @since 8 152 */ 153/** 154 * The Web's behavior to load from HTTP or HTTPS. Defaults to MixedMode.None. 155 * 156 * @enum { number } 157 * @syscap SystemCapability.Web.Webview.Core 158 * @atomicservice 159 * @since 11 160 */ 161declare enum MixedMode { 162 /** 163 * Allows all sources. 164 * 165 * @syscap SystemCapability.Web.Webview.Core 166 * @since 8 167 */ 168 /** 169 * Allows all sources. 170 * 171 * @syscap SystemCapability.Web.Webview.Core 172 * @atomicservice 173 * @since 11 174 */ 175 All, 176 177 /** 178 * Allows sources Compatibly. 179 * 180 * @syscap SystemCapability.Web.Webview.Core 181 * @since 8 182 */ 183 /** 184 * Allows sources Compatibly. 185 * 186 * @syscap SystemCapability.Web.Webview.Core 187 * @atomicservice 188 * @since 11 189 */ 190 Compatible, 191 192 /** 193 * Don't allow unsecure sources from a secure origin. 194 * 195 * @syscap SystemCapability.Web.Webview.Core 196 * @since 8 197 */ 198 /** 199 * Don't allow unsecure sources from a secure origin. 200 * 201 * @syscap SystemCapability.Web.Webview.Core 202 * @atomicservice 203 * @since 11 204 */ 205 None, 206} 207 208/** 209 * The callback of safe browsing check. 210 * 211 * @syscap SystemCapability.Web.Webview.Core 212 * @atomicservice 213 * @since 11 214 */ 215type OnSafeBrowsingCheckResultCallback = (threatType: ThreatType) => void; 216 217/** 218 * Enum type supplied to {@link getHitTest} for indicating the cursor node HitTest. 219 * 220 * @enum { number } 221 * @syscap SystemCapability.Web.Webview.Core 222 * @since 8 223 */ 224/** 225 * Enum type supplied to {@link getHitTest} for indicating the cursor node HitTest. 226 * 227 * @enum { number } 228 * @syscap SystemCapability.Web.Webview.Core 229 * @atomicservice 230 * @since 11 231 */ 232declare enum HitTestType { 233 /** 234 * The edit text. 235 * 236 * @syscap SystemCapability.Web.Webview.Core 237 * @since 8 238 */ 239 /** 240 * The edit text. 241 * 242 * @syscap SystemCapability.Web.Webview.Core 243 * @atomicservice 244 * @since 11 245 */ 246 EditText, 247 248 /** 249 * The email address. 250 * 251 * @syscap SystemCapability.Web.Webview.Core 252 * @since 8 253 */ 254 /** 255 * The email address. 256 * 257 * @syscap SystemCapability.Web.Webview.Core 258 * @atomicservice 259 * @since 11 260 */ 261 Email, 262 263 /** 264 * The HTML::a tag with src=http. 265 * 266 * @syscap SystemCapability.Web.Webview.Core 267 * @since 8 268 */ 269 /** 270 * The HTML::a tag with src=http. 271 * 272 * @syscap SystemCapability.Web.Webview.Core 273 * @atomicservice 274 * @since 11 275 */ 276 HttpAnchor, 277 278 /** 279 * The HTML::a tag with src=http + HTML::img. 280 * 281 * @syscap SystemCapability.Web.Webview.Core 282 * @since 8 283 */ 284 /** 285 * The HTML::a tag with src=http + HTML::img. 286 * 287 * @syscap SystemCapability.Web.Webview.Core 288 * @atomicservice 289 * @since 11 290 */ 291 HttpAnchorImg, 292 293 /** 294 * The HTML::img tag. 295 * 296 * @syscap SystemCapability.Web.Webview.Core 297 * @since 8 298 */ 299 /** 300 * The HTML::img tag. 301 * 302 * @syscap SystemCapability.Web.Webview.Core 303 * @atomicservice 304 * @since 11 305 */ 306 Img, 307 308 /** 309 * The map address. 310 * 311 * @syscap SystemCapability.Web.Webview.Core 312 * @since 8 313 */ 314 /** 315 * The map address. 316 * 317 * @syscap SystemCapability.Web.Webview.Core 318 * @atomicservice 319 * @since 11 320 */ 321 Map, 322 323 /** 324 * The phone number. 325 * 326 * @syscap SystemCapability.Web.Webview.Core 327 * @since 8 328 */ 329 /** 330 * The phone number. 331 * 332 * @syscap SystemCapability.Web.Webview.Core 333 * @atomicservice 334 * @since 11 335 */ 336 Phone, 337 338 /** 339 * Other unknown HitTest. 340 * 341 * @syscap SystemCapability.Web.Webview.Core 342 * @since 8 343 */ 344 /** 345 * Other unknown HitTest. 346 * 347 * @syscap SystemCapability.Web.Webview.Core 348 * @atomicservice 349 * @since 11 350 */ 351 Unknown, 352} 353 354/** 355 * Enum type supplied to {@link cacheMode} for setting the Web cache mode. 356 * 357 * @enum { number } 358 * @syscap SystemCapability.Web.Webview.Core 359 * @since 8 360 */ 361/** 362 * Enum type supplied to {@link cacheMode} for setting the Web cache mode. 363 * 364 * @enum { number } 365 * @syscap SystemCapability.Web.Webview.Core 366 * @atomicservice 367 * @since 11 368 */ 369declare enum CacheMode { 370 /** 371 * load cache when they are available and not expired, otherwise load online. 372 * 373 * @syscap SystemCapability.Web.Webview.Core 374 * @since 9 375 */ 376 /** 377 * load cache when they are available and not expired, otherwise load online. 378 * 379 * @syscap SystemCapability.Web.Webview.Core 380 * @atomicservice 381 * @since 11 382 */ 383 Default, 384 385 /** 386 * load cache when they are available, otherwise load online. 387 * 388 * @syscap SystemCapability.Web.Webview.Core 389 * @since 8 390 */ 391 /** 392 * load cache when they are available, otherwise load online. 393 * 394 * @syscap SystemCapability.Web.Webview.Core 395 * @atomicservice 396 * @since 11 397 */ 398 None, 399 400 /** 401 * Load cache first, then online. 402 * 403 * @syscap SystemCapability.Web.Webview.Core 404 * @since 8 405 */ 406 /** 407 * Load cache first, then online. 408 * 409 * @syscap SystemCapability.Web.Webview.Core 410 * @atomicservice 411 * @since 11 412 */ 413 Online, 414 415 /** 416 * load cache and not online. 417 * 418 * @syscap SystemCapability.Web.Webview.Core 419 * @since 8 420 */ 421 /** 422 * load cache and not online. 423 * 424 * @syscap SystemCapability.Web.Webview.Core 425 * @atomicservice 426 * @since 11 427 */ 428 Only, 429} 430 431/** 432 * Enum type supplied to {@link overScrollMode} for setting the web overScroll mode. 433 * 434 * @enum { number } 435 * @syscap SystemCapability.Web.Webview.Core 436 * @atomicservice 437 * @since 11 438 */ 439declare enum OverScrollMode { 440 /** 441 * Disable the web over-scroll mode. 442 * 443 * @syscap SystemCapability.Web.Webview.Core 444 * @atomicservice 445 * @since 11 446 */ 447 NEVER, 448 /** 449 * Enable the web over-scroll mode. 450 * 451 * @syscap SystemCapability.Web.Webview.Core 452 * @atomicservice 453 * @since 11 454 */ 455 ALWAYS 456} 457 458/** 459 * Enum type supplied to {@link darkMode} for setting the web dark mode. 460 * 461 * @enum { number } 462 * @syscap SystemCapability.Web.Webview.Core 463 * @since 9 464 */ 465/** 466 * Enum type supplied to {@link darkMode} for setting the web dark mode. 467 * 468 * @enum { number } 469 * @syscap SystemCapability.Web.Webview.Core 470 * @atomicservice 471 * @since 11 472 */ 473declare enum WebDarkMode { 474 /** 475 * Disable the web dark mode. 476 * 477 * @syscap SystemCapability.Web.Webview.Core 478 * @since 9 479 */ 480 /** 481 * Disable the web dark mode. 482 * 483 * @syscap SystemCapability.Web.Webview.Core 484 * @atomicservice 485 * @since 11 486 */ 487 Off, 488 489 /** 490 * Enable the web dark mode. 491 * 492 * @syscap SystemCapability.Web.Webview.Core 493 * @since 9 494 */ 495 /** 496 * Enable the web dark mode. 497 * 498 * @syscap SystemCapability.Web.Webview.Core 499 * @atomicservice 500 * @since 11 501 */ 502 On, 503 504 /** 505 * Make web dark mode follow the system. 506 * 507 * @syscap SystemCapability.Web.Webview.Core 508 * @since 9 509 */ 510 /** 511 * Make web dark mode follow the system. 512 * 513 * @syscap SystemCapability.Web.Webview.Core 514 * @atomicservice 515 * @since 11 516 */ 517 Auto, 518} 519 520/** 521 * Enum type supplied to {@link captureMode} for setting the web capture mode. 522 * 523 * @enum { number } 524 * @syscap SystemCapability.Web.Webview.Core 525 * @since 10 526 */ 527/** 528 * Enum type supplied to {@link captureMode} for setting the web capture mode. 529 * 530 * @enum { number } 531 * @syscap SystemCapability.Web.Webview.Core 532 * @atomicservice 533 * @since 11 534 */ 535declare enum WebCaptureMode { 536 /** 537 * The home screen. 538 * @syscap SystemCapability.Web.Webview.Core 539 * @since 10 540 */ 541 /** 542 * The home screen. 543 * @syscap SystemCapability.Web.Webview.Core 544 * @atomicservice 545 * @since 11 546 */ 547 HOME_SCREEN = 0, 548} 549 550/** 551 * Enum type supplied to {@link threatType} for the website's threat type. 552 * 553 * @enum { number } 554 * @syscap SystemCapability.Web.Webview.Core 555 * @atomicservice 556 * @since 11 557 */ 558declare enum ThreatType { 559 /** 560 * Illegal websites. 561 * 562 * @syscap SystemCapability.Web.Webview.Core 563 * @atomicservice 564 * @since 11 565 */ 566 THREAT_ILLEGAL = 0, 567 568 /** 569 * Fraud websites. 570 * 571 * @syscap SystemCapability.Web.Webview.Core 572 * @atomicservice 573 * @since 11 574 */ 575 THREAT_FRAUD = 1, 576 577 /** 578 * Websites with security risks. 579 * 580 * @syscap SystemCapability.Web.Webview.Core 581 * @atomicservice 582 * @since 11 583 */ 584 THREAT_RISK = 2, 585 586 /** 587 * Websites suspected of containing unhealthy content. 588 * ArkWeb will not intercept this type of website and apps could handle it themselves. 589 * 590 * @syscap SystemCapability.Web.Webview.Core 591 * @atomicservice 592 * @since 11 593 */ 594 THREAT_WARNING = 3, 595} 596 597/** 598 * Defines the Media Options. 599 * 600 * @interface WebMediaOptions 601 * @syscap SystemCapability.Web.Webview.Core 602 * @since 10 603 */ 604/** 605 * Defines the Media Options. 606 * 607 * @interface WebMediaOptions 608 * @syscap SystemCapability.Web.Webview.Core 609 * @atomicservice 610 * @since 11 611 */ 612declare interface WebMediaOptions { 613 /** 614 * The time interval for audio playback to resume. 615 * 616 * @type { ?number } 617 * @syscap SystemCapability.Web.Webview.Core 618 * @since 10 619 */ 620 /** 621 * The time interval for audio playback to resume. 622 * 623 * @type { ?number } 624 * @syscap SystemCapability.Web.Webview.Core 625 * @atomicservice 626 * @since 11 627 */ 628 resumeInterval?: number; 629 /** 630 * Whether the audio of each web is exclusive. 631 * 632 * @type { ?boolean } 633 * @syscap SystemCapability.Web.Webview.Core 634 * @since 10 635 */ 636 /** 637 * Whether the audio of each web is exclusive. 638 * 639 * @type { ?boolean } 640 * @syscap SystemCapability.Web.Webview.Core 641 * @atomicservice 642 * @since 11 643 */ 644 audioExclusive?: boolean; 645} 646 647/** 648 * Defines the screen capture configuration. 649 * 650 * @interface ScreenCaptureConfig 651 * @syscap SystemCapability.Web.Webview.Core 652 * @since 10 653 */ 654/** 655 * Defines the screen capture configuration. 656 * 657 * @interface ScreenCaptureConfig 658 * @syscap SystemCapability.Web.Webview.Core 659 * @atomicservice 660 * @since 11 661 */ 662declare interface ScreenCaptureConfig { 663 /** 664 * The mode for selecting the recording area. 665 * 666 * @type { WebCaptureMode } 667 * @syscap SystemCapability.Web.Webview.Core 668 * @since 10 669 */ 670 /** 671 * The mode for selecting the recording area. 672 * 673 * @type { WebCaptureMode } 674 * @syscap SystemCapability.Web.Webview.Core 675 * @atomicservice 676 * @since 11 677 */ 678 captureMode: WebCaptureMode; 679} 680 681/** 682 * Define the handler to exit the full screen mode, related to the {@link onFullScreenEnter} event. 683 * 684 * @syscap SystemCapability.Web.Webview.Core 685 * @since 9 686 */ 687/** 688 * Define the handler to exit the full screen mode, related to the {@link onFullScreenEnter} event. 689 * 690 * @syscap SystemCapability.Web.Webview.Core 691 * @atomicservice 692 * @since 11 693 */ 694declare class FullScreenExitHandler { 695 /** 696 * Constructor. 697 * 698 * @syscap SystemCapability.Web.Webview.Core 699 * @since 9 700 */ 701 /** 702 * Constructor. 703 * 704 * @syscap SystemCapability.Web.Webview.Core 705 * @atomicservice 706 * @since 11 707 */ 708 constructor(); 709 710 /** 711 * Exit the full screen mode. 712 * 713 * @syscap SystemCapability.Web.Webview.Core 714 * @since 9 715 */ 716 /** 717 * Exit the full screen mode. 718 * 719 * @syscap SystemCapability.Web.Webview.Core 720 * @atomicservice 721 * @since 11 722 */ 723 exitFullScreen(): void; 724} 725 726/** 727 * Enum type supplied to {@link renderExitReason} when onRenderExited being called. 728 * 729 * @enum { number } 730 * @syscap SystemCapability.Web.Webview.Core 731 * @since 9 732 */ 733/** 734 * Enum type supplied to {@link renderExitReason} when onRenderExited being called. 735 * 736 * @enum { number } 737 * @syscap SystemCapability.Web.Webview.Core 738 * @atomicservice 739 * @since 11 740 */ 741declare enum RenderExitReason { 742 /** 743 * Render process non-zero exit status. 744 * 745 * @syscap SystemCapability.Web.Webview.Core 746 * @since 9 747 */ 748 /** 749 * Render process non-zero exit status. 750 * 751 * @syscap SystemCapability.Web.Webview.Core 752 * @atomicservice 753 * @since 11 754 */ 755 ProcessAbnormalTermination, 756 757 /** 758 * SIGKILL or task manager kill. 759 * 760 * @syscap SystemCapability.Web.Webview.Core 761 * @since 9 762 */ 763 /** 764 * SIGKILL or task manager kill. 765 * 766 * @syscap SystemCapability.Web.Webview.Core 767 * @atomicservice 768 * @since 11 769 */ 770 ProcessWasKilled, 771 772 /** 773 * Segmentation fault. 774 * 775 * @syscap SystemCapability.Web.Webview.Core 776 * @since 9 777 */ 778 /** 779 * Segmentation fault. 780 * 781 * @syscap SystemCapability.Web.Webview.Core 782 * @atomicservice 783 * @since 11 784 */ 785 ProcessCrashed, 786 787 /** 788 * Out of memory. 789 * 790 * @syscap SystemCapability.Web.Webview.Core 791 * @since 9 792 */ 793 /** 794 * Out of memory. 795 * 796 * @syscap SystemCapability.Web.Webview.Core 797 * @atomicservice 798 * @since 11 799 */ 800 ProcessOom, 801 802 /** 803 * Unknown reason. 804 * 805 * @syscap SystemCapability.Web.Webview.Core 806 * @since 9 807 */ 808 /** 809 * Unknown reason. 810 * 811 * @syscap SystemCapability.Web.Webview.Core 812 * @atomicservice 813 * @since 11 814 */ 815 ProcessExitUnknown, 816} 817 818 /** 819 * The callback of custom hide of the context menu. 820 * 821 * @syscap SystemCapability.Web.Webview.Core 822 * @atomicservice 823 * @since 11 824 */ 825 type OnContextMenuHideCallback = () => void; 826 827/** 828 * Enum type supplied to {@link error} when onSslErrorEventReceive being called. 829 * 830 * @enum { number } 831 * @syscap SystemCapability.Web.Webview.Core 832 * @since 9 833 */ 834/** 835 * Enum type supplied to {@link error} when onSslErrorEventReceive being called. 836 * 837 * @enum { number } 838 * @syscap SystemCapability.Web.Webview.Core 839 * @atomicservice 840 * @since 11 841 */ 842declare enum SslError { 843 /** 844 * General error. 845 * 846 * @syscap SystemCapability.Web.Webview.Core 847 * @since 9 848 */ 849 /** 850 * General error. 851 * 852 * @syscap SystemCapability.Web.Webview.Core 853 * @atomicservice 854 * @since 11 855 */ 856 Invalid, 857 858 /** 859 * Hostname mismatch. 860 * 861 * @syscap SystemCapability.Web.Webview.Core 862 * @since 9 863 */ 864 /** 865 * Hostname mismatch. 866 * 867 * @syscap SystemCapability.Web.Webview.Core 868 * @atomicservice 869 * @since 11 870 */ 871 HostMismatch, 872 873 /** 874 * The certificate date is invalid. 875 * 876 * @syscap SystemCapability.Web.Webview.Core 877 * @since 9 878 */ 879 /** 880 * The certificate date is invalid. 881 * 882 * @syscap SystemCapability.Web.Webview.Core 883 * @atomicservice 884 * @since 11 885 */ 886 DateInvalid, 887 888 /** 889 * The certificate authority is not trusted. 890 * 891 * @syscap SystemCapability.Web.Webview.Core 892 * @since 9 893 */ 894 /** 895 * The certificate authority is not trusted. 896 * 897 * @syscap SystemCapability.Web.Webview.Core 898 * @atomicservice 899 * @since 11 900 */ 901 Untrusted, 902} 903 904/** 905 * Enum type supplied to {@link FileSelectorParam} when onFileSelectorShow being called. 906 * 907 * @enum { number } 908 * @syscap SystemCapability.Web.Webview.Core 909 * @since 9 910 */ 911/** 912 * Enum type supplied to {@link FileSelectorParam} when onFileSelectorShow being called. 913 * 914 * @enum { number } 915 * @syscap SystemCapability.Web.Webview.Core 916 * @crossplatform 917 * @atomicservice 918 * @since 11 919 */ 920declare enum FileSelectorMode { 921 /** 922 * Allows single file to be selected. 923 * 924 * @syscap SystemCapability.Web.Webview.Core 925 * @since 9 926 */ 927 /** 928 * Allows single file to be selected. 929 * 930 * @syscap SystemCapability.Web.Webview.Core 931 * @crossplatform 932 * @atomicservice 933 * @since 11 934 */ 935 FileOpenMode, 936 937 /** 938 * Allows multiple files to be selected. 939 * 940 * @syscap SystemCapability.Web.Webview.Core 941 * @since 9 942 */ 943 /** 944 * Allows multiple files to be selected. 945 * 946 * @syscap SystemCapability.Web.Webview.Core 947 * @crossplatform 948 * @atomicservice 949 * @since 11 950 */ 951 FileOpenMultipleMode, 952 953 /** 954 * Allows file folders to be selected. 955 * 956 * @syscap SystemCapability.Web.Webview.Core 957 * @since 9 958 */ 959 /** 960 * Allows file folders to be selected. 961 * 962 * @syscap SystemCapability.Web.Webview.Core 963 * @crossplatform 964 * @atomicservice 965 * @since 11 966 */ 967 FileOpenFolderMode, 968 969 /** 970 * Allows select files to save. 971 * 972 * @syscap SystemCapability.Web.Webview.Core 973 * @since 9 974 */ 975 /** 976 * Allows select files to save. 977 * 978 * @syscap SystemCapability.Web.Webview.Core 979 * @crossplatform 980 * @atomicservice 981 * @since 11 982 */ 983 FileSaveMode, 984} 985 986/** 987 * Enum type supplied to {@link layoutMode} for setting the web layout mode. 988 * 989 * @enum { number } 990 * @syscap SystemCapability.Web.Webview.Core 991 * @atomicservice 992 * @since 11 993 */ 994declare enum WebLayoutMode { 995 /** 996 * Web layout follows the system. 997 * 998 * @syscap SystemCapability.Web.Webview.Core 999 * @atomicservice 1000 * @since 11 1001 */ 1002 NONE, 1003 1004 /** 1005 * Adaptive web layout based on page size. 1006 * 1007 * @syscap SystemCapability.Web.Webview.Core 1008 * @atomicservice 1009 * @since 11 1010 */ 1011 FIT_CONTENT, 1012} 1013 1014/** 1015 * Encompassed message information as parameters to {@link onFileSelectorShow} method. 1016 * 1017 * @syscap SystemCapability.Web.Webview.Core 1018 * @since 9 1019 */ 1020/** 1021 * Encompassed message information as parameters to {@link onFileSelectorShow} method. 1022 * 1023 * @syscap SystemCapability.Web.Webview.Core 1024 * @crossplatform 1025 * @atomicservice 1026 * @since 11 1027 */ 1028declare class FileSelectorParam { 1029 /** 1030 * Constructor. 1031 * 1032 * @syscap SystemCapability.Web.Webview.Core 1033 * @since 9 1034 */ 1035 /** 1036 * Constructor. 1037 * 1038 * @syscap SystemCapability.Web.Webview.Core 1039 * @crossplatform 1040 * @atomicservice 1041 * @since 11 1042 */ 1043 constructor(); 1044 1045 /** 1046 * Gets the title of this file selector. 1047 * @returns { string } Return the title of this file selector. 1048 * @syscap SystemCapability.Web.Webview.Core 1049 * @since 9 1050 */ 1051 /** 1052 * Gets the title of this file selector. 1053 * @returns { string } Return the title of this file selector. 1054 * @syscap SystemCapability.Web.Webview.Core 1055 * @crossplatform 1056 * @atomicservice 1057 * @since 11 1058 */ 1059 getTitle(): string; 1060 1061 /** 1062 * Gets the FileSelectorMode of this file selector. 1063 * @returns { FileSelectorMode } Return the FileSelectorMode of this file selector. 1064 * @syscap SystemCapability.Web.Webview.Core 1065 * @since 9 1066 */ 1067 /** 1068 * Gets the FileSelectorMode of this file selector. 1069 * @returns { FileSelectorMode } Return the FileSelectorMode of this file selector. 1070 * @syscap SystemCapability.Web.Webview.Core 1071 * @crossplatform 1072 * @atomicservice 1073 * @since 11 1074 */ 1075 getMode(): FileSelectorMode; 1076 1077 /** 1078 * Gets an array of acceptable MMIE type. 1079 * @returns { Array<string> } Return an array of acceptable MMIE type. 1080 * @syscap SystemCapability.Web.Webview.Core 1081 * @since 9 1082 */ 1083 /** 1084 * Gets an array of acceptable MMIE type. 1085 * @returns { Array<string> } Return an array of acceptable MMIE type. 1086 * @syscap SystemCapability.Web.Webview.Core 1087 * @crossplatform 1088 * @atomicservice 1089 * @since 11 1090 */ 1091 getAcceptType(): Array<string>; 1092 1093 /** 1094 * Gets whether this file selector use a live media captured value. 1095 * 1096 * @returns { boolean } Return {@code true} if captured media; return {@code false} otherwise. 1097 * @syscap SystemCapability.Web.Webview.Core 1098 * @since 9 1099 */ 1100 /** 1101 * Gets whether this file selector use a live media captured value. 1102 * 1103 * @returns { boolean } Return {@code true} if captured media; return {@code false} otherwise. 1104 * @syscap SystemCapability.Web.Webview.Core 1105 * @crossplatform 1106 * @atomicservice 1107 * @since 11 1108 */ 1109 isCapture(): boolean; 1110} 1111 1112/** 1113 * Defines the js result. 1114 * 1115 * @syscap SystemCapability.Web.Webview.Core 1116 * @since 8 1117 */ 1118/** 1119 * Defines the js result. 1120 * 1121 * @syscap SystemCapability.Web.Webview.Core 1122 * @crossplatform 1123 * @atomicservice 1124 * @since 11 1125 */ 1126declare class JsResult { 1127 /** 1128 * Constructor. 1129 * 1130 * @syscap SystemCapability.Web.Webview.Core 1131 * @since 8 1132 */ 1133 /** 1134 * Constructor. 1135 * 1136 * @syscap SystemCapability.Web.Webview.Core 1137 * @crossplatform 1138 * @atomicservice 1139 * @since 11 1140 */ 1141 constructor(); 1142 1143 /** 1144 * Handle the user's JavaScript result if cancel the dialog. 1145 * 1146 * @syscap SystemCapability.Web.Webview.Core 1147 * @since 8 1148 */ 1149 /** 1150 * Handle the user's JavaScript result if cancel the dialog. 1151 * 1152 * @syscap SystemCapability.Web.Webview.Core 1153 * @crossplatform 1154 * @atomicservice 1155 * @since 11 1156 */ 1157 handleCancel(): void; 1158 1159 /** 1160 * Handle the user's JavaScript result if confirm the dialog. 1161 * 1162 * @syscap SystemCapability.Web.Webview.Core 1163 * @since 8 1164 */ 1165 /** 1166 * Handle the user's JavaScript result if confirm the dialog. 1167 * 1168 * @syscap SystemCapability.Web.Webview.Core 1169 * @crossplatform 1170 * @atomicservice 1171 * @since 11 1172 */ 1173 handleConfirm(): void; 1174 1175 /** 1176 * Handle the user's JavaScript result if confirm the prompt dialog. 1177 * 1178 * @param { string } result 1179 * @syscap SystemCapability.Web.Webview.Core 1180 * @since 9 1181 */ 1182 /** 1183 * Handle the user's JavaScript result if confirm the prompt dialog. 1184 * 1185 * @param { string } result 1186 * @syscap SystemCapability.Web.Webview.Core 1187 * @crossplatform 1188 * @atomicservice 1189 * @since 11 1190 */ 1191 handlePromptConfirm(result: string): void; 1192} 1193 1194/** 1195 * Defines the file selector result, related to {@link onFileSelectorShow} method. 1196 * 1197 * @syscap SystemCapability.Web.Webview.Core 1198 * @since 9 1199 */ 1200/** 1201 * Defines the file selector result, related to {@link onFileSelectorShow} method. 1202 * 1203 * @syscap SystemCapability.Web.Webview.Core 1204 * @crossplatform 1205 * @atomicservice 1206 * @since 11 1207 */ 1208declare class FileSelectorResult { 1209 /** 1210 * Constructor. 1211 * 1212 * @syscap SystemCapability.Web.Webview.Core 1213 * @since 9 1214 */ 1215 /** 1216 * Constructor. 1217 * 1218 * @syscap SystemCapability.Web.Webview.Core 1219 * @crossplatform 1220 * @atomicservice 1221 * @since 11 1222 */ 1223 constructor(); 1224 1225 /** 1226 * select a list of files. 1227 * 1228 * @param { Array<string> } fileList 1229 * @syscap SystemCapability.Web.Webview.Core 1230 * @since 9 1231 */ 1232 /** 1233 * select a list of files. 1234 * 1235 * @param { Array<string> } fileList 1236 * @syscap SystemCapability.Web.Webview.Core 1237 * @crossplatform 1238 * @atomicservice 1239 * @since 11 1240 */ 1241 handleFileList(fileList: Array<string>): void; 1242} 1243 1244/** 1245 * Defines the http auth request result, related to {@link onHttpAuthRequest} method. 1246 * 1247 * @syscap SystemCapability.Web.Webview.Core 1248 * @since 9 1249 */ 1250/** 1251 * Defines the http auth request result, related to {@link onHttpAuthRequest} method. 1252 * 1253 * @syscap SystemCapability.Web.Webview.Core 1254 * @crossplatform 1255 * @atomicservice 1256 * @since 11 1257 */ 1258declare class HttpAuthHandler { 1259 /** 1260 * Constructor. 1261 * 1262 * @syscap SystemCapability.Web.Webview.Core 1263 * @since 9 1264 */ 1265 /** 1266 * Constructor. 1267 * 1268 * @syscap SystemCapability.Web.Webview.Core 1269 * @crossplatform 1270 * @atomicservice 1271 * @since 11 1272 */ 1273 constructor(); 1274 1275 /** 1276 * confirm. 1277 * 1278 * @param { string } userName 1279 * @param { string } password 1280 * @returns { boolean } 1281 * @syscap SystemCapability.Web.Webview.Core 1282 * @since 9 1283 */ 1284 /** 1285 * confirm. 1286 * 1287 * @param { string } userName 1288 * @param { string } password 1289 * @returns { boolean } 1290 * @syscap SystemCapability.Web.Webview.Core 1291 * @crossplatform 1292 * @atomicservice 1293 * @since 11 1294 */ 1295 confirm(userName: string, password: string): boolean; 1296 1297 /** 1298 * cancel. 1299 * 1300 * @syscap SystemCapability.Web.Webview.Core 1301 * @since 9 1302 */ 1303 /** 1304 * cancel. 1305 * 1306 * @syscap SystemCapability.Web.Webview.Core 1307 * @crossplatform 1308 * @atomicservice 1309 * @since 11 1310 */ 1311 cancel(): void; 1312 1313 /** 1314 * isHttpAuthInfoSaved. 1315 * 1316 * @returns { boolean } 1317 * @syscap SystemCapability.Web.Webview.Core 1318 * @since 9 1319 */ 1320 /** 1321 * isHttpAuthInfoSaved. 1322 * 1323 * @returns { boolean } 1324 * @syscap SystemCapability.Web.Webview.Core 1325 * @crossplatform 1326 * @atomicservice 1327 * @since 11 1328 */ 1329 isHttpAuthInfoSaved(): boolean; 1330} 1331 1332/** 1333 * Defines the ssl error request result, related to {@link onSslErrorEventReceive} method. 1334 * 1335 * @syscap SystemCapability.Web.Webview.Core 1336 * @since 9 1337 */ 1338/** 1339 * Defines the ssl error request result, related to {@link onSslErrorEventReceive} method. 1340 * 1341 * @syscap SystemCapability.Web.Webview.Core 1342 * @atomicservice 1343 * @since 11 1344 */ 1345declare class SslErrorHandler { 1346 /** 1347 * Constructor. 1348 * 1349 * @syscap SystemCapability.Web.Webview.Core 1350 * @since 9 1351 */ 1352 /** 1353 * Constructor. 1354 * 1355 * @syscap SystemCapability.Web.Webview.Core 1356 * @atomicservice 1357 * @since 11 1358 */ 1359 constructor(); 1360 1361 /** 1362 * Confirm to use the SSL certificate. 1363 * 1364 * @syscap SystemCapability.Web.Webview.Core 1365 * @since 9 1366 */ 1367 /** 1368 * Confirm to use the SSL certificate. 1369 * 1370 * @syscap SystemCapability.Web.Webview.Core 1371 * @atomicservice 1372 * @since 11 1373 */ 1374 handleConfirm(): void; 1375 1376 /** 1377 * Cancel this request. 1378 * 1379 * @syscap SystemCapability.Web.Webview.Core 1380 * @since 9 1381 */ 1382 /** 1383 * Cancel this request. 1384 * 1385 * @syscap SystemCapability.Web.Webview.Core 1386 * @atomicservice 1387 * @since 11 1388 */ 1389 handleCancel(): void; 1390} 1391 1392/** 1393 * Defines the client certificate request result, related to {@link onClientAuthenticationRequest} method. 1394 * 1395 * @syscap SystemCapability.Web.Webview.Core 1396 * @since 9 1397 */ 1398/** 1399 * Defines the client certificate request result, related to {@link onClientAuthenticationRequest} method. 1400 * 1401 * @syscap SystemCapability.Web.Webview.Core 1402 * @atomicservice 1403 * @since 11 1404 */ 1405declare class ClientAuthenticationHandler { 1406 /** 1407 * Constructor. 1408 * 1409 * @syscap SystemCapability.Web.Webview.Core 1410 * @since 9 1411 */ 1412 /** 1413 * Constructor. 1414 * 1415 * @syscap SystemCapability.Web.Webview.Core 1416 * @atomicservice 1417 * @since 11 1418 */ 1419 constructor(); 1420 1421 /** 1422 * Confirm to use the specified private key and client certificate chain. 1423 * 1424 * @param { string } priKeyFile - The file that store private key. 1425 * @param { string } certChainFile - The file that store client certificate chain. 1426 * @syscap SystemCapability.Web.Webview.Core 1427 * @since 9 1428 */ 1429 /** 1430 * Confirm to use the specified private key and client certificate chain. 1431 * 1432 * @param { string } priKeyFile - The file that store private key. 1433 * @param { string } certChainFile - The file that store client certificate chain. 1434 * @syscap SystemCapability.Web.Webview.Core 1435 * @atomicservice 1436 * @since 11 1437 */ 1438 confirm(priKeyFile: string, certChainFile: string): void; 1439 1440 /** 1441 * Confirm to use the authUri.The authUri can be obtained from certificate management. 1442 * 1443 * @param { string } authUri is the key of credentials.The credentials contain sign info and client certificates info. 1444 * @syscap SystemCapability.Web.Webview.Core 1445 * @since 10 1446 */ 1447 /** 1448 * Confirm to use the authUri.The authUri can be obtained from certificate management. 1449 * 1450 * @param { string } authUri is the key of credentials.The credentials contain sign info and client certificates info. 1451 * @syscap SystemCapability.Web.Webview.Core 1452 * @atomicservice 1453 * @since 11 1454 */ 1455 confirm(authUri: string): void; 1456 1457 /** 1458 * Cancel this certificate request. 1459 * 1460 * @syscap SystemCapability.Web.Webview.Core 1461 * @since 9 1462 */ 1463 /** 1464 * Cancel this certificate request. 1465 * 1466 * @syscap SystemCapability.Web.Webview.Core 1467 * @atomicservice 1468 * @since 11 1469 */ 1470 cancel(): void; 1471 1472 /** 1473 * Ignore this certificate request temporarily. 1474 * 1475 * @syscap SystemCapability.Web.Webview.Core 1476 * @since 9 1477 */ 1478 /** 1479 * Ignore this certificate request temporarily. 1480 * 1481 * @syscap SystemCapability.Web.Webview.Core 1482 * @atomicservice 1483 * @since 11 1484 */ 1485 ignore(): void; 1486} 1487 1488/** 1489 * Defines the accessible resource type, related to {@link onPermissionRequest} method. 1490 * 1491 * @enum { string } 1492 * @syscap SystemCapability.Web.Webview.Core 1493 * @since 9 1494 */ 1495/** 1496 * Defines the accessible resource type, related to {@link onPermissionRequest} method. 1497 * 1498 * @enum { string } 1499 * @syscap SystemCapability.Web.Webview.Core 1500 * @crossplatform 1501 * @atomicservice 1502 * @since 11 1503 */ 1504declare enum ProtectedResourceType { 1505 /** 1506 * The MidiSysex resource. 1507 * 1508 * @syscap SystemCapability.Web.Webview.Core 1509 * @since 9 1510 */ 1511 /** 1512 * The MidiSysex resource. 1513 * 1514 * @syscap SystemCapability.Web.Webview.Core 1515 * @atomicservice 1516 * @since 11 1517 */ 1518 MidiSysex = 'TYPE_MIDI_SYSEX', 1519 1520 /** 1521 * The video capture resource, such as camera. 1522 * 1523 * @syscap SystemCapability.Web.Webview.Core 1524 * @since 10 1525 */ 1526 /** 1527 * The video capture resource, such as camera. 1528 * 1529 * @syscap SystemCapability.Web.Webview.Core 1530 * @crossplatform 1531 * @atomicservice 1532 * @since 11 1533 */ 1534 VIDEO_CAPTURE = 'TYPE_VIDEO_CAPTURE', 1535 1536 /** 1537 * The audio capture resource, such as microphone. 1538 * 1539 * @syscap SystemCapability.Web.Webview.Core 1540 * @since 10 1541 */ 1542 /** 1543 * The audio capture resource, such as microphone. 1544 * 1545 * @syscap SystemCapability.Web.Webview.Core 1546 * @crossplatform 1547 * @atomicservice 1548 * @since 11 1549 */ 1550 AUDIO_CAPTURE = 'TYPE_AUDIO_CAPTURE' 1551} 1552 1553/** 1554 * Defines the onPermissionRequest callback, related to {@link onPermissionRequest} method. 1555 * 1556 * @syscap SystemCapability.Web.Webview.Core 1557 * @since 9 1558 */ 1559/** 1560 * Defines the onPermissionRequest callback, related to {@link onPermissionRequest} method. 1561 * 1562 * @syscap SystemCapability.Web.Webview.Core 1563 * @crossplatform 1564 * @atomicservice 1565 * @since 11 1566 */ 1567declare class PermissionRequest { 1568 /** 1569 * Constructor. 1570 * 1571 * @syscap SystemCapability.Web.Webview.Core 1572 * @since 9 1573 */ 1574 /** 1575 * Constructor. 1576 * 1577 * @syscap SystemCapability.Web.Webview.Core 1578 * @crossplatform 1579 * @atomicservice 1580 * @since 11 1581 */ 1582 constructor(); 1583 1584 /** 1585 * Reject the request. 1586 * 1587 * @syscap SystemCapability.Web.Webview.Core 1588 * @since 9 1589 */ 1590 /** 1591 * Reject the request. 1592 * 1593 * @syscap SystemCapability.Web.Webview.Core 1594 * @crossplatform 1595 * @atomicservice 1596 * @since 11 1597 */ 1598 deny(): void; 1599 1600 /** 1601 * Gets the source if the webpage that attempted to access the restricted resource. 1602 * 1603 * @returns { string } 1604 * @syscap SystemCapability.Web.Webview.Core 1605 * @since 9 1606 */ 1607 /** 1608 * Gets the source if the webpage that attempted to access the restricted resource. 1609 * 1610 * @returns { string } 1611 * @syscap SystemCapability.Web.Webview.Core 1612 * @crossplatform 1613 * @atomicservice 1614 * @since 11 1615 */ 1616 getOrigin(): string; 1617 1618 /** 1619 * Gets the resource that the webpage is trying to access. 1620 * 1621 * @returns { Array<string> } 1622 * @syscap SystemCapability.Web.Webview.Core 1623 * @since 9 1624 */ 1625 /** 1626 * Gets the resource that the webpage is trying to access. 1627 * 1628 * @returns { Array<string> } 1629 * @syscap SystemCapability.Web.Webview.Core 1630 * @crossplatform 1631 * @atomicservice 1632 * @since 11 1633 */ 1634 getAccessibleResource(): Array<string>; 1635 1636 /** 1637 * Grant origin access to a given resource. 1638 * 1639 * @param { Array<string> } resources 1640 * @syscap SystemCapability.Web.Webview.Core 1641 * @since 9 1642 */ 1643 /** 1644 * Grant origin access to a given resource. 1645 * 1646 * @param { Array<string> } resources 1647 * @syscap SystemCapability.Web.Webview.Core 1648 * @crossplatform 1649 * @atomicservice 1650 * @since 11 1651 */ 1652 grant(resources: Array<string>): void; 1653} 1654 1655/** 1656 * Defines the onScreenCapture callback, related to {@link onScreenCapture} method. 1657 * @syscap SystemCapability.Web.Webview.Core 1658 * @since 10 1659 */ 1660/** 1661 * Defines the onScreenCapture callback, related to {@link onScreenCapture} method. 1662 * @syscap SystemCapability.Web.Webview.Core 1663 * @atomicservice 1664 * @since 11 1665 */ 1666declare class ScreenCaptureHandler { 1667 /** 1668 * Constructor. 1669 * @syscap SystemCapability.Web.Webview.Core 1670 * @since 10 1671 */ 1672 /** 1673 * Constructor. 1674 * @syscap SystemCapability.Web.Webview.Core 1675 * @atomicservice 1676 * @since 11 1677 */ 1678 constructor(); 1679 1680 /** 1681 * Gets the source of the webpage that attempted to access the restricted resource. 1682 * 1683 * @returns { string } 1684 * @syscap SystemCapability.Web.Webview.Core 1685 * @since 10 1686 */ 1687 /** 1688 * Gets the source of the webpage that attempted to access the restricted resource. 1689 * 1690 * @returns { string } 1691 * @syscap SystemCapability.Web.Webview.Core 1692 * @atomicservice 1693 * @since 11 1694 */ 1695 getOrigin(): string; 1696 1697 /** 1698 * Grant origin access to a given resource. 1699 * @param { ScreenCaptureConfig } config The screen capture configuration. 1700 * @syscap SystemCapability.Web.Webview.Core 1701 * @since 10 1702 */ 1703 /** 1704 * Grant origin access to a given resource. 1705 * @param { ScreenCaptureConfig } config The screen capture configuration. 1706 * @syscap SystemCapability.Web.Webview.Core 1707 * @atomicservice 1708 * @since 11 1709 */ 1710 grant(config: ScreenCaptureConfig): void; 1711 1712 /** 1713 * Reject the request. 1714 * @syscap SystemCapability.Web.Webview.Core 1715 * @since 10 1716 */ 1717 /** 1718 * Reject the request. 1719 * @syscap SystemCapability.Web.Webview.Core 1720 * @atomicservice 1721 * @since 11 1722 */ 1723 deny(): void; 1724} 1725 1726/** 1727 * Defines the onDataResubmission callback, related to {@link onDataResubmission} method. 1728 * 1729 * @syscap SystemCapability.Web.Webview.Core 1730 * @since 9 1731 */ 1732/** 1733 * Defines the onDataResubmission callback, related to {@link onDataResubmission} method. 1734 * 1735 * @syscap SystemCapability.Web.Webview.Core 1736 * @atomicservice 1737 * @since 11 1738 */ 1739declare class DataResubmissionHandler { 1740 /** 1741 * Constructor. 1742 * 1743 * @syscap SystemCapability.Web.Webview.Core 1744 * @since 9 1745 */ 1746 /** 1747 * Constructor. 1748 * 1749 * @syscap SystemCapability.Web.Webview.Core 1750 * @atomicservice 1751 * @since 11 1752 */ 1753 constructor(); 1754 1755 /** 1756 * Resend related form data. 1757 * 1758 * @syscap SystemCapability.Web.Webview.Core 1759 * @since 9 1760 */ 1761 /** 1762 * Resend related form data. 1763 * 1764 * @syscap SystemCapability.Web.Webview.Core 1765 * @atomicservice 1766 * @since 11 1767 */ 1768 resend(): void; 1769 1770 /** 1771 * Do not resend related form data. 1772 * 1773 * @syscap SystemCapability.Web.Webview.Core 1774 * @since 9 1775 */ 1776 /** 1777 * Do not resend related form data. 1778 * 1779 * @syscap SystemCapability.Web.Webview.Core 1780 * @atomicservice 1781 * @since 11 1782 */ 1783 cancel(): void; 1784} 1785 1786/** 1787 * Defines the onWindowNew callback, related to {@link onWindowNew} method. 1788 * 1789 * @syscap SystemCapability.Web.Webview.Core 1790 * @since 9 1791 */ 1792/** 1793 * Defines the onWindowNew callback, related to {@link onWindowNew} method. 1794 * 1795 * @syscap SystemCapability.Web.Webview.Core 1796 * @atomicservice 1797 * @since 11 1798 */ 1799declare class ControllerHandler { 1800 /** 1801 * Constructor. 1802 * 1803 * @syscap SystemCapability.Web.Webview.Core 1804 * @since 9 1805 */ 1806 /** 1807 * Constructor. 1808 * 1809 * @syscap SystemCapability.Web.Webview.Core 1810 * @atomicservice 1811 * @since 11 1812 */ 1813 constructor(); 1814 1815 /** 1816 * Set WebController object. 1817 * 1818 * @param { WebviewController } controller 1819 * @syscap SystemCapability.Web.Webview.Core 1820 * @since 9 1821 */ 1822 /** 1823 * Set WebController object. 1824 * 1825 * @param { WebviewController } controller 1826 * @syscap SystemCapability.Web.Webview.Core 1827 * @atomicservice 1828 * @since 11 1829 */ 1830 setWebController(controller: WebviewController): void; 1831} 1832 1833/** 1834 * Defines the context menu source type, related to {@link onContextMenuShow} method. 1835 * 1836 * @enum { number } 1837 * @syscap SystemCapability.Web.Webview.Core 1838 * @since 9 1839 */ 1840/** 1841 * Defines the context menu source type, related to {@link onContextMenuShow} method. 1842 * 1843 * @enum { number } 1844 * @syscap SystemCapability.Web.Webview.Core 1845 * @atomicservice 1846 * @since 11 1847 */ 1848declare enum ContextMenuSourceType { 1849 /** 1850 * Other source types. 1851 * 1852 * @syscap SystemCapability.Web.Webview.Core 1853 * @since 9 1854 */ 1855 /** 1856 * Other source types. 1857 * 1858 * @syscap SystemCapability.Web.Webview.Core 1859 * @atomicservice 1860 * @since 11 1861 */ 1862 None, 1863 1864 /** 1865 * Mouse. 1866 * 1867 * @syscap SystemCapability.Web.Webview.Core 1868 * @since 9 1869 */ 1870 /** 1871 * Mouse. 1872 * 1873 * @syscap SystemCapability.Web.Webview.Core 1874 * @atomicservice 1875 * @since 11 1876 */ 1877 Mouse, 1878 1879 /** 1880 * Long press. 1881 * 1882 * @syscap SystemCapability.Web.Webview.Core 1883 * @since 9 1884 */ 1885 /** 1886 * Long press. 1887 * 1888 * @syscap SystemCapability.Web.Webview.Core 1889 * @atomicservice 1890 * @since 11 1891 */ 1892 LongPress, 1893} 1894 1895/** 1896 * Defines the context menu media type, related to {@link onContextMenuShow} method. 1897 * 1898 * @enum { number } 1899 * @syscap SystemCapability.Web.Webview.Core 1900 * @since 9 1901 */ 1902/** 1903 * Defines the context menu media type, related to {@link onContextMenuShow} method. 1904 * 1905 * @enum { number } 1906 * @syscap SystemCapability.Web.Webview.Core 1907 * @atomicservice 1908 * @since 11 1909 */ 1910declare enum ContextMenuMediaType { 1911 /** 1912 * Not a special node or other media types. 1913 * 1914 * @syscap SystemCapability.Web.Webview.Core 1915 * @since 9 1916 */ 1917 /** 1918 * Not a special node or other media types. 1919 * 1920 * @syscap SystemCapability.Web.Webview.Core 1921 * @atomicservice 1922 * @since 11 1923 */ 1924 None, 1925 1926 /** 1927 * Image. 1928 * 1929 * @syscap SystemCapability.Web.Webview.Core 1930 * @since 9 1931 */ 1932 /** 1933 * Image. 1934 * 1935 * @syscap SystemCapability.Web.Webview.Core 1936 * @atomicservice 1937 * @since 11 1938 */ 1939 Image, 1940} 1941 1942/** 1943 * Defines the context menu input field type, related to {@link onContextMenuShow} method. 1944 * 1945 * @enum { number } 1946 * @syscap SystemCapability.Web.Webview.Core 1947 * @since 9 1948 */ 1949/** 1950 * Defines the context menu input field type, related to {@link onContextMenuShow} method. 1951 * 1952 * @enum { number } 1953 * @syscap SystemCapability.Web.Webview.Core 1954 * @atomicservice 1955 * @since 11 1956 */ 1957declare enum ContextMenuInputFieldType { 1958 /** 1959 * Not an input field. 1960 * 1961 * @syscap SystemCapability.Web.Webview.Core 1962 * @since 9 1963 */ 1964 /** 1965 * Not an input field. 1966 * 1967 * @syscap SystemCapability.Web.Webview.Core 1968 * @atomicservice 1969 * @since 11 1970 */ 1971 None, 1972 1973 /** 1974 * The plain text type. 1975 * 1976 * @syscap SystemCapability.Web.Webview.Core 1977 * @since 9 1978 */ 1979 /** 1980 * The plain text type. 1981 * 1982 * @syscap SystemCapability.Web.Webview.Core 1983 * @atomicservice 1984 * @since 11 1985 */ 1986 PlainText, 1987 1988 /** 1989 * The password type. 1990 * 1991 * @syscap SystemCapability.Web.Webview.Core 1992 * @since 9 1993 */ 1994 /** 1995 * The password type. 1996 * 1997 * @syscap SystemCapability.Web.Webview.Core 1998 * @atomicservice 1999 * @since 11 2000 */ 2001 Password, 2002 2003 /** 2004 * The number type. 2005 * 2006 * @syscap SystemCapability.Web.Webview.Core 2007 * @since 9 2008 */ 2009 /** 2010 * The number type. 2011 * 2012 * @syscap SystemCapability.Web.Webview.Core 2013 * @atomicservice 2014 * @since 11 2015 */ 2016 Number, 2017 2018 /** 2019 * The telephone type. 2020 * 2021 * @syscap SystemCapability.Web.Webview.Core 2022 * @since 9 2023 */ 2024 /** 2025 * The telephone type. 2026 * 2027 * @syscap SystemCapability.Web.Webview.Core 2028 * @atomicservice 2029 * @since 11 2030 */ 2031 Telephone, 2032 2033 /** 2034 * Other types. 2035 * 2036 * @syscap SystemCapability.Web.Webview.Core 2037 * @since 9 2038 */ 2039 /** 2040 * Other types. 2041 * 2042 * @syscap SystemCapability.Web.Webview.Core 2043 * @atomicservice 2044 * @since 11 2045 */ 2046 Other, 2047} 2048 2049/** 2050 * Defines the embed status, related to {@link NativeEmbedDataInfo}. 2051 * 2052 * @enum { number } 2053 * @syscap SystemCapability.Web.Webview.Core 2054 * @atomicservice 2055 * @since 11 2056 */ 2057declare enum NativeEmbedStatus { 2058 2059 /** 2060 * The embed tag create. 2061 * 2062 * @syscap SystemCapability.Web.Webview.Core 2063 * @atomicservice 2064 * @since 11 2065 */ 2066 CREATE = 0, 2067 2068 /** 2069 * The embed tag update. 2070 * 2071 * @syscap SystemCapability.Web.Webview.Core 2072 * @atomicservice 2073 * @since 11 2074 */ 2075 UPDATE = 1, 2076 2077 /** 2078 * The embed tag destroy. 2079 * 2080 * @syscap SystemCapability.Web.Webview.Core 2081 * @atomicservice 2082 * @since 11 2083 */ 2084 DESTROY = 2, 2085} 2086 2087/** 2088 * Defines the context menu supported event bit flags, related to {@link onContextMenuShow} method. 2089 * 2090 * @enum { number } 2091 * @syscap SystemCapability.Web.Webview.Core 2092 * @since 9 2093 */ 2094/** 2095 * Defines the context menu supported event bit flags, related to {@link onContextMenuShow} method. 2096 * 2097 * @enum { number } 2098 * @syscap SystemCapability.Web.Webview.Core 2099 * @atomicservice 2100 * @since 11 2101 */ 2102declare enum ContextMenuEditStateFlags { 2103 /** 2104 * Not editable. 2105 * 2106 * @syscap SystemCapability.Web.Webview.Core 2107 * @since 9 2108 */ 2109 /** 2110 * Not editable. 2111 * 2112 * @syscap SystemCapability.Web.Webview.Core 2113 * @atomicservice 2114 * @since 11 2115 */ 2116 NONE = 0, 2117 /** 2118 * Clipping is supported. 2119 * 2120 * @syscap SystemCapability.Web.Webview.Core 2121 * @since 9 2122 */ 2123 /** 2124 * Clipping is supported. 2125 * 2126 * @syscap SystemCapability.Web.Webview.Core 2127 * @atomicservice 2128 * @since 11 2129 */ 2130 CAN_CUT = 1 << 0, 2131 /** 2132 * Copies are supported. 2133 * 2134 * @syscap SystemCapability.Web.Webview.Core 2135 * @since 9 2136 */ 2137 /** 2138 * Copies are supported. 2139 * 2140 * @syscap SystemCapability.Web.Webview.Core 2141 * @atomicservice 2142 * @since 11 2143 */ 2144 CAN_COPY = 1 << 1, 2145 /** 2146 * Support for pasting. 2147 * 2148 * @syscap SystemCapability.Web.Webview.Core 2149 * @since 9 2150 */ 2151 /** 2152 * Support for pasting. 2153 * 2154 * @syscap SystemCapability.Web.Webview.Core 2155 * @atomicservice 2156 * @since 11 2157 */ 2158 CAN_PASTE = 1 << 2, 2159 /** 2160 * Select all is supported. 2161 * 2162 * @syscap SystemCapability.Web.Webview.Core 2163 * @since 9 2164 */ 2165 /** 2166 * Select all is supported. 2167 * 2168 * @syscap SystemCapability.Web.Webview.Core 2169 * @atomicservice 2170 * @since 11 2171 */ 2172 CAN_SELECT_ALL = 1 << 3, 2173} 2174 2175/** 2176 * Enum type supplied to {@link navigationType} for the navigation's type. 2177 * 2178 * @enum { number } 2179 * @syscap SystemCapability.Web.Webview.Core 2180 * @atomicservice 2181 * @since 11 2182 */ 2183declare enum WebNavigationType { 2184 /** 2185 * Unknown type. 2186 * 2187 * @syscap SystemCapability.Web.Webview.Core 2188 * @atomicservice 2189 * @since 11 2190 */ 2191 UNKNOWN = 0, 2192 2193 /** 2194 * A new entry was created due to a navigation happened on the main frame. 2195 * Contains all situations that will generate a mainframe navigation entry, 2196 * which means that navigations to a hash on the same document or history.pushState 2197 * also belong to this type. 2198 * 2199 * @syscap SystemCapability.Web.Webview.Core 2200 * @atomicservice 2201 * @since 11 2202 */ 2203 MAIN_FRAME_NEW_ENTRY = 1, 2204 2205 /** 2206 * Navigate to an existing entry due to a navigation on the main frame. 2207 * e.g. 2208 * 1. History navigations. 2209 * 2. Reloads (contains loading the same url). 2210 * 3. Same-document navigations(history.replaceState(), location.replace()). 2211 * 2212 * @syscap SystemCapability.Web.Webview.Core 2213 * @atomicservice 2214 * @since 11 2215 */ 2216 MAIN_FRAME_EXISTING_ENTRY = 2, 2217 2218 /** 2219 * A navigation happened on subframe which was triggered by user. 2220 * 2221 * @syscap SystemCapability.Web.Webview.Core 2222 * @atomicservice 2223 * @since 11 2224 */ 2225 NAVIGATION_TYPE_NEW_SUBFRAME = 4, 2226 2227 /** 2228 * A navigation happened on the subframe automatically. 2229 * 2230 * @syscap SystemCapability.Web.Webview.Core 2231 * @atomicservice 2232 * @since 11 2233 */ 2234 NAVIGATION_TYPE_AUTO_SUBFRAME = 5, 2235} 2236 2237/** 2238 * Defines the context menu param, related to {@link WebContextMenuParam} method. 2239 * 2240 * @syscap SystemCapability.Web.Webview.Core 2241 * @since 9 2242 */ 2243/** 2244 * Defines the context menu param, related to {@link WebContextMenuParam} method. 2245 * 2246 * @syscap SystemCapability.Web.Webview.Core 2247 * @atomicservice 2248 * @since 11 2249 */ 2250declare class WebContextMenuParam { 2251 /** 2252 * Constructor. 2253 * 2254 * @syscap SystemCapability.Web.Webview.Core 2255 * @since 9 2256 */ 2257 /** 2258 * Constructor. 2259 * 2260 * @syscap SystemCapability.Web.Webview.Core 2261 * @atomicservice 2262 * @since 11 2263 */ 2264 constructor(); 2265 2266 /** 2267 * Horizontal offset coordinates of the menu within the Web component. 2268 * 2269 * @returns { number } The context menu x coordinate. 2270 * @syscap SystemCapability.Web.Webview.Core 2271 * @since 9 2272 */ 2273 /** 2274 * Horizontal offset coordinates of the menu within the Web component. 2275 * 2276 * @returns { number } The context menu x coordinate. 2277 * @syscap SystemCapability.Web.Webview.Core 2278 * @atomicservice 2279 * @since 11 2280 */ 2281 x(): number; 2282 2283 /** 2284 * Vertical offset coordinates for the menu within the Web component. 2285 * 2286 * @returns { number } The context menu y coordinate. 2287 * @syscap SystemCapability.Web.Webview.Core 2288 * @since 9 2289 */ 2290 /** 2291 * Vertical offset coordinates for the menu within the Web component. 2292 * 2293 * @returns { number } The context menu y coordinate. 2294 * @syscap SystemCapability.Web.Webview.Core 2295 * @atomicservice 2296 * @since 11 2297 */ 2298 y(): number; 2299 2300 /** 2301 * If the long-press location is the link returns the link's security-checked URL. 2302 * 2303 * @returns { string } If relate to a link return link url, else return null. 2304 * @syscap SystemCapability.Web.Webview.Core 2305 * @since 9 2306 */ 2307 /** 2308 * If the long-press location is the link returns the link's security-checked URL. 2309 * 2310 * @returns { string } If relate to a link return link url, else return null. 2311 * @syscap SystemCapability.Web.Webview.Core 2312 * @atomicservice 2313 * @since 11 2314 */ 2315 getLinkUrl(): string; 2316 2317 /** 2318 * If the long-press location is the link returns the link's original URL. 2319 * 2320 * @returns { string } If relate to a link return unfiltered link url, else return null. 2321 * @syscap SystemCapability.Web.Webview.Core 2322 * @since 9 2323 */ 2324 /** 2325 * If the long-press location is the link returns the link's original URL. 2326 * 2327 * @returns { string } If relate to a link return unfiltered link url, else return null. 2328 * @syscap SystemCapability.Web.Webview.Core 2329 * @atomicservice 2330 * @since 11 2331 */ 2332 getUnfilteredLinkUrl(): string; 2333 2334 /** 2335 * Returns the SRC URL if the selected element has a SRC attribute. 2336 * 2337 * @returns { string } If this context menu is "src" attribute, return link url, else return null. 2338 * @syscap SystemCapability.Web.Webview.Core 2339 * @since 9 2340 */ 2341 /** 2342 * Returns the SRC URL if the selected element has a SRC attribute. 2343 * 2344 * @returns { string } If this context menu is "src" attribute, return link url, else return null. 2345 * @syscap SystemCapability.Web.Webview.Core 2346 * @atomicservice 2347 * @since 11 2348 */ 2349 getSourceUrl(): string; 2350 2351 /** 2352 * Long press menu location has image content. 2353 * 2354 * @returns { boolean } Return whether this context menu has image content. 2355 * @syscap SystemCapability.Web.Webview.Core 2356 * @since 9 2357 */ 2358 /** 2359 * Long press menu location has image content. 2360 * 2361 * @returns { boolean } Return whether this context menu has image content. 2362 * @syscap SystemCapability.Web.Webview.Core 2363 * @atomicservice 2364 * @since 11 2365 */ 2366 existsImageContents(): boolean; 2367 2368 /** 2369 * Returns the type of context node. 2370 * 2371 * @returns { ContextMenuMediaType } Returns the type of context node. 2372 * @syscap SystemCapability.Web.Webview.Core 2373 * @since 9 2374 */ 2375 /** 2376 * Returns the type of context node. 2377 * 2378 * @returns { ContextMenuMediaType } Returns the type of context node. 2379 * @syscap SystemCapability.Web.Webview.Core 2380 * @atomicservice 2381 * @since 11 2382 */ 2383 getMediaType(): ContextMenuMediaType; 2384 2385 /** 2386 * Returns the text of the selection. 2387 * 2388 * @returns { string } Returns the text of the selection. 2389 * @syscap SystemCapability.Web.Webview.Core 2390 * @since 9 2391 */ 2392 /** 2393 * Returns the text of the selection. 2394 * 2395 * @returns { string } Returns the text of the selection. 2396 * @syscap SystemCapability.Web.Webview.Core 2397 * @atomicservice 2398 * @since 11 2399 */ 2400 getSelectionText(): string; 2401 2402 /** 2403 * Returns the context menu source type. 2404 * 2405 * @returns { ContextMenuSourceType } 2406 * @syscap SystemCapability.Web.Webview.Core 2407 * @since 9 2408 */ 2409 /** 2410 * Returns the context menu source type. 2411 * 2412 * @returns { ContextMenuSourceType } 2413 * @syscap SystemCapability.Web.Webview.Core 2414 * @atomicservice 2415 * @since 11 2416 */ 2417 getSourceType(): ContextMenuSourceType; 2418 2419 /** 2420 * Returns input field type if the context menu was invoked on an input field. 2421 * 2422 * @returns { ContextMenuInputFieldType } Input field type if the context menu was invoked on an input field. 2423 * @syscap SystemCapability.Web.Webview.Core 2424 * @since 9 2425 */ 2426 /** 2427 * Returns input field type if the context menu was invoked on an input field. 2428 * 2429 * @returns { ContextMenuInputFieldType } Input field type if the context menu was invoked on an input field. 2430 * @syscap SystemCapability.Web.Webview.Core 2431 * @atomicservice 2432 * @since 11 2433 */ 2434 getInputFieldType(): ContextMenuInputFieldType; 2435 2436 /** 2437 * Returns whether the context is editable. 2438 * 2439 * @returns { boolean } 2440 * @syscap SystemCapability.Web.Webview.Core 2441 * @since 9 2442 */ 2443 /** 2444 * Returns whether the context is editable. 2445 * 2446 * @returns { boolean } 2447 * @syscap SystemCapability.Web.Webview.Core 2448 * @atomicservice 2449 * @since 11 2450 */ 2451 isEditable(): boolean; 2452 2453 /** 2454 * Returns the context editable flags {@link ContextMenuEditStateFlags}. 2455 * 2456 * @returns { number } 2457 * @syscap SystemCapability.Web.Webview.Core 2458 * @since 9 2459 */ 2460 /** 2461 * Returns the context editable flags {@link ContextMenuEditStateFlags}. 2462 * 2463 * @returns { number } 2464 * @syscap SystemCapability.Web.Webview.Core 2465 * @atomicservice 2466 * @since 11 2467 */ 2468 getEditStateFlags(): number; 2469} 2470 2471/** 2472 * Defines the context menu result, related to {@link WebContextMenuResult} method. 2473 * 2474 * @syscap SystemCapability.Web.Webview.Core 2475 * @since 9 2476 */ 2477/** 2478 * Defines the context menu result, related to {@link WebContextMenuResult} method. 2479 * 2480 * @syscap SystemCapability.Web.Webview.Core 2481 * @atomicservice 2482 * @since 11 2483 */ 2484declare class WebContextMenuResult { 2485 /** 2486 * Constructor. 2487 * 2488 * @syscap SystemCapability.Web.Webview.Core 2489 * @since 9 2490 */ 2491 /** 2492 * Constructor. 2493 * 2494 * @syscap SystemCapability.Web.Webview.Core 2495 * @atomicservice 2496 * @since 11 2497 */ 2498 constructor(); 2499 2500 /** 2501 * When close context menu without other call in WebContextMenuResult, 2502 * User should call this function to close menu 2503 * 2504 * @syscap SystemCapability.Web.Webview.Core 2505 * @since 9 2506 */ 2507 /** 2508 * When close context menu without other call in WebContextMenuResult, 2509 * User should call this function to close menu 2510 * 2511 * @syscap SystemCapability.Web.Webview.Core 2512 * @atomicservice 2513 * @since 11 2514 */ 2515 closeContextMenu(): void; 2516 2517 /** 2518 * If WebContextMenuParam has image content, this function will copy image related to this context menu. 2519 * If WebContextMenuParam has no image content, this function will do nothing. 2520 * 2521 * @syscap SystemCapability.Web.Webview.Core 2522 * @since 9 2523 */ 2524 /** 2525 * If WebContextMenuParam has image content, this function will copy image related to this context menu. 2526 * If WebContextMenuParam has no image content, this function will do nothing. 2527 * 2528 * @syscap SystemCapability.Web.Webview.Core 2529 * @atomicservice 2530 * @since 11 2531 */ 2532 copyImage(): void; 2533 2534 /** 2535 * Executes the copy operation related to this context menu. 2536 * 2537 * @syscap SystemCapability.Web.Webview.Core 2538 * @since 9 2539 */ 2540 /** 2541 * Executes the copy operation related to this context menu. 2542 * 2543 * @syscap SystemCapability.Web.Webview.Core 2544 * @atomicservice 2545 * @since 11 2546 */ 2547 copy(): void; 2548 2549 /** 2550 * Executes the paste operation related to this context menu. 2551 * 2552 * @syscap SystemCapability.Web.Webview.Core 2553 * @since 9 2554 */ 2555 /** 2556 * Executes the paste operation related to this context menu. 2557 * 2558 * @syscap SystemCapability.Web.Webview.Core 2559 * @atomicservice 2560 * @since 11 2561 */ 2562 paste(): void; 2563 2564 /** 2565 * Executes the cut operation related to this context menu. 2566 * 2567 * @syscap SystemCapability.Web.Webview.Core 2568 * @since 9 2569 */ 2570 /** 2571 * Executes the cut operation related to this context menu. 2572 * 2573 * @syscap SystemCapability.Web.Webview.Core 2574 * @atomicservice 2575 * @since 11 2576 */ 2577 cut(): void; 2578 2579 /** 2580 * Executes the selectAll operation related to this context menu. 2581 * 2582 * @syscap SystemCapability.Web.Webview.Core 2583 * @since 9 2584 */ 2585 /** 2586 * Executes the selectAll operation related to this context menu. 2587 * 2588 * @syscap SystemCapability.Web.Webview.Core 2589 * @atomicservice 2590 * @since 11 2591 */ 2592 selectAll(): void; 2593} 2594 2595/** 2596 * Encompassed message information as parameters to {@link onConsole} method. 2597 * 2598 * @syscap SystemCapability.Web.Webview.Core 2599 * @since 8 2600 */ 2601/** 2602 * Encompassed message information as parameters to {@link onConsole} method. 2603 * 2604 * @syscap SystemCapability.Web.Webview.Core 2605 * @crossplatform 2606 * @atomicservice 2607 * @since 11 2608 */ 2609declare class ConsoleMessage { 2610 /** 2611 * Constructor. 2612 * 2613 * @param { string } message - The console message. 2614 * @param { string } sourceId - The Web source file's path and name. 2615 * @param { number } lineNumber - The line number of the console message. 2616 * @param { MessageLevel } messageLevel - The console log level. 2617 * @syscap SystemCapability.Web.Webview.Core 2618 * @since 8 2619 * @deprecated since 9 2620 * @useinstead ohos.web.ConsoleMessage#constructor 2621 */ 2622 constructor(message: string, sourceId: string, lineNumber: number, messageLevel: MessageLevel); 2623 2624 /** 2625 * Constructor. 2626 * 2627 * @syscap SystemCapability.Web.Webview.Core 2628 * @since 9 2629 */ 2630 /** 2631 * Constructor. 2632 * 2633 * @syscap SystemCapability.Web.Webview.Core 2634 * @crossplatform 2635 * @atomicservice 2636 * @since 11 2637 */ 2638 constructor(); 2639 2640 /** 2641 * Gets the message of a console message. 2642 * 2643 * @returns { string } Return the message of a console message. 2644 * @syscap SystemCapability.Web.Webview.Core 2645 * @since 8 2646 */ 2647 /** 2648 * Gets the message of a console message. 2649 * 2650 * @returns { string } Return the message of a console message. 2651 * @syscap SystemCapability.Web.Webview.Core 2652 * @crossplatform 2653 * @atomicservice 2654 * @since 11 2655 */ 2656 getMessage(): string; 2657 2658 /** 2659 * Gets the Web source file's path and name of a console message. 2660 * 2661 * @returns { string } Return the Web source file's path and name of a console message. 2662 * @syscap SystemCapability.Web.Webview.Core 2663 * @since 8 2664 */ 2665 /** 2666 * Gets the Web source file's path and name of a console message. 2667 * 2668 * @returns { string } Return the Web source file's path and name of a console message. 2669 * @syscap SystemCapability.Web.Webview.Core 2670 * @atomicservice 2671 * @since 11 2672 */ 2673 getSourceId(): string; 2674 2675 /** 2676 * Gets the line number of a console message. 2677 * 2678 * @returns { number } Return the line number of a console message. 2679 * @syscap SystemCapability.Web.Webview.Core 2680 * @since 8 2681 */ 2682 /** 2683 * Gets the line number of a console message. 2684 * 2685 * @returns { number } Return the line number of a console message. 2686 * @syscap SystemCapability.Web.Webview.Core 2687 * @atomicservice 2688 * @since 11 2689 */ 2690 getLineNumber(): number; 2691 2692 /** 2693 * Gets the message level of a console message. 2694 * 2695 * @returns { MessageLevel } Return the message level of a console message, which can be {@link MessageLevel}. 2696 * @syscap SystemCapability.Web.Webview.Core 2697 * @since 8 2698 */ 2699 /** 2700 * Gets the message level of a console message. 2701 * 2702 * @returns { MessageLevel } Return the message level of a console message, which can be {@link MessageLevel}. 2703 * @syscap SystemCapability.Web.Webview.Core 2704 * @crossplatform 2705 * @atomicservice 2706 * @since 11 2707 */ 2708 getMessageLevel(): MessageLevel; 2709} 2710 2711/** 2712 * Encompassed message information as parameters to {@link onConsole} method. 2713 * 2714 * @syscap SystemCapability.Web.Webview.Core 2715 * @since 8 2716 */ 2717/** 2718 * Defines the Web resource request. 2719 * 2720 * @syscap SystemCapability.Web.Webview.Core 2721 * @since 8 2722 */ 2723/** 2724 * Defines the Web resource request. 2725 * 2726 * @syscap SystemCapability.Web.Webview.Core 2727 * @crossplatform 2728 * @since 10 2729 */ 2730/** 2731 * Defines the Web resource request. 2732 * 2733 * @syscap SystemCapability.Web.Webview.Core 2734 * @crossplatform 2735 * @atomicservice 2736 * @since 11 2737 */ 2738declare class WebResourceRequest { 2739 /** 2740 * Constructor. 2741 * 2742 * @syscap SystemCapability.Web.Webview.Core 2743 * @since 8 2744 */ 2745 /** 2746 * Constructor. 2747 * 2748 * @syscap SystemCapability.Web.Webview.Core 2749 * @crossplatform 2750 * @since 10 2751 */ 2752 /** 2753 * Constructor. 2754 * 2755 * @syscap SystemCapability.Web.Webview.Core 2756 * @crossplatform 2757 * @atomicservice 2758 * @since 11 2759 */ 2760 constructor(); 2761 2762 /** 2763 * Gets request headers. 2764 * 2765 * @returns { Array<Header> } Return the request headers 2766 * @syscap SystemCapability.Web.Webview.Core 2767 * @since 8 2768 */ 2769 /** 2770 * Gets request headers. 2771 * 2772 * @returns { Array<Header> } Return the request headers 2773 * @syscap SystemCapability.Web.Webview.Core 2774 * @atomicservice 2775 * @since 11 2776 */ 2777 getRequestHeader(): Array<Header>; 2778 2779 /** 2780 * Gets the request URL. 2781 * 2782 * @returns { string } Return the request URL. 2783 * @syscap SystemCapability.Web.Webview.Core 2784 * @since 8 2785 */ 2786 /** 2787 * Gets the request URL. 2788 * 2789 * @returns { string } Return the request URL. 2790 * @syscap SystemCapability.Web.Webview.Core 2791 * @crossplatform 2792 * @since 10 2793 */ 2794 /** 2795 * Gets the request URL. 2796 * 2797 * @returns { string } Return the request URL. 2798 * @syscap SystemCapability.Web.Webview.Core 2799 * @crossplatform 2800 * @atomicservice 2801 * @since 11 2802 */ 2803 getRequestUrl(): string; 2804 2805 /** 2806 * Check whether the request is associated with gesture. 2807 * 2808 * @returns { boolean } Return {@code true} if the request is associated with gesture;return {@code false} otherwise. 2809 * @syscap SystemCapability.Web.Webview.Core 2810 * @since 8 2811 */ 2812 /** 2813 * Check whether the request is associated with gesture. 2814 * 2815 * @returns { boolean } Return {@code true} if the request is associated with gesture;return {@code false} otherwise. 2816 * @syscap SystemCapability.Web.Webview.Core 2817 * @atomicservice 2818 * @since 11 2819 */ 2820 isRequestGesture(): boolean; 2821 2822 /** 2823 * Check whether the request is for getting the main frame. 2824 * 2825 * @returns { boolean } Return {@code true} if the request is associated with gesture for getting the main frame; return {@code false} otherwise. 2826 * @syscap SystemCapability.Web.Webview.Core 2827 * @since 8 2828 */ 2829 /** 2830 * Check whether the request is for getting the main frame. 2831 * 2832 * @returns { boolean } Return {@code true} if the request is associated with gesture for getting the main frame; return {@code false} otherwise. 2833 * @syscap SystemCapability.Web.Webview.Core 2834 * @atomicservice 2835 * @since 11 2836 */ 2837 isMainFrame(): boolean; 2838 2839 /** 2840 * Check whether the request redirects. 2841 * 2842 * @returns { boolean } Return {@code true} if the request redirects; return {@code false} otherwise. 2843 * @syscap SystemCapability.Web.Webview.Core 2844 * @since 8 2845 */ 2846 /** 2847 * Check whether the request redirects. 2848 * 2849 * @returns { boolean } Return {@code true} if the request redirects; return {@code false} otherwise. 2850 * @syscap SystemCapability.Web.Webview.Core 2851 * @atomicservice 2852 * @since 11 2853 */ 2854 isRedirect(): boolean; 2855 2856 /** 2857 * Get request method. 2858 * 2859 * @returns { string } Return the request method. 2860 * @syscap SystemCapability.Web.Webview.Core 2861 * @since 9 2862 */ 2863 /** 2864 * Get request method. 2865 * 2866 * @returns { string } Return the request method. 2867 * @syscap SystemCapability.Web.Webview.Core 2868 * @atomicservice 2869 * @since 11 2870 */ 2871 getRequestMethod(): string; 2872} 2873 2874/** 2875 * Defines the Web resource response. 2876 * 2877 * @syscap SystemCapability.Web.Webview.Core 2878 * @since 8 2879 */ 2880/** 2881 * Defines the Web resource response. 2882 * 2883 * @syscap SystemCapability.Web.Webview.Core 2884 * @crossplatform 2885 * @atomicservice 2886 * @since 11 2887 */ 2888declare class WebResourceResponse { 2889 /** 2890 * Constructor. 2891 * 2892 * @syscap SystemCapability.Web.Webview.Core 2893 * @since 8 2894 */ 2895 /** 2896 * Constructor. 2897 * 2898 * @syscap SystemCapability.Web.Webview.Core 2899 * @crossplatform 2900 * @atomicservice 2901 * @since 11 2902 */ 2903 constructor(); 2904 2905 /** 2906 * Gets the response data. 2907 * 2908 * @returns { string } Return the response data. 2909 * @syscap SystemCapability.Web.Webview.Core 2910 * @since 8 2911 */ 2912 /** 2913 * Gets the response data. 2914 * 2915 * @returns { string } Return the response data. 2916 * @syscap SystemCapability.Web.Webview.Core 2917 * @atomicservice 2918 * @since 11 2919 */ 2920 getResponseData(): string; 2921 2922 /** 2923 * Gets the response encoding. 2924 * 2925 * @returns { string } Return the response encoding. 2926 * @syscap SystemCapability.Web.Webview.Core 2927 * @since 8 2928 */ 2929 /** 2930 * Gets the response encoding. 2931 * 2932 * @returns { string } Return the response encoding. 2933 * @syscap SystemCapability.Web.Webview.Core 2934 * @crossplatform 2935 * @atomicservice 2936 * @since 11 2937 */ 2938 getResponseEncoding(): string; 2939 2940 /** 2941 * Gets the response MIME type. 2942 * 2943 * @returns { string } Return the response MIME type. 2944 * @syscap SystemCapability.Web.Webview.Core 2945 * @since 8 2946 */ 2947 /** 2948 * Gets the response MIME type. 2949 * 2950 * @returns { string } Return the response MIME type. 2951 * @syscap SystemCapability.Web.Webview.Core 2952 * @crossplatform 2953 * @atomicservice 2954 * @since 11 2955 */ 2956 getResponseMimeType(): string; 2957 2958 /** 2959 * Gets the reason message. 2960 * 2961 * @returns { string } Return the reason message. 2962 * @syscap SystemCapability.Web.Webview.Core 2963 * @since 8 2964 */ 2965 /** 2966 * Gets the reason message. 2967 * 2968 * @returns { string } Return the reason message. 2969 * @syscap SystemCapability.Web.Webview.Core 2970 * @atomicservice 2971 * @since 11 2972 */ 2973 getReasonMessage(): string; 2974 2975 /** 2976 * Gets the response headers. 2977 * 2978 * @returns { Array<Header> } Return the response headers. 2979 * @syscap SystemCapability.Web.Webview.Core 2980 * @since 8 2981 */ 2982 /** 2983 * Gets the response headers. 2984 * 2985 * @returns { Array<Header> } Return the response headers. 2986 * @syscap SystemCapability.Web.Webview.Core 2987 * @atomicservice 2988 * @since 11 2989 */ 2990 getResponseHeader(): Array<Header>; 2991 2992 /** 2993 * Gets the response code. 2994 * 2995 * @returns { number } Return the response code. 2996 * @syscap SystemCapability.Web.Webview.Core 2997 * @since 8 2998 */ 2999 /** 3000 * Gets the response code. 3001 * 3002 * @returns { number } Return the response code. 3003 * @syscap SystemCapability.Web.Webview.Core 3004 * @crossplatform 3005 * @atomicservice 3006 * @since 11 3007 */ 3008 getResponseCode(): number; 3009 3010 /** 3011 * Sets the response data. 3012 * 3013 * @param { string | number | Resource } data - the response data. 3014 * @syscap SystemCapability.Web.Webview.Core 3015 * @since 9 3016 */ 3017 /** 3018 * Sets the response data. 3019 * Sets the response data. 3020 * Sets the response data. 3021 * Number represents file handle 3022 * 3023 * @param { string | number | Resource } data - the response data. 3024 * string type indicate strings in HTML format. 3025 * number type indicate file handle. 3026 * Resource type indicate $rawfile resource. 3027 * @syscap SystemCapability.Web.Webview.Core 3028 * @since 10 3029 */ 3030 /** 3031 * Sets the response data. 3032 * Sets the response data. 3033 * Sets the response data. 3034 * Number represents file handle 3035 * 3036 * @param { string | number | Resource | ArrayBuffer } data - the response data. 3037 * string type indicate strings in HTML format. 3038 * number type indicate file handle. 3039 * Resource type indicate $rawfile resource. 3040 * ArrayBuffer type indicate binary data. 3041 * @syscap SystemCapability.Web.Webview.Core 3042 * @atomicservice 3043 * @since 11 3044 */ 3045 setResponseData(data: string | number | Resource | ArrayBuffer); 3046 3047 /** 3048 * Sets the response encoding. 3049 * 3050 * @param { string } encoding the response encoding. 3051 * @syscap SystemCapability.Web.Webview.Core 3052 * @since 9 3053 */ 3054 /** 3055 * Sets the response encoding. 3056 * 3057 * @param { string } encoding the response encoding. 3058 * @syscap SystemCapability.Web.Webview.Core 3059 * @atomicservice 3060 * @since 11 3061 */ 3062 setResponseEncoding(encoding: string); 3063 3064 /** 3065 * Sets the response MIME type. 3066 * 3067 * @param { string } mimeType the response MIME type. 3068 * @syscap SystemCapability.Web.Webview.Core 3069 * @since 9 3070 */ 3071 /** 3072 * Sets the response MIME type. 3073 * 3074 * @param { string } mimeType the response MIME type. 3075 * @syscap SystemCapability.Web.Webview.Core 3076 * @atomicservice 3077 * @since 11 3078 */ 3079 setResponseMimeType(mimeType: string); 3080 3081 /** 3082 * Sets the reason message. 3083 * 3084 * @param { string } reason the reason message. 3085 * @syscap SystemCapability.Web.Webview.Core 3086 * @since 9 3087 */ 3088 /** 3089 * Sets the reason message. 3090 * 3091 * @param { string } reason the reason message. 3092 * @syscap SystemCapability.Web.Webview.Core 3093 * @atomicservice 3094 * @since 11 3095 */ 3096 setReasonMessage(reason: string); 3097 3098 /** 3099 * Sets the response headers. 3100 * 3101 * @param { Array<Header> } header the response headers. 3102 * @syscap SystemCapability.Web.Webview.Core 3103 * @since 9 3104 */ 3105 /** 3106 * Sets the response headers. 3107 * 3108 * @param { Array<Header> } header the response headers. 3109 * @syscap SystemCapability.Web.Webview.Core 3110 * @atomicservice 3111 * @since 11 3112 */ 3113 setResponseHeader(header: Array<Header>); 3114 3115 /** 3116 * Sets the response code. 3117 * 3118 * @param { number } code the response code. 3119 * @syscap SystemCapability.Web.Webview.Core 3120 * @since 9 3121 */ 3122 /** 3123 * Sets the response code. 3124 * 3125 * @param { number } code the response code. 3126 * @syscap SystemCapability.Web.Webview.Core 3127 * @atomicservice 3128 * @since 11 3129 */ 3130 setResponseCode(code: number); 3131 3132 /** 3133 * Sets the response is ready or not. 3134 * 3135 * @param { boolean } IsReady whether the response is ready. 3136 * @syscap SystemCapability.Web.Webview.Core 3137 * @since 9 3138 */ 3139 /** 3140 * Sets the response is ready or not. 3141 * 3142 * @param { boolean } IsReady whether the response is ready. 3143 * @syscap SystemCapability.Web.Webview.Core 3144 * @atomicservice 3145 * @since 11 3146 */ 3147 setResponseIsReady(IsReady: boolean); 3148} 3149 3150/** 3151 * Defines the Web's request/response header. 3152 * 3153 * @interface Header 3154 * @syscap SystemCapability.Web.Webview.Core 3155 * @since 8 3156 */ 3157/** 3158 * Defines the Web's request/response header. 3159 * 3160 * @interface Header 3161 * @syscap SystemCapability.Web.Webview.Core 3162 * @atomicservice 3163 * @since 11 3164 */ 3165declare interface Header { 3166 /** 3167 * Gets the key of the request/response header. 3168 * 3169 * @type { string } 3170 * @syscap SystemCapability.Web.Webview.Core 3171 * @since 8 3172 */ 3173 /** 3174 * Gets the key of the request/response header. 3175 * 3176 * @type { string } 3177 * @syscap SystemCapability.Web.Webview.Core 3178 * @atomicservice 3179 * @since 11 3180 */ 3181 headerKey: string; 3182 3183 /** 3184 * Gets the value of the request/response header. 3185 * 3186 * @type { string } 3187 * @syscap SystemCapability.Web.Webview.Core 3188 * @since 8 3189 */ 3190 /** 3191 * Gets the value of the request/response header. 3192 * 3193 * @type { string } 3194 * @syscap SystemCapability.Web.Webview.Core 3195 * @atomicservice 3196 * @since 11 3197 */ 3198 headerValue: string; 3199} 3200 3201/** 3202 * Defines the Web resource error. 3203 * 3204 * @syscap SystemCapability.Web.Webview.Core 3205 * @since 8 3206 */ 3207/** 3208 * Defines the Web resource error. 3209 * 3210 * @syscap SystemCapability.Web.Webview.Core 3211 * @crossplatform 3212 * @since 10 3213 */ 3214/** 3215 * Defines the Web resource error. 3216 * 3217 * @syscap SystemCapability.Web.Webview.Core 3218 * @crossplatform 3219 * @atomicservice 3220 * @since 11 3221 */ 3222declare class WebResourceError { 3223 /** 3224 * Constructor. 3225 * 3226 * @syscap SystemCapability.Web.Webview.Core 3227 * @since 8 3228 */ 3229 /** 3230 * Constructor. 3231 * 3232 * @syscap SystemCapability.Web.Webview.Core 3233 * @crossplatform 3234 * @since 10 3235 */ 3236 /** 3237 * Constructor. 3238 * 3239 * @syscap SystemCapability.Web.Webview.Core 3240 * @crossplatform 3241 * @atomicservice 3242 * @since 11 3243 */ 3244 constructor(); 3245 3246 /** 3247 * Gets the info of the Web resource error. 3248 * 3249 * @returns { string } Return the info of the Web resource error. 3250 * @syscap SystemCapability.Web.Webview.Core 3251 * @since 8 3252 */ 3253 /** 3254 * Gets the info of the Web resource error. 3255 * 3256 * @returns { string } Return the info of the Web resource error. 3257 * @syscap SystemCapability.Web.Webview.Core 3258 * @crossplatform 3259 * @since 10 3260 */ 3261 /** 3262 * Gets the info of the Web resource error. 3263 * 3264 * @returns { string } Return the info of the Web resource error. 3265 * @syscap SystemCapability.Web.Webview.Core 3266 * @crossplatform 3267 * @atomicservice 3268 * @since 11 3269 */ 3270 getErrorInfo(): string; 3271 3272 /** 3273 * Gets the code of the Web resource error. 3274 * 3275 * @returns { number } Return the code of the Web resource error. 3276 * @syscap SystemCapability.Web.Webview.Core 3277 * @since 8 3278 */ 3279 /** 3280 * Gets the code of the Web resource error. 3281 * 3282 * @returns { number } Return the code of the Web resource error. 3283 * @syscap SystemCapability.Web.Webview.Core 3284 * @crossplatform 3285 * @since 10 3286 */ 3287 /** 3288 * Gets the code of the Web resource error. 3289 * 3290 * @returns { number } Return the code of the Web resource error. 3291 * @syscap SystemCapability.Web.Webview.Core 3292 * @crossplatform 3293 * @atomicservice 3294 * @since 11 3295 */ 3296 getErrorCode(): number; 3297} 3298 3299/** 3300 * Defines the js geolocation request. 3301 * 3302 * @syscap SystemCapability.Web.Webview.Core 3303 * @since 8 3304 */ 3305/** 3306 * Defines the js geolocation request. 3307 * 3308 * @syscap SystemCapability.Web.Webview.Core 3309 * @crossplatform 3310 * @atomicservice 3311 * @since 11 3312 */ 3313declare class JsGeolocation { 3314 /** 3315 * Constructor. 3316 * 3317 * @syscap SystemCapability.Web.Webview.Core 3318 * @since 8 3319 */ 3320 /** 3321 * Constructor. 3322 * 3323 * @syscap SystemCapability.Web.Webview.Core 3324 * @crossplatform 3325 * @atomicservice 3326 * @since 11 3327 */ 3328 constructor(); 3329 3330 /** 3331 * Report the geolocation permission status from users. 3332 * 3333 * @param { string } origin - The origin that ask for the geolocation permission. 3334 * @param { boolean } allow - The geolocation permission status. 3335 * @param { boolean } retain - Whether to allow the geolocation permission status to be saved to the system. 3336 * @syscap SystemCapability.Web.Webview.Core 3337 * @since 8 3338 */ 3339 /** 3340 * Report the geolocation permission status from users. 3341 * 3342 * @param { string } origin - The origin that ask for the geolocation permission. 3343 * @param { boolean } allow - The geolocation permission status. 3344 * @param { boolean } retain - Whether to allow the geolocation permission status to be saved to the system. 3345 * @syscap SystemCapability.Web.Webview.Core 3346 * @crossplatform 3347 * @atomicservice 3348 * @since 11 3349 */ 3350 invoke(origin: string, allow: boolean, retain: boolean): void; 3351} 3352 3353/** 3354 * Defines the Web cookie. 3355 * 3356 * @syscap SystemCapability.Web.Webview.Core 3357 * @since 8 3358 */ 3359/** 3360 * Defines the Web cookie. 3361 * 3362 * @syscap SystemCapability.Web.Webview.Core 3363 * @atomicservice 3364 * @since 11 3365 */ 3366declare class WebCookie { 3367 /** 3368 * Constructor. 3369 * 3370 * @syscap SystemCapability.Web.Webview.Core 3371 * @since 8 3372 */ 3373 /** 3374 * Constructor. 3375 * 3376 * @syscap SystemCapability.Web.Webview.Core 3377 * @atomicservice 3378 * @since 11 3379 */ 3380 constructor(); 3381 3382 /** 3383 * Sets the cookie. 3384 * 3385 * @syscap SystemCapability.Web.Webview.Core 3386 * @since 8 3387 * @deprecated since 9 3388 * @useinstead ohos.web.webview.webview.WebCookieManager#setCookie 3389 */ 3390 setCookie(); 3391 3392 /** 3393 * Saves the cookies. 3394 * 3395 * @syscap SystemCapability.Web.Webview.Core 3396 * @since 8 3397 * @deprecated since 9 3398 * @useinstead ohos.web.webview.webview.WebCookieManager#saveCookieAsync 3399 */ 3400 saveCookie(); 3401} 3402 3403/** 3404 * Defines the Web controller. 3405 * 3406 * @syscap SystemCapability.Web.Webview.Core 3407 * @since 8 3408 * @deprecated since 9 3409 * @useinstead ohos.web.webview.webview.WebviewController 3410 */ 3411declare class WebController { 3412 /** 3413 * Constructor. 3414 * 3415 * @syscap SystemCapability.Web.Webview.Core 3416 * @since 8 3417 * @deprecated since 9 3418 */ 3419 constructor(); 3420 3421 /** 3422 * Let the Web inactive. 3423 * 3424 * @syscap SystemCapability.Web.Webview.Core 3425 * @since 8 3426 * @deprecated since 9 3427 * @useinstead ohos.web.webview.webview.WebviewController#onInactive 3428 */ 3429 onInactive(): void; 3430 3431 /** 3432 * Let the Web active. 3433 * 3434 * @syscap SystemCapability.Web.Webview.Core 3435 * @since 8 3436 * @deprecated since 9 3437 * @useinstead ohos.web.webview.webview.WebviewController#onActive 3438 */ 3439 onActive(): void; 3440 3441 /** 3442 * Let the Web zoom by. 3443 * 3444 * @param { number } factor The zoom factor. 3445 * @syscap SystemCapability.Web.Webview.Core 3446 * @since 8 3447 * @deprecated since 9 3448 * @useinstead ohos.web.webview.webview.WebviewController#zoom 3449 */ 3450 zoom(factor: number): void; 3451 3452 /** 3453 * Clears the history in the Web. 3454 * 3455 * @syscap SystemCapability.Web.Webview.Core 3456 * @since 8 3457 * @deprecated since 9 3458 * @useinstead ohos.web.webview.webview.WebviewController#clearHistory 3459 */ 3460 clearHistory(): void; 3461 3462 /** 3463 * Loads a piece of code and execute JS code in the context of the currently displayed page. 3464 * 3465 * @param { object } options The options with a piece of code and a callback. 3466 * @syscap SystemCapability.Web.Webview.Core 3467 * @since 8 3468 * @deprecated since 9 3469 * @useinstead ohos.web.webview.webview.WebviewController#runJavaScript 3470 */ 3471 runJavaScript(options: { script: string, callback?: (result: string) => void }); 3472 3473 /** 3474 * Loads the data or URL. 3475 * 3476 * @param { object } options The options with the data or URL and other information. 3477 * @syscap SystemCapability.Web.Webview.Core 3478 * @since 8 3479 * @deprecated since 9 3480 * @useinstead ohos.web.webview.webview.WebviewController#loadData 3481 */ 3482 loadData(options: { data: string, mimeType: string, encoding: string, baseUrl?: string, historyUrl?: string }); 3483 3484 /** 3485 * Loads the given URL. 3486 * 3487 * @param { object } options The options with the URL and other information. 3488 * @syscap SystemCapability.Web.Webview.Core 3489 * @since 8 3490 * @deprecated since 9 3491 * @useinstead ohos.web.webview.webview.WebviewController#loadUrl 3492 */ 3493 loadUrl(options: { url: string | Resource, headers?: Array<Header> }); 3494 3495 /** 3496 * refreshes the current URL. 3497 * 3498 * @syscap SystemCapability.Web.Webview.Core 3499 * @since 8 3500 * @deprecated since 9 3501 * @useinstead ohos.web.webview.webview.WebviewController#refresh 3502 */ 3503 refresh(); 3504 3505 /** 3506 * Stops the current load. 3507 * 3508 * @syscap SystemCapability.Web.Webview.Core 3509 * @since 8 3510 * @deprecated since 9 3511 * @useinstead ohos.web.webview.webview.WebviewController#stop 3512 */ 3513 stop(); 3514 3515 /** 3516 * Registers the JavaScript object and method list. 3517 * 3518 * @param { object } options - The option with the JavaScript object and method list. 3519 * @syscap SystemCapability.Web.Webview.Core 3520 * @since 8 3521 * @deprecated since 9 3522 * @useinstead ohos.web.webview.webview.WebviewController#registerJavaScriptProxy 3523 */ 3524 registerJavaScriptProxy(options: { object: object, name: string, methodList: Array<string> }); 3525 3526 /** 3527 * Deletes a registered JavaScript object with given name. 3528 * 3529 * @param { string } name - The name of a registered JavaScript object to be deleted. 3530 * @syscap SystemCapability.Web.Webview.Core 3531 * @since 8 3532 * @deprecated since 9 3533 * @useinstead ohos.web.webview.webview.WebviewController#deleteJavaScriptRegister 3534 */ 3535 deleteJavaScriptRegister(name: string); 3536 3537 /** 3538 * Gets the type of HitTest. 3539 * 3540 * @returns { HitTestType } The type of HitTest. 3541 * @syscap SystemCapability.Web.Webview.Core 3542 * @since 8 3543 * @deprecated since 9 3544 * @useinstead ohos.web.webview.webview.WebviewController#getHitTest 3545 */ 3546 getHitTest(): HitTestType; 3547 3548 /** 3549 * Gets the request focus. 3550 * 3551 * @syscap SystemCapability.Web.Webview.Core 3552 * @since 8 3553 * @deprecated since 9 3554 * @useinstead ohos.web.webview.webview.WebviewController#requestFocus 3555 */ 3556 requestFocus(); 3557 3558 /** 3559 * Checks whether the web page can go back. 3560 * 3561 * @returns { boolean } Whether the web page can go back. 3562 * @syscap SystemCapability.Web.Webview.Core 3563 * @since 8 3564 * @deprecated since 9 3565 * @useinstead ohos.web.webview.webview.WebviewController#accessBackward 3566 */ 3567 accessBackward(): boolean; 3568 3569 /** 3570 * Checks whether the web page can go forward. 3571 * 3572 * @returns { boolean } 3573 * @syscap SystemCapability.Web.Webview.Core 3574 * @since 8 3575 * @deprecated since 9 3576 * @useinstead ohos.web.webview.webview.WebviewController#accessForward 3577 */ 3578 accessForward(): boolean; 3579 3580 /** 3581 * Checks whether the web page can go back or forward the given number of steps. 3582 * 3583 * @param { number } step The number of steps. 3584 * @returns { boolean } 3585 * @syscap SystemCapability.Web.Webview.Core 3586 * @since 8 3587 * @deprecated since 9 3588 * @useinstead ohos.web.webview.webview.WebviewController#accessStep 3589 */ 3590 accessStep(step: number): boolean; 3591 3592 /** 3593 * Goes back in the history of the web page. 3594 * 3595 * @syscap SystemCapability.Web.Webview.Core 3596 * @since 8 3597 * @deprecated since 9 3598 * @useinstead ohos.web.webview.webview.WebviewController#backward 3599 */ 3600 backward(); 3601 3602 /** 3603 * Goes forward in the history of the web page. 3604 * 3605 * @syscap SystemCapability.Web.Webview.Core 3606 * @since 8 3607 * @deprecated since 9 3608 * @useinstead ohos.web.webview.webview.WebviewController#forward 3609 */ 3610 forward(); 3611 3612 /** 3613 * Gets network cookie manager 3614 * 3615 * @returns { WebCookie } 3616 * @syscap SystemCapability.Web.Webview.Core 3617 * @since 9 3618 * @deprecated since 9 3619 * @useinstead ohos.web.webview.WebCookieManager 3620 */ 3621 getCookieManager(): WebCookie 3622} 3623 3624/** 3625 * Defines the Web options. 3626 * 3627 * @interface WebOptions 3628 * @syscap SystemCapability.Web.Webview.Core 3629 * @since 8 3630 */ 3631/** 3632 * Defines the Web options. 3633 * 3634 * @interface WebOptions 3635 * @syscap SystemCapability.Web.Webview.Core 3636 * @crossplatform 3637 * @since 10 3638 */ 3639/** 3640 * Defines the Web options. 3641 * 3642 * @interface WebOptions 3643 * @syscap SystemCapability.Web.Webview.Core 3644 * @crossplatform 3645 * @atomicservice 3646 * @since 11 3647 */ 3648declare interface WebOptions { 3649 /** 3650 * Sets the address of the web page to be displayed. 3651 * 3652 * @type { string | Resource } 3653 * @syscap SystemCapability.Web.Webview.Core 3654 * @since 8 3655 */ 3656 /** 3657 * Sets the address of the web page to be displayed. 3658 * 3659 * @type { string | Resource } 3660 * @syscap SystemCapability.Web.Webview.Core 3661 * @crossplatform 3662 * @since 10 3663 */ 3664 /** 3665 * Sets the address of the web page to be displayed. 3666 * 3667 * @type { string | Resource } 3668 * @syscap SystemCapability.Web.Webview.Core 3669 * @crossplatform 3670 * @atomicservice 3671 * @since 11 3672 */ 3673 src: string | Resource; 3674 /** 3675 * Sets the controller of the Web. 3676 * 3677 * @type { WebController | WebviewController } 3678 * @syscap SystemCapability.Web.Webview.Core 3679 * @since 8 3680 */ 3681 /** 3682 * Sets the controller of the Web. 3683 * 3684 * @type { WebController | WebviewController } 3685 * @syscap SystemCapability.Web.Webview.Core 3686 * @since 9 3687 */ 3688 /** 3689 * Sets the controller of the Web. 3690 * 3691 * @type { WebController | WebviewController } 3692 * @syscap SystemCapability.Web.Webview.Core 3693 * @crossplatform 3694 * @since 10 3695 */ 3696 /** 3697 * Sets the controller of the Web. 3698 * 3699 * @type { WebController | WebviewController } 3700 * @syscap SystemCapability.Web.Webview.Core 3701 * @crossplatform 3702 * @atomicservice 3703 * @since 11 3704 */ 3705 controller: WebController | WebviewController; 3706 3707 /** 3708 * Sets the incognito mode of the Web, the parameter is optional and default value is false. 3709 * When the Web is in incognito mode, cookies, records of websites, geolocation permissions 3710 * will not save in persistent files. 3711 * 3712 * @type { ?boolean } 3713 * @syscap SystemCapability.Web.Webview.Core 3714 * @atomicservice 3715 * @since 11 3716 */ 3717 incognitoMode? : boolean; 3718} 3719 3720/** 3721 * Defines the contents of the JavaScript to be injected. 3722 * 3723 * @interface ScriptItem 3724 * @syscap SystemCapability.Web.Webview.Core 3725 * @atomicservice 3726 * @since 11 3727 */ 3728declare interface ScriptItem { 3729 /** 3730 * Sets the JavaScript to be injected. 3731 * 3732 * @type { string } 3733 * @syscap SystemCapability.Web.Webview.Core 3734 * @atomicservice 3735 * @since 11 3736 */ 3737 script: string; 3738 /** 3739 * Sets the rules of the JavaScript. 3740 * 3741 * @type { Array<string> } 3742 * @syscap SystemCapability.Web.Webview.Core 3743 * @atomicservice 3744 * @since 11 3745 */ 3746 scriptRules: Array<string>; 3747} 3748 3749/** 3750 * Defines the load committed details. 3751 * 3752 * @interface LoadCommittedDetails 3753 * @syscap SystemCapability.Web.Webview.Core 3754 * @atomicservice 3755 * @since 11 3756 */ 3757declare interface LoadCommittedDetails { 3758 /** 3759 * Check whether the request is for getting the main frame. 3760 * 3761 * @type { boolean } 3762 * @syscap SystemCapability.Web.Webview.Core 3763 * @atomicservice 3764 * @since 11 3765 */ 3766 isMainFrame: boolean; 3767 3768 /** 3769 * Whether the navigation happened without changing document. Examples of 3770 * same document navigations are: 3771 * 1. reference fragment navigations. 3772 * 2. pushState/replaceState. 3773 * 3. same page history navigation 3774 * 3775 * @type { boolean } 3776 * @syscap SystemCapability.Web.Webview.Core 3777 * @atomicservice 3778 * @since 11 3779 */ 3780 isSameDocument: boolean; 3781 3782 /** 3783 * True if the committed entry has replaced the existing one. Note that in 3784 * case of subframes, the NavigationEntry and FrameNavigationEntry objects 3785 * don't actually get replaced - they're reused, but with updated attributes. 3786 * 3787 * @type { boolean } 3788 * @syscap SystemCapability.Web.Webview.Core 3789 * @atomicservice 3790 * @since 11 3791 */ 3792 didReplaceEntry: boolean; 3793 3794 /** 3795 * The type of the navigation. 3796 * 3797 * @type { WebNavigationType } 3798 * @syscap SystemCapability.Web.Webview.Core 3799 * @atomicservice 3800 * @since 11 3801 */ 3802 navigationType: WebNavigationType; 3803 3804 /** 3805 * The url to navigate. 3806 * 3807 * @type { string } 3808 * @syscap SystemCapability.Web.Webview.Core 3809 * @atomicservice 3810 * @since 11 3811 */ 3812 url: string; 3813} 3814 3815/** 3816 * Defines the Web interface. 3817 * 3818 * @interface WebInterface 3819 * @syscap SystemCapability.Web.Webview.Core 3820 * @since 8 3821 */ 3822/** 3823 * Defines the Web interface. 3824 * 3825 * @interface WebInterface 3826 * @syscap SystemCapability.Web.Webview.Core 3827 * @crossplatform 3828 * @since 10 3829 */ 3830/** 3831 * Defines the Web interface. 3832 * 3833 * @interface WebInterface 3834 * @syscap SystemCapability.Web.Webview.Core 3835 * @crossplatform 3836 * @atomicservice 3837 * @since 11 3838 */ 3839interface WebInterface { 3840 /** 3841 * Sets Value. 3842 * 3843 * @param { WebOptions } value 3844 * @returns { WebAttribute } 3845 * @syscap SystemCapability.Web.Webview.Core 3846 * @since 8 3847 */ 3848 /** 3849 * Sets Value. 3850 * 3851 * @param { WebOptions } value 3852 * @returns { WebAttribute } 3853 * @syscap SystemCapability.Web.Webview.Core 3854 * @crossplatform 3855 * @since 10 3856 */ 3857 /** 3858 * Sets Value. 3859 * 3860 * @param { WebOptions } value 3861 * @returns { WebAttribute } 3862 * @syscap SystemCapability.Web.Webview.Core 3863 * @crossplatform 3864 * @atomicservice 3865 * @since 11 3866 */ 3867 (value: WebOptions): WebAttribute; 3868} 3869 3870/** 3871 * Defines the embed info. 3872 * 3873 * @interface NativeEmbedInfo 3874 * @syscap SystemCapability.Web.Webview.Core 3875 * @atomicservice 3876 * @since 11 3877 */ 3878declare interface NativeEmbedInfo { 3879 /** 3880 * The embed id. 3881 * 3882 * @type { ?string } 3883 * @syscap SystemCapability.Web.Webview.Core 3884 * @atomicservice 3885 * @since 11 3886 */ 3887 id?: string; 3888 /** 3889 * Only when enableEmbedMode is true and type is marked as native/xxx will be recognized as a same layer component. 3890 * 3891 * @type { ?string } 3892 * @syscap SystemCapability.Web.Webview.Core 3893 * @atomicservice 3894 * @since 11 3895 */ 3896 type?: string; 3897 /** 3898 * The embed tag src. 3899 * 3900 * @type { ?string } 3901 * @syscap SystemCapability.Web.Webview.Core 3902 * @atomicservice 3903 * @since 11 3904 */ 3905 src?: string; 3906 /** 3907 * The embed tag width. 3908 * 3909 * @type { ?number } 3910 * @syscap SystemCapability.Web.Webview.Core 3911 * @atomicservice 3912 * @since 11 3913 */ 3914 width?: number; 3915 /** 3916 * The embed tag height. 3917 * 3918 * @type { ?number } 3919 * @syscap SystemCapability.Web.Webview.Core 3920 * @atomicservice 3921 * @since 11 3922 */ 3923 height?: number; 3924 /** 3925 * The embed tag url. 3926 * 3927 * @type { ?string } 3928 * @syscap SystemCapability.Web.Webview.Core 3929 * @atomicservice 3930 * @since 11 3931 */ 3932 url?: string; 3933} 3934 3935/** 3936 * Defines the Embed Data info. 3937 * 3938 * @interface NativeEmbedDataInfo 3939 * @syscap SystemCapability.Web.Webview.Core 3940 * @atomicservice 3941 * @since 11 3942 */ 3943declare interface NativeEmbedDataInfo { 3944 /** 3945 * The embed status. 3946 * 3947 * @type { ?NativeEmbedStatus } 3948 * @syscap SystemCapability.Web.Webview.Core 3949 * @atomicservice 3950 * @since 11 3951 */ 3952 status?: NativeEmbedStatus; 3953 /** 3954 * The surface id. 3955 * 3956 * @type { ?string } 3957 * @syscap SystemCapability.Web.Webview.Core 3958 * @atomicservice 3959 * @since 11 3960 */ 3961 surfaceId?: string; 3962 /** 3963 * The embed id. 3964 * 3965 * @type { ?string } 3966 * @syscap SystemCapability.Web.Webview.Core 3967 * @atomicservice 3968 * @since 11 3969 */ 3970 embedId?: string; 3971 /** 3972 * The embed info. 3973 * 3974 * @type { ?NativeEmbedInfo } 3975 * @syscap SystemCapability.Web.Webview.Core 3976 * @atomicservice 3977 * @since 11 3978 */ 3979 info?: NativeEmbedInfo; 3980} 3981 3982/** 3983 * Defines the user touch info. 3984 * 3985 * @interface NativeEmbedTouchInfo 3986 * @syscap SystemCapability.Web.Webview.Core 3987 * @atomicservice 3988 * @since 11 3989 */ 3990declare interface NativeEmbedTouchInfo { 3991 /** 3992 * The native embed id. 3993 * 3994 * @type { ?string } 3995 * @syscap SystemCapability.Web.Webview.Core 3996 * @atomicservice 3997 * @since 11 3998 */ 3999 embedId?: string; 4000 /** 4001 * An event sent when the state of contacts with a touch-sensitive surface changes. 4002 * 4003 * @type { ?TouchEvent } 4004 * @syscap SystemCapability.Web.Webview.Core 4005 * @atomicservice 4006 * @since 11 4007 */ 4008 touchEvent?: TouchEvent; 4009} 4010 4011/** 4012 * Defines the Web attribute functions. 4013 * 4014 * @extends CommonMethod<WebAttribute> 4015 * @syscap SystemCapability.Web.Webview.Core 4016 * @since 8 4017 */ 4018/** 4019 * Defines the Web attribute functions. 4020 * 4021 * @extends CommonMethod<WebAttribute> 4022 * @syscap SystemCapability.Web.Webview.Core 4023 * @crossplatform 4024 * @since 10 4025 */ 4026/** 4027 * Defines the Web attribute functions. 4028 * 4029 * @extends CommonMethod<WebAttribute> 4030 * @syscap SystemCapability.Web.Webview.Core 4031 * @crossplatform 4032 * @atomicservice 4033 * @since 11 4034 */ 4035declare class WebAttribute extends CommonMethod<WebAttribute> { 4036 /** 4037 * Sets whether the Web allows JavaScript scripts to execute. 4038 * 4039 * @param { boolean } javaScriptAccess - {@code true} means the Web can allows JavaScript scripts to execute; {@code false} otherwise. 4040 * @returns { WebAttribute } 4041 * @syscap SystemCapability.Web.Webview.Core 4042 * @since 8 4043 */ 4044 /** 4045 * Sets whether the Web allows JavaScript scripts to execute. 4046 * 4047 * @param { boolean } javaScriptAccess - {@code true} means the Web can allows JavaScript scripts to execute; {@code false} otherwise. 4048 * @returns { WebAttribute } 4049 * @syscap SystemCapability.Web.Webview.Core 4050 * @crossplatform 4051 * @since 10 4052 */ 4053 /** 4054 * Sets whether the Web allows JavaScript scripts to execute. 4055 * 4056 * @param { boolean } javaScriptAccess - {@code true} means the Web can allows JavaScript scripts to execute; {@code false} otherwise. 4057 * @returns { WebAttribute } 4058 * @syscap SystemCapability.Web.Webview.Core 4059 * @crossplatform 4060 * @atomicservice 4061 * @since 11 4062 */ 4063 javaScriptAccess(javaScriptAccess: boolean): WebAttribute; 4064 4065 /** 4066 * Sets whether enable local file system access in Web. 4067 * 4068 * @param { boolean } fileAccess - {@code true} means enable local file system access in Web; {@code false} otherwise. 4069 * @returns { WebAttribute } 4070 * @syscap SystemCapability.Web.Webview.Core 4071 * @since 8 4072 */ 4073 /** 4074 * Sets whether enable local file system access in Web. 4075 * 4076 * @param { boolean } fileAccess - {@code true} means enable local file system access in Web; {@code false} otherwise. 4077 * @returns { WebAttribute } 4078 * @syscap SystemCapability.Web.Webview.Core 4079 * @atomicservice 4080 * @since 11 4081 */ 4082 fileAccess(fileAccess: boolean): WebAttribute; 4083 4084 /** 4085 * Sets whether to allow image resources to be loaded from the network. 4086 * 4087 * @param { boolean } onlineImageAccess - {@code true} means the Web can allow image resources to be loaded from the network; 4088 * {@code false} otherwise. 4089 * @returns { WebAttribute } 4090 * @syscap SystemCapability.Web.Webview.Core 4091 * @since 8 4092 */ 4093 /** 4094 * Sets whether to allow image resources to be loaded from the network. 4095 * 4096 * @param { boolean } onlineImageAccess - {@code true} means the Web can allow image resources to be loaded from the network; 4097 * {@code false} otherwise. 4098 * @returns { WebAttribute } 4099 * @syscap SystemCapability.Web.Webview.Core 4100 * @atomicservice 4101 * @since 11 4102 */ 4103 onlineImageAccess(onlineImageAccess: boolean): WebAttribute; 4104 4105 /** 4106 * Sets whether to enable the DOM Storage API permission. 4107 * 4108 * @param { boolean } domStorageAccess - {@code true} means enable the DOM Storage API permission in Web; {@code false} otherwise. 4109 * @returns { WebAttribute } 4110 * @syscap SystemCapability.Web.Webview.Core 4111 * @since 8 4112 */ 4113 /** 4114 * Sets whether to enable the DOM Storage API permission. 4115 * 4116 * @param { boolean } domStorageAccess - {@code true} means enable the DOM Storage API permission in Web; {@code false} otherwise. 4117 * @returns { WebAttribute } 4118 * @syscap SystemCapability.Web.Webview.Core 4119 * @atomicservice 4120 * @since 11 4121 */ 4122 domStorageAccess(domStorageAccess: boolean): WebAttribute; 4123 4124 /** 4125 * Sets whether the Web can automatically load image resources. 4126 * 4127 * @param { boolean } imageAccess - {@code true} means the Web can automatically load image resources; {@code false} otherwise. 4128 * @returns { WebAttribute } 4129 * @syscap SystemCapability.Web.Webview.Core 4130 * @since 8 4131 */ 4132 /** 4133 * Sets whether the Web can automatically load image resources. 4134 * 4135 * @param { boolean } imageAccess - {@code true} means the Web can automatically load image resources; {@code false} otherwise. 4136 * @returns { WebAttribute } 4137 * @syscap SystemCapability.Web.Webview.Core 4138 * @atomicservice 4139 * @since 11 4140 */ 4141 imageAccess(imageAccess: boolean): WebAttribute; 4142 4143 /** 4144 * Sets how to load HTTP and HTTPS content. 4145 * 4146 * @param { MixedMode } mixedMode - The mixed mode, which can be {@link MixedMode}. 4147 * @returns { WebAttribute } 4148 * @syscap SystemCapability.Web.Webview.Core 4149 * @since 8 4150 */ 4151 /** 4152 * Sets how to load HTTP and HTTPS content. 4153 * 4154 * @param { MixedMode } mixedMode - The mixed mode, which can be {@link MixedMode}. 4155 * @returns { WebAttribute } 4156 * @syscap SystemCapability.Web.Webview.Core 4157 * @atomicservice 4158 * @since 11 4159 */ 4160 mixedMode(mixedMode: MixedMode): WebAttribute; 4161 4162 /** 4163 * Sets whether the Web supports zooming using gestures. 4164 * 4165 * @param { boolean } zoomAccess {@code true} means the Web supports zooming using gestures; {@code false} otherwise. 4166 * @returns { WebAttribute } 4167 * @syscap SystemCapability.Web.Webview.Core 4168 * @since 8 4169 */ 4170 /** 4171 * Sets whether the Web supports zooming using gestures. 4172 * 4173 * @param { boolean } zoomAccess {@code true} means the Web supports zooming using gestures; {@code false} otherwise. 4174 * @returns { WebAttribute } 4175 * @syscap SystemCapability.Web.Webview.Core 4176 * @crossplatform 4177 * @since 10 4178 */ 4179 /** 4180 * Sets whether the Web supports zooming using gestures. 4181 * 4182 * @param { boolean } zoomAccess {@code true} means the Web supports zooming using gestures; {@code false} otherwise. 4183 * @returns { WebAttribute } 4184 * @syscap SystemCapability.Web.Webview.Core 4185 * @crossplatform 4186 * @atomicservice 4187 * @since 11 4188 */ 4189 zoomAccess(zoomAccess: boolean): WebAttribute; 4190 4191 /** 4192 * Sets whether to allow access to geographical locations. 4193 * 4194 * @param { boolean } geolocationAccess - {@code true} means the Web allows access to geographical locations; {@code false} otherwise. 4195 * @returns { WebAttribute } 4196 * @syscap SystemCapability.Web.Webview.Core 4197 * @since 8 4198 */ 4199 /** 4200 * Sets whether to allow access to geographical locations. 4201 * 4202 * @param { boolean } geolocationAccess - {@code true} means the Web allows access to geographical locations; {@code false} otherwise. 4203 * @returns { WebAttribute } 4204 * @syscap SystemCapability.Web.Webview.Core 4205 * @crossplatform 4206 * @atomicservice 4207 * @since 11 4208 */ 4209 geolocationAccess(geolocationAccess: boolean): WebAttribute; 4210 4211 /** 4212 * Injects the JavaScript object into window and invoke the function in window. 4213 * 4214 * @param { object } javaScriptProxy - The JavaScript object to be injected. 4215 * @returns { WebAttribute } 4216 * @syscap SystemCapability.Web.Webview.Core 4217 * @since 8 4218 */ 4219 /** 4220 * Injects the JavaScript object into window and invoke the function in window. 4221 * 4222 * @param { object } javaScriptProxy - The JavaScript object to be injected. 4223 * @returns { WebAttribute } 4224 * @syscap SystemCapability.Web.Webview.Core 4225 * @since 9 4226 */ 4227 /** 4228 * Injects the JavaScript object into window and invoke the function in window. 4229 * 4230 * @param { object } javaScriptProxy - The JavaScript object to be injected. 4231 * @returns { WebAttribute } 4232 * @syscap SystemCapability.Web.Webview.Core 4233 * @atomicservice 4234 * @since 11 4235 */ 4236 javaScriptProxy(javaScriptProxy: { object: object, name: string, methodList: Array<string>, 4237 controller: WebController | WebviewController }): WebAttribute; 4238 4239 /** 4240 * Sets whether the Web should save the password. 4241 * 4242 * @param { boolean } password - {@code true} means the Web can save the password; {@code false} otherwise. 4243 * @returns { WebAttribute } 4244 * @syscap SystemCapability.Web.Webview.Core 4245 * @since 8 4246 * @deprecated since 10 4247 */ 4248 password(password: boolean): WebAttribute; 4249 4250 /** 4251 * Sets the mode of cache in Web. 4252 * 4253 * @param { CacheMode } cacheMode - The cache mode, which can be {@link CacheMode}. 4254 * @returns { WebAttribute } 4255 * @syscap SystemCapability.Web.Webview.Core 4256 * @since 8 4257 */ 4258 /** 4259 * Sets the mode of cache in Web. 4260 * 4261 * @param { CacheMode } cacheMode - The cache mode, which can be {@link CacheMode}. 4262 * @returns { WebAttribute } 4263 * @syscap SystemCapability.Web.Webview.Core 4264 * @atomicservice 4265 * @since 11 4266 */ 4267 cacheMode(cacheMode: CacheMode): WebAttribute; 4268 4269 /** 4270 * Sets the dark mode of Web. 4271 * 4272 * @param { WebDarkMode } mode - The dark mode, which can be {@link WebDarkMode}. 4273 * @returns { WebAttribute } 4274 * @syscap SystemCapability.Web.Webview.Core 4275 * @since 9 4276 */ 4277 /** 4278 * Sets the dark mode of Web. 4279 * 4280 * @param { WebDarkMode } mode - The dark mode, which can be {@link WebDarkMode}. 4281 * @returns { WebAttribute } 4282 * @syscap SystemCapability.Web.Webview.Core 4283 * @atomicservice 4284 * @since 11 4285 */ 4286 darkMode(mode: WebDarkMode): WebAttribute; 4287 4288 /** 4289 * Sets whether to enable forced dark algorithm when the web is in dark mode 4290 * 4291 * @param { boolean } access {@code true} means enable the force dark algorithm; {@code false} otherwise. 4292 * @returns { WebAttribute } 4293 * @syscap SystemCapability.Web.Webview.Core 4294 * @since 9 4295 */ 4296 /** 4297 * Sets whether to enable forced dark algorithm when the web is in dark mode 4298 * 4299 * @param { boolean } access {@code true} means enable the force dark algorithm; {@code false} otherwise. 4300 * @returns { WebAttribute } 4301 * @syscap SystemCapability.Web.Webview.Core 4302 * @atomicservice 4303 * @since 11 4304 */ 4305 forceDarkAccess(access: boolean): WebAttribute; 4306 4307 /** 4308 * Sets the media options. 4309 * 4310 * @param { WebMediaOptions } options The media options, which can be {@link WebMediaOptions}. 4311 * @returns { WebAttribute } 4312 * @syscap SystemCapability.Web.Webview.Core 4313 * @since 10 4314 */ 4315 /** 4316 * Sets the media options. 4317 * 4318 * @param { WebMediaOptions } options The media options, which can be {@link WebMediaOptions}. 4319 * @returns { WebAttribute } 4320 * @syscap SystemCapability.Web.Webview.Core 4321 * @atomicservice 4322 * @since 11 4323 */ 4324 mediaOptions(options: WebMediaOptions): WebAttribute; 4325 4326 /** 4327 * Sets whether the Web should save the table data. 4328 * 4329 * @param { boolean } tableData {@code true} means the Web can save the table data; {@code false} otherwise. 4330 * @returns { WebAttribute } 4331 * @syscap SystemCapability.Web.Webview.Core 4332 * @since 8 4333 * @deprecated since 10 4334 */ 4335 tableData(tableData: boolean): WebAttribute; 4336 4337 /** 4338 * Sets whether the Web access meta 'viewport' in HTML. 4339 * 4340 * @param { boolean } wideViewModeAccess {@code true} means the Web access meta 'viewport' in HTML; {@code false} otherwise. 4341 * @returns { WebAttribute } 4342 * @syscap SystemCapability.Web.Webview.Core 4343 * @since 8 4344 * @deprecated since 10 4345 */ 4346 wideViewModeAccess(wideViewModeAccess: boolean): WebAttribute; 4347 4348 /** 4349 * Sets whether the Web access overview mode. 4350 * 4351 * @param { boolean } overviewModeAccess {@code true} means the Web access overview mode; {@code false} otherwise. 4352 * @returns { WebAttribute } 4353 * @syscap SystemCapability.Web.Webview.Core 4354 * @since 8 4355 */ 4356 /** 4357 * Sets whether the Web access overview mode. 4358 * 4359 * @param { boolean } overviewModeAccess {@code true} means the Web access overview mode; {@code false} otherwise. 4360 * @returns { WebAttribute } 4361 * @syscap SystemCapability.Web.Webview.Core 4362 * @atomicservice 4363 * @since 11 4364 */ 4365 overviewModeAccess(overviewModeAccess: boolean): WebAttribute; 4366 /** 4367 * Sets the over-scroll mode for web 4368 * 4369 * @param { OverScrollMode } mode - The over-scroll mode, which can be {@link OverScrollMode}. 4370 * @returns { WebAttribute } 4371 * @syscap SystemCapability.Web.Webview.Core 4372 * @atomicservice 4373 * @since 11 4374 */ 4375 overScrollMode(mode: OverScrollMode): WebAttribute; 4376 /** 4377 * Sets the ratio of the text zoom. 4378 * 4379 * @param { number } textZoomAtio The ratio of the text zoom. 4380 * @returns { WebAttribute } 4381 * @syscap SystemCapability.Web.Webview.Core 4382 * @since 8 4383 * @deprecated since 9 4384 * @useinstead ohos.web.WebAttribute#textZoomRatio 4385 */ 4386 textZoomAtio(textZoomAtio: number): WebAttribute; 4387 4388 /** 4389 * Sets the ratio of the text zoom. 4390 * 4391 * @param { number } textZoomRatio The ratio of the text zoom. 4392 * @returns { WebAttribute } 4393 * @syscap SystemCapability.Web.Webview.Core 4394 * @since 9 4395 */ 4396 /** 4397 * Sets the ratio of the text zoom. 4398 * 4399 * @param { number } textZoomRatio The ratio of the text zoom. 4400 * @returns { WebAttribute } 4401 * @syscap SystemCapability.Web.Webview.Core 4402 * @atomicservice 4403 * @since 11 4404 */ 4405 textZoomRatio(textZoomRatio: number): WebAttribute; 4406 4407 /** 4408 * Sets whether the Web access the database. 4409 * 4410 * @param { boolean } databaseAccess {@code true} means the Web access the database; {@code false} otherwise. 4411 * @returns { WebAttribute } 4412 * @syscap SystemCapability.Web.Webview.Core 4413 * @since 8 4414 */ 4415 /** 4416 * Sets whether the Web access the database. 4417 * 4418 * @param { boolean } databaseAccess {@code true} means the Web access the database; {@code false} otherwise. 4419 * @returns { WebAttribute } 4420 * @syscap SystemCapability.Web.Webview.Core 4421 * @atomicservice 4422 * @since 11 4423 */ 4424 databaseAccess(databaseAccess: boolean): WebAttribute; 4425 4426 /** 4427 * Sets the initial scale for the Web. 4428 * 4429 * @param { number } percent the initial scale for the Web. 4430 * @returns { WebAttribute } 4431 * @syscap SystemCapability.Web.Webview.Core 4432 * @since 9 4433 */ 4434 /** 4435 * Sets the initial scale for the Web. 4436 * 4437 * @param { number } percent the initial scale for the Web. 4438 * @returns { WebAttribute } 4439 * @syscap SystemCapability.Web.Webview.Core 4440 * @atomicservice 4441 * @since 11 4442 */ 4443 initialScale(percent: number): WebAttribute; 4444 4445 /** 4446 * Sets the Web's user agent. 4447 * 4448 * @param { string } userAgent The Web's user agent. 4449 * @returns { WebAttribute } 4450 * @syscap SystemCapability.Web.Webview.Core 4451 * @since 8 4452 * @deprecated since 10 4453 * @useinstead ohos.web.webview.webview.WebviewController#setCustomUserAgent 4454 */ 4455 userAgent(userAgent: string): WebAttribute; 4456 4457 /** 4458 * Triggered at the end of web page loading. 4459 * 4460 * @param { function } callback The triggered function at the end of web page loading. 4461 * @returns { WebAttribute } 4462 * @syscap SystemCapability.Web.Webview.Core 4463 * @since 8 4464 */ 4465 /** 4466 * Triggered at the end of web page loading. 4467 * 4468 * @param { function } callback The triggered function at the end of web page loading. 4469 * @returns { WebAttribute } 4470 * @syscap SystemCapability.Web.Webview.Core 4471 * @crossplatform 4472 * @since 10 4473 */ 4474 /** 4475 * Triggered at the end of web page loading. 4476 * 4477 * @param { function } callback The triggered function at the end of web page loading. 4478 * @returns { WebAttribute } 4479 * @syscap SystemCapability.Web.Webview.Core 4480 * @crossplatform 4481 * @atomicservice 4482 * @since 11 4483 */ 4484 onPageEnd(callback: (event?: { 4485 /** 4486 * The url of page. 4487 * 4488 * @syscap SystemCapability.Web.Webview.Core 4489 * @crossplatform 4490 * @since 10 4491 */ 4492 /** 4493 * The url of page. 4494 * 4495 * @syscap SystemCapability.Web.Webview.Core 4496 * @crossplatform 4497 * @atomicservice 4498 * @since 11 4499 */ 4500 url: string 4501 }) => void): WebAttribute; 4502 4503 /** 4504 * Triggered at the begin of web page loading. 4505 * 4506 * @param { function } callback The triggered function at the begin of web page loading. 4507 * @returns { WebAttribute } 4508 * @syscap SystemCapability.Web.Webview.Core 4509 * @since 8 4510 */ 4511 /** 4512 * Triggered at the begin of web page loading. 4513 * 4514 * @param { function } callback The triggered function at the begin of web page loading. 4515 * @returns { WebAttribute } 4516 * @syscap SystemCapability.Web.Webview.Core 4517 * @crossplatform 4518 * @since 10 4519 */ 4520 /** 4521 * Triggered at the begin of web page loading. 4522 * 4523 * @param { function } callback The triggered function at the begin of web page loading. 4524 * @returns { WebAttribute } 4525 * @syscap SystemCapability.Web.Webview.Core 4526 * @crossplatform 4527 * @atomicservice 4528 * @since 11 4529 */ 4530 onPageBegin(callback: (event?: { 4531 /** 4532 * The url of page. 4533 * 4534 * @syscap SystemCapability.Web.Webview.Core 4535 * @crossplatform 4536 * @since 10 4537 */ 4538 /** 4539 * The url of page. 4540 * 4541 * @syscap SystemCapability.Web.Webview.Core 4542 * @crossplatform 4543 * @atomicservice 4544 * @since 11 4545 */ 4546 url: string 4547 }) => void): WebAttribute; 4548 4549 /** 4550 * Triggered when the page loading progress changes. 4551 * 4552 * @param { function } callback The triggered function when the page loading progress changes. 4553 * @returns { WebAttribute } 4554 * @syscap SystemCapability.Web.Webview.Core 4555 * @since 8 4556 */ 4557 /** 4558 * Triggered when the page loading progress changes. 4559 * 4560 * @param { function } callback The triggered function when the page loading progress changes. 4561 * @returns { WebAttribute } 4562 * @syscap SystemCapability.Web.Webview.Core 4563 * @crossplatform 4564 * @atomicservice 4565 * @since 11 4566 */ 4567 onProgressChange(callback: (event?: { 4568 /** 4569 * The new progress of the page. 4570 * 4571 * @syscap SystemCapability.Web.Webview.Core 4572 * @crossplatform 4573 * @atomicservice 4574 * @since 11 4575 */ 4576 newProgress: number 4577 }) => void): WebAttribute; 4578 4579 /** 4580 * Triggered when the title of the main application document changes. 4581 * 4582 * @param { function } callback The triggered function when the title of the main application document changes. 4583 * @returns { WebAttribute } 4584 * @syscap SystemCapability.Web.Webview.Core 4585 * @since 8 4586 */ 4587 /** 4588 * Triggered when the title of the main application document changes. 4589 * 4590 * @param { function } callback The triggered function when the title of the main application document changes. 4591 * @returns { WebAttribute } 4592 * @syscap SystemCapability.Web.Webview.Core 4593 * @crossplatform 4594 * @atomicservice 4595 * @since 11 4596 */ 4597 onTitleReceive(callback: (event?: { 4598 /** 4599 * The title of the page. 4600 * 4601 * @syscap SystemCapability.Web.Webview.Core 4602 * @crossplatform 4603 * @atomicservice 4604 * @since 11 4605 */ 4606 title: string 4607 }) => void): WebAttribute; 4608 4609 /** 4610 * Triggered when requesting to hide the geolocation. 4611 * 4612 * @param { function } callback The triggered function when requesting to hide the geolocation permission. 4613 * @returns { WebAttribute } 4614 * @syscap SystemCapability.Web.Webview.Core 4615 * @since 8 4616 */ 4617 /** 4618 * Triggered when requesting to hide the geolocation. 4619 * 4620 * @param { function } callback The triggered function when requesting to hide the geolocation permission. 4621 * @returns { WebAttribute } 4622 * @syscap SystemCapability.Web.Webview.Core 4623 * @crossplatform 4624 * @atomicservice 4625 * @since 11 4626 */ 4627 onGeolocationHide(callback: () => void): WebAttribute; 4628 4629 /** 4630 * Triggered when requesting to show the geolocation permission. 4631 * 4632 * @param { function } callback The triggered function when requesting to show the geolocation permission. 4633 * @returns { WebAttribute } 4634 * @syscap SystemCapability.Web.Webview.Core 4635 * @since 8 4636 */ 4637 /** 4638 * Triggered when requesting to show the geolocation permission. 4639 * 4640 * @param { function } callback The triggered function when requesting to show the geolocation permission. 4641 * @returns { WebAttribute } 4642 * @syscap SystemCapability.Web.Webview.Core 4643 * @crossplatform 4644 * @atomicservice 4645 * @since 11 4646 */ 4647 onGeolocationShow(callback: (event?: { 4648 /** 4649 * Origin of the page. 4650 * 4651 * @syscap SystemCapability.Web.Webview.Core 4652 * @crossplatform 4653 * @atomicservice 4654 * @since 11 4655 */ 4656 origin: string, 4657 /** 4658 * Defines the js geolocation request. 4659 * 4660 * @syscap SystemCapability.Web.Webview.Core 4661 * @crossplatform 4662 * @atomicservice 4663 * @since 11 4664 */ 4665 geolocation: JsGeolocation 4666 }) => void): WebAttribute; 4667 4668 /** 4669 * Triggered when the Web gets the focus. 4670 * 4671 * @param { function } callback The triggered function when the Web gets the focus. 4672 * @returns { WebAttribute } 4673 * @syscap SystemCapability.Web.Webview.Core 4674 * @since 8 4675 */ 4676 /** 4677 * Triggered when the Web gets the focus. 4678 * 4679 * @param { function } callback The triggered function when the Web gets the focus. 4680 * @returns { WebAttribute } 4681 * @syscap SystemCapability.Web.Webview.Core 4682 * @atomicservice 4683 * @since 11 4684 */ 4685 onRequestSelected(callback: () => void): WebAttribute; 4686 4687 /** 4688 * Triggered when the Web wants to display a JavaScript alert() dialog. 4689 * 4690 * @param { function } callback The triggered function when the web page wants to display a JavaScript alert() dialog. 4691 * @returns { WebAttribute } 4692 * @syscap SystemCapability.Web.Webview.Core 4693 * @since 8 4694 */ 4695 /** 4696 * Triggered when the Web wants to display a JavaScript alert() dialog. 4697 * 4698 * @param { function } callback The triggered function when the web page wants to display a JavaScript alert() dialog. 4699 * @returns { WebAttribute } 4700 * @syscap SystemCapability.Web.Webview.Core 4701 * @crossplatform 4702 * @atomicservice 4703 * @since 11 4704 */ 4705 onAlert(callback: (event?: { 4706 /** 4707 * The url of the page. 4708 * 4709 * @syscap SystemCapability.Web.Webview.Core 4710 * @crossplatform 4711 * @atomicservice 4712 * @since 11 4713 */ 4714 url: string, 4715 /** 4716 * The message of alert dialog. 4717 * 4718 * @syscap SystemCapability.Web.Webview.Core 4719 * @crossplatform 4720 * @atomicservice 4721 * @since 11 4722 */ 4723 message: string, 4724 /** 4725 * Handle the user's JavaScript result. 4726 * 4727 * @syscap SystemCapability.Web.Webview.Core 4728 * @crossplatform 4729 * @atomicservice 4730 * @since 11 4731 */ 4732 result: JsResult 4733 }) => boolean): WebAttribute; 4734 4735 /** 4736 * Triggered when the Web wants to confirm navigation from JavaScript onbeforeunload. 4737 * 4738 * @param { function } callback The triggered function when the web page wants to confirm navigation from JavaScript onbeforeunload. 4739 * @returns { WebAttribute } 4740 * @syscap SystemCapability.Web.Webview.Core 4741 * @since 8 4742 */ 4743 /** 4744 * Triggered when the Web wants to confirm navigation from JavaScript onbeforeunload. 4745 * 4746 * @param { function } callback The triggered function when the web page wants to confirm navigation from JavaScript onbeforeunload. 4747 * @returns { WebAttribute } 4748 * @syscap SystemCapability.Web.Webview.Core 4749 * @atomicservice 4750 * @since 11 4751 */ 4752 onBeforeUnload(callback: (event?: { 4753 /** 4754 * The url of the page. 4755 * 4756 * @syscap SystemCapability.Web.Webview.Core 4757 * @atomicservice 4758 * @since 11 4759 */ 4760 url: string, 4761 /** 4762 * The message of confirm dialog. 4763 * 4764 * @syscap SystemCapability.Web.Webview.Core 4765 * @atomicservice 4766 * @since 11 4767 */ 4768 message: string, 4769 /** 4770 * Handle the user's JavaScript result. 4771 * 4772 * @syscap SystemCapability.Web.Webview.Core 4773 * @atomicservice 4774 * @since 11 4775 */ 4776 result: JsResult 4777 }) => boolean): WebAttribute; 4778 4779 /** 4780 * Triggered when the web page wants to display a JavaScript confirm() dialog. 4781 * 4782 * @param { function } callback The Triggered function when the web page wants to display a JavaScript confirm() dialog. 4783 * @returns { WebAttribute } 4784 * @syscap SystemCapability.Web.Webview.Core 4785 * @since 8 4786 */ 4787 /** 4788 * Triggered when the web page wants to display a JavaScript confirm() dialog. 4789 * 4790 * @param { function } callback The Triggered function when the web page wants to display a JavaScript confirm() dialog. 4791 * @returns { WebAttribute } 4792 * @syscap SystemCapability.Web.Webview.Core 4793 * @crossplatform 4794 * @atomicservice 4795 * @since 11 4796 */ 4797 onConfirm(callback: (event?: { 4798 /** 4799 * The url of the page. 4800 * 4801 * @syscap SystemCapability.Web.Webview.Core 4802 * @crossplatform 4803 * @atomicservice 4804 * @since 11 4805 */ 4806 url: string, 4807 /** 4808 * The message of confirm dialog. 4809 * 4810 * @syscap SystemCapability.Web.Webview.Core 4811 * @crossplatform 4812 * @atomicservice 4813 * @since 11 4814 */ 4815 message: string, 4816 /** 4817 * Handle the user's JavaScript result. 4818 * 4819 * @syscap SystemCapability.Web.Webview.Core 4820 * @crossplatform 4821 * @atomicservice 4822 * @since 11 4823 */ 4824 result: JsResult 4825 }) => boolean): WebAttribute; 4826 4827 /** 4828 * Triggered when the web page wants to display a JavaScript prompt() dialog. 4829 * 4830 * @param { function } callback The Triggered function when the web page wants to display a JavaScript prompt() dialog. 4831 * @returns { WebAttribute } 4832 * @syscap SystemCapability.Web.Webview.Core 4833 * @since 9 4834 */ 4835 /** 4836 * Triggered when the web page wants to display a JavaScript prompt() dialog. 4837 * 4838 * @param { function } callback The Triggered function when the web page wants to display a JavaScript prompt() dialog. 4839 * @returns { WebAttribute } 4840 * @syscap SystemCapability.Web.Webview.Core 4841 * @crossplatform 4842 * @atomicservice 4843 * @since 11 4844 */ 4845 onPrompt(callback: (event?: { 4846 /** 4847 * The url of the page. 4848 * 4849 * @syscap SystemCapability.Web.Webview.Core 4850 * @crossplatform 4851 * @atomicservice 4852 * @since 11 4853 */ 4854 url: string, 4855 /** 4856 * The message of prompt dialog. 4857 * 4858 * @syscap SystemCapability.Web.Webview.Core 4859 * @crossplatform 4860 * @atomicservice 4861 * @since 11 4862 */ 4863 message: string, 4864 /** 4865 * The value of prompt dialog. 4866 * 4867 * @syscap SystemCapability.Web.Webview.Core 4868 * @crossplatform 4869 * @atomicservice 4870 * @since 11 4871 */ 4872 value: string, 4873 /** 4874 * Handle the user's JavaScript result. 4875 * 4876 * @syscap SystemCapability.Web.Webview.Core 4877 * @crossplatform 4878 * @atomicservice 4879 * @since 11 4880 */ 4881 result: JsResult 4882 }) => boolean): WebAttribute; 4883 4884 /** 4885 * Triggered when the web page receives a JavaScript console message. 4886 * 4887 * @param { function } callback The triggered function when the web page receives a JavaScript console message. 4888 * @returns { WebAttribute } 4889 * @syscap SystemCapability.Web.Webview.Core 4890 * @since 8 4891 */ 4892 /** 4893 * Triggered when the web page receives a JavaScript console message. 4894 * 4895 * @param { function } callback The triggered function when the web page receives a JavaScript console message. 4896 * @returns { WebAttribute } 4897 * @syscap SystemCapability.Web.Webview.Core 4898 * @crossplatform 4899 * @atomicservice 4900 * @since 11 4901 */ 4902 onConsole(callback: (event?: { 4903 /** 4904 * Console message information of the event. 4905 * 4906 * @syscap SystemCapability.Web.Webview.Core 4907 * @crossplatform 4908 * @atomicservice 4909 * @since 11 4910 */ 4911 message: ConsoleMessage 4912 }) => boolean): WebAttribute; 4913 4914 /** 4915 * Triggered when the web page receives a web resource loading error. 4916 * 4917 * @param { function } callback The triggered function when the web page receives a web resource loading error. 4918 * @returns { WebAttribute } 4919 * @syscap SystemCapability.Web.Webview.Core 4920 * @since 8 4921 */ 4922 /** 4923 * Triggered when the web page receives a web resource loading error. 4924 * 4925 * @param { function } callback The triggered function when the web page receives a web resource loading error. 4926 * @returns { WebAttribute } 4927 * @syscap SystemCapability.Web.Webview.Core 4928 * @crossplatform 4929 * @since 10 4930 */ 4931 /** 4932 * Triggered when the web page receives a web resource loading error. 4933 * 4934 * @param { function } callback The triggered function when the web page receives a web resource loading error. 4935 * @returns { WebAttribute } 4936 * @syscap SystemCapability.Web.Webview.Core 4937 * @crossplatform 4938 * @atomicservice 4939 * @since 11 4940 */ 4941 onErrorReceive(callback: (event?: { 4942 /** 4943 * The url of error event. 4944 * 4945 * @syscap SystemCapability.Web.Webview.Core 4946 * @crossplatform 4947 * @since 10 4948 */ 4949 /** 4950 * The url of error event. 4951 * 4952 * @syscap SystemCapability.Web.Webview.Core 4953 * @crossplatform 4954 * @atomicservice 4955 * @since 11 4956 */ 4957 request: WebResourceRequest, 4958 /** 4959 * The information of error event. 4960 * 4961 * @syscap SystemCapability.Web.Webview.Core 4962 * @crossplatform 4963 * @since 10 4964 */ 4965 /** 4966 * The information of error event. 4967 * 4968 * @syscap SystemCapability.Web.Webview.Core 4969 * @crossplatform 4970 * @atomicservice 4971 * @since 11 4972 */ 4973 error: WebResourceError 4974 }) => void): WebAttribute; 4975 4976 /** 4977 * Triggered when the web page receives a web resource loading HTTP error. 4978 * 4979 * @param { function } callback The triggered function when the web page receives a web resource loading HTTP error. 4980 * @returns { WebAttribute } 4981 * @syscap SystemCapability.Web.Webview.Core 4982 * @since 8 4983 */ 4984 /** 4985 * Triggered when the web page receives a web resource loading HTTP error. 4986 * 4987 * @param { function } callback The triggered function when the web page receives a web resource loading HTTP error. 4988 * @returns { WebAttribute } 4989 * @syscap SystemCapability.Web.Webview.Core 4990 * @crossplatform 4991 * @atomicservice 4992 * @since 11 4993 */ 4994 onHttpErrorReceive(callback: (event?: { 4995 /** 4996 * The url of error event. 4997 * 4998 * @syscap SystemCapability.Web.Webview.Core 4999 * @crossplatform 5000 * @atomicservice 5001 * @since 11 5002 */ 5003 request: WebResourceRequest, 5004 /** 5005 * Web resource response of event. 5006 * 5007 * @syscap SystemCapability.Web.Webview.Core 5008 * @crossplatform 5009 * @atomicservice 5010 * @since 11 5011 */ 5012 response: WebResourceResponse 5013 }) => void): WebAttribute; 5014 5015 /** 5016 * Triggered when starting to download. 5017 * 5018 * @param { function } callback The triggered function when starting to download. 5019 * @returns { WebAttribute } 5020 * @syscap SystemCapability.Web.Webview.Core 5021 * @since 8 5022 */ 5023 /** 5024 * Triggered when starting to download. 5025 * 5026 * @param { function } callback The triggered function when starting to download. 5027 * @returns { WebAttribute } 5028 * @syscap SystemCapability.Web.Webview.Core 5029 * @crossplatform 5030 * @atomicservice 5031 * @since 11 5032 */ 5033 onDownloadStart(callback: (event?: { 5034 /** 5035 * The URL of page. 5036 * 5037 * @syscap SystemCapability.Web.Webview.Core 5038 * @crossplatform 5039 * @atomicservice 5040 * @since 11 5041 */ 5042 url: string, 5043 /** 5044 * The userAgent of page. 5045 * 5046 * @syscap SystemCapability.Web.Webview.Core 5047 * @crossplatform 5048 * @atomicservice 5049 * @since 11 5050 */ 5051 userAgent: string, 5052 /** 5053 * The contentDisposition of page. 5054 * 5055 * @syscap SystemCapability.Web.Webview.Core 5056 * @atomicservice 5057 * @since 11 5058 */ 5059 contentDisposition: string, 5060 /** 5061 * The mimetype of page. 5062 * 5063 * @syscap SystemCapability.Web.Webview.Core 5064 * @crossplatform 5065 * @atomicservice 5066 * @since 11 5067 */ 5068 mimetype: string, 5069 /** 5070 * The contentLength of page. 5071 * 5072 * @syscap SystemCapability.Web.Webview.Core 5073 * @crossplatform 5074 * @atomicservice 5075 * @since 11 5076 */ 5077 contentLength: number 5078 }) => void): WebAttribute; 5079 5080 /** 5081 * Triggered when the Web page refreshes accessed history. 5082 * 5083 * @param { function } callback The triggered callback when the Web page refreshes accessed history. 5084 * @returns { WebAttribute } 5085 * @syscap SystemCapability.Web.Webview.Core 5086 * @since 8 5087 */ 5088 /** 5089 * Triggered when the Web page refreshes accessed history. 5090 * 5091 * @param { function } callback The triggered callback when the Web page refreshes accessed history. 5092 * @returns { WebAttribute } 5093 * @syscap SystemCapability.Web.Webview.Core 5094 * @atomicservice 5095 * @since 11 5096 */ 5097 onRefreshAccessedHistory(callback: (event?: { 5098 /** 5099 * URL of the visit. 5100 * 5101 * @syscap SystemCapability.Web.Webview.Core 5102 * @atomicservice 5103 * @since 11 5104 */ 5105 url: string, 5106 /** 5107 * If true, the page is being reloaded, otherwise, means that the page is newly loaded. 5108 * 5109 * @syscap SystemCapability.Web.Webview.Core 5110 * @atomicservice 5111 * @since 11 5112 */ 5113 isRefreshed: boolean 5114 }) => void): WebAttribute; 5115 5116 /** 5117 * Triggered when the URL loading is intercepted. 5118 * 5119 * @param { function } callback The triggered callback when the URL loading is intercepted. 5120 * @returns { WebAttribute } 5121 * @syscap SystemCapability.Web.Webview.Core 5122 * @since 8 5123 * @deprecated since 10 5124 * @useinstead ohos.web.WebAttribute#onLoadIntercept 5125 */ 5126 onUrlLoadIntercept(callback: (event?: { data: string | WebResourceRequest }) => boolean): WebAttribute; 5127 5128 /** 5129 * Triggered when the Web page receives an ssl Error. 5130 * 5131 * @param { function } callback The triggered callback when the Web page receives an ssl Error. 5132 * @returns { WebAttribute } 5133 * @syscap SystemCapability.Web.Webview.Core 5134 * @since 8 5135 * @deprecated since 9 5136 * @useinstead ohos.web.WebAttribute#onSslErrorEventReceive 5137 */ 5138 onSslErrorReceive(callback: (event?: { handler: Function, error: object }) => void): WebAttribute; 5139 5140 /** 5141 * Triggered when the render process exits. 5142 * 5143 * @param { function } callback The triggered when the render process exits. 5144 * @returns { WebAttribute } 5145 * @syscap SystemCapability.Web.Webview.Core 5146 * @since 9 5147 */ 5148 /** 5149 * Triggered when the render process exits. 5150 * 5151 * @param { function } callback The triggered when the render process exits. 5152 * @returns { WebAttribute } 5153 * @syscap SystemCapability.Web.Webview.Core 5154 * @atomicservice 5155 * @since 11 5156 */ 5157 onRenderExited(callback: (event?: { 5158 /** 5159 * The specific reason why the rendering process exits abnormally. 5160 * 5161 * @syscap SystemCapability.Web.Webview.Core 5162 * @atomicservice 5163 * @since 11 5164 */ 5165 renderExitReason: RenderExitReason 5166 }) => void): WebAttribute; 5167 5168 /** 5169 * Triggered when the file selector shows. 5170 * 5171 * @param { function } callback The triggered when the file selector shows. 5172 * @returns { WebAttribute } 5173 * @syscap SystemCapability.Web.Webview.Core 5174 * @since 9 5175 */ 5176 /** 5177 * Triggered when the file selector shows. 5178 * 5179 * @param { function } callback The triggered when the file selector shows. 5180 * @returns { WebAttribute } 5181 * @syscap SystemCapability.Web.Webview.Core 5182 * @crossplatform 5183 * @atomicservice 5184 * @since 11 5185 */ 5186 onShowFileSelector(callback: (event?: { 5187 /** 5188 * Defines the file selector result. 5189 * 5190 * @syscap SystemCapability.Web.Webview.Core 5191 * @crossplatform 5192 * @atomicservice 5193 * @since 11 5194 */ 5195 result: FileSelectorResult, 5196 /** 5197 * Encompassed message information as parameters to fileSelector. 5198 * 5199 * @syscap SystemCapability.Web.Webview.Core 5200 * @crossplatform 5201 * @atomicservice 5202 * @since 11 5203 */ 5204 fileSelector: FileSelectorParam 5205 }) => boolean): WebAttribute; 5206 5207 /** 5208 * Triggered when the render process exits. 5209 * 5210 * @param { function } callback The triggered when the render process exits. 5211 * @returns { WebAttribute } 5212 * @syscap SystemCapability.Web.Webview.Core 5213 * @since 8 5214 * @deprecated since 9 5215 * @useinstead ohos.web.WebAttribute#onRenderExited 5216 */ 5217 onRenderExited(callback: (event?: { detail: object }) => boolean): WebAttribute; 5218 5219 /** 5220 * Triggered when the file selector shows. 5221 * 5222 * @param { function } callback The triggered when the file selector shows. 5223 * @returns { WebAttribute } 5224 * @syscap SystemCapability.Web.Webview.Core 5225 * @since 8 5226 * @deprecated since 9 5227 * @useinstead ohos.web.WebAttribute#onShowFileSelector 5228 */ 5229 onFileSelectorShow(callback: (event?: { callback: Function, fileSelector: object }) => void): WebAttribute; 5230 5231 /** 5232 * Triggered when the url loading. 5233 * 5234 * @param { function } callback The triggered when the url loading. 5235 * @returns { WebAttribute } 5236 * @syscap SystemCapability.Web.Webview.Core 5237 * @since 9 5238 */ 5239 /** 5240 * Triggered when the url loading. 5241 * 5242 * @param { function } callback The triggered when the url loading. 5243 * @returns { WebAttribute } 5244 * @syscap SystemCapability.Web.Webview.Core 5245 * @atomicservice 5246 * @since 11 5247 */ 5248 onResourceLoad(callback: (event: { 5249 /** 5250 * The URL of the loaded resource file. 5251 * 5252 * @syscap SystemCapability.Web.Webview.Core 5253 * @atomicservice 5254 * @since 11 5255 */ 5256 url: string 5257 }) => void): WebAttribute; 5258 5259 /** 5260 * Triggered when the web component exit the full screen mode. 5261 * 5262 * @param { function } callback The triggered function when the web component exit the full screen mode. 5263 * @returns { WebAttribute } 5264 * @syscap SystemCapability.Web.Webview.Core 5265 * @since 9 5266 */ 5267 /** 5268 * Triggered when the web component exit the full screen mode. 5269 * 5270 * @param { function } callback The triggered function when the web component exit the full screen mode. 5271 * @returns { WebAttribute } 5272 * @syscap SystemCapability.Web.Webview.Core 5273 * @atomicservice 5274 * @since 11 5275 */ 5276 onFullScreenExit(callback: () => void): WebAttribute; 5277 5278 /** 5279 * Triggered when the web component enter the full screen mode. 5280 * 5281 * @param { function } callback The triggered function when the web component enter the full screen mode. 5282 * @returns { WebAttribute } 5283 * @syscap SystemCapability.Web.Webview.Core 5284 * @since 9 5285 */ 5286 /** 5287 * Triggered when the web component enter the full screen mode. 5288 * 5289 * @param { function } callback The triggered function when the web component enter the full screen mode. 5290 * @returns { WebAttribute } 5291 * @syscap SystemCapability.Web.Webview.Core 5292 * @atomicservice 5293 * @since 11 5294 */ 5295 onFullScreenEnter(callback: (event: { 5296 /** 5297 * A function handle to exit full-screen mode. 5298 * 5299 * @syscap SystemCapability.Web.Webview.Core 5300 * @atomicservice 5301 * @since 11 5302 */ 5303 handler: FullScreenExitHandler 5304 }) => void): WebAttribute; 5305 5306 /** 5307 * Triggered when the scale of WebView changed. 5308 * 5309 * @param { function } callback The triggered when the scale of WebView changed. 5310 * @returns { WebAttribute } 5311 * @syscap SystemCapability.Web.Webview.Core 5312 * @since 9 5313 */ 5314 /** 5315 * Triggered when the scale of WebView changed. 5316 * 5317 * @param { function } callback The triggered when the scale of WebView changed. 5318 * @returns { WebAttribute } 5319 * @syscap SystemCapability.Web.Webview.Core 5320 * @crossplatform 5321 * @atomicservice 5322 * @since 11 5323 */ 5324 onScaleChange(callback: (event: { 5325 /** 5326 * Old scale of the page. 5327 * 5328 * @syscap SystemCapability.Web.Webview.Core 5329 * @crossplatform 5330 * @atomicservice 5331 * @since 11 5332 */ 5333 oldScale: number, 5334 /** 5335 * New scale of the page. 5336 * 5337 * @syscap SystemCapability.Web.Webview.Core 5338 * @crossplatform 5339 * @atomicservice 5340 * @since 11 5341 */ 5342 newScale: number 5343 }) => void): WebAttribute; 5344 5345 /** 5346 * Triggered when the browser needs credentials from the user. 5347 * 5348 * @param { function } callback The triggered when the browser needs credentials from the user. 5349 * @returns { WebAttribute } 5350 * @syscap SystemCapability.Web.Webview.Core 5351 * @since 9 5352 */ 5353 /** 5354 * Triggered when the browser needs credentials from the user. 5355 * 5356 * @param { function } callback The triggered when the browser needs credentials from the user. 5357 * @returns { WebAttribute } 5358 * @syscap SystemCapability.Web.Webview.Core 5359 * @crossplatform 5360 * @atomicservice 5361 * @since 11 5362 */ 5363 onHttpAuthRequest(callback: (event?: { 5364 /** 5365 * Defines the http auth request result. 5366 * 5367 * @syscap SystemCapability.Web.Webview.Core 5368 * @crossplatform 5369 * @atomicservice 5370 * @since 11 5371 */ 5372 handler: HttpAuthHandler, 5373 /** 5374 * Host of the page. 5375 * 5376 * @syscap SystemCapability.Web.Webview.Core 5377 * @crossplatform 5378 * @atomicservice 5379 * @since 11 5380 */ 5381 host: string, 5382 /** 5383 * realm of the page. 5384 * 5385 * @syscap SystemCapability.Web.Webview.Core 5386 * @crossplatform 5387 * @atomicservice 5388 * @since 11 5389 */ 5390 realm: string 5391 }) => boolean): WebAttribute; 5392 5393 /** 5394 * Triggered when the resources loading is intercepted. 5395 * 5396 * @param { function } callback The triggered callback when the resources loading is intercepted. 5397 * @returns { WebAttribute } If the response value is null, the Web will continue to load the resources. Otherwise, the response value will be used 5398 * @syscap SystemCapability.Web.Webview.Core 5399 * @since 9 5400 */ 5401 /** 5402 * Triggered when the resources loading is intercepted. 5403 * 5404 * @param { function } callback The triggered callback when the resources loading is intercepted. 5405 * @returns { WebAttribute } If the response value is null, the Web will continue to load the resources. Otherwise, the response value will be used 5406 * @syscap SystemCapability.Web.Webview.Core 5407 * @atomicservice 5408 * @since 11 5409 */ 5410 onInterceptRequest(callback: (event?: { 5411 /** 5412 * The url of the event. 5413 * 5414 * @syscap SystemCapability.Web.Webview.Core 5415 * @atomicservice 5416 * @since 11 5417 */ 5418 request: WebResourceRequest 5419 }) => WebResourceResponse): WebAttribute; 5420 5421 /** 5422 * Triggered when the host application that web content from the specified origin is attempting to access the resources. 5423 * 5424 * @param { function } callback The triggered callback when the host application that web content from the specified origin is 5425 * attempting to access the resources. 5426 * @returns { WebAttribute } 5427 * @syscap SystemCapability.Web.Webview.Core 5428 * @since 9 5429 */ 5430 /** 5431 * Triggered when the host application that web content from the specified origin is attempting to access the resources. 5432 * 5433 * @param { function } callback The triggered callback when the host application that web content from the specified origin is 5434 * attempting to access the resources. 5435 * @returns { WebAttribute } 5436 * @syscap SystemCapability.Web.Webview.Core 5437 * @crossplatform 5438 * @atomicservice 5439 * @since 11 5440 */ 5441 onPermissionRequest(callback: (event?: { 5442 /** 5443 * Defines the onPermissionRequest callback. 5444 * 5445 * @syscap SystemCapability.Web.Webview.Core 5446 * @crossplatform 5447 * @atomicservice 5448 * @since 11 5449 */ 5450 request: PermissionRequest 5451 }) => void): WebAttribute; 5452 5453 /** 5454 * Triggered when the host application that web content from the specified origin is requesting to capture screen. 5455 * @param { function } callback The triggered callback when the host application that web content from the specified origin is 5456 * requesting to capture screen. 5457 * @returns { WebAttribute } 5458 * @syscap SystemCapability.Web.Webview.Core 5459 * @since 10 5460 */ 5461 /** 5462 * Triggered when the host application that web content from the specified origin is requesting to capture screen. 5463 * @param { function } callback The triggered callback when the host application that web content from the specified origin is 5464 * requesting to capture screen. 5465 * @returns { WebAttribute } 5466 * @syscap SystemCapability.Web.Webview.Core 5467 * @atomicservice 5468 * @since 11 5469 */ 5470 onScreenCaptureRequest(callback: (event?: { 5471 /** 5472 * Notifies the user of the operation behavior of the web component. 5473 * 5474 * @syscap SystemCapability.Web.Webview.Core 5475 * @atomicservice 5476 * @since 11 5477 */ 5478 handler: ScreenCaptureHandler 5479 }) => void): WebAttribute; 5480 5481 /** 5482 * Triggered when called to allow custom display of the context menu. 5483 * 5484 * @param { function } callback The triggered callback when called to allow custom display of the context menu. 5485 * @returns { WebAttribute } If custom display return true.Otherwise, default display return false. 5486 * @syscap SystemCapability.Web.Webview.Core 5487 * @since 9 5488 */ 5489 /** 5490 * Triggered when called to allow custom display of the context menu. 5491 * 5492 * @param { function } callback The triggered callback when called to allow custom display of the context menu. 5493 * @returns { WebAttribute } If custom display return true.Otherwise, default display return false. 5494 * @syscap SystemCapability.Web.Webview.Core 5495 * @atomicservice 5496 * @since 11 5497 */ 5498 onContextMenuShow(callback: (event?: { 5499 /** 5500 * The menu-related parameters. 5501 * 5502 * @syscap SystemCapability.Web.Webview.Core 5503 * @atomicservice 5504 * @since 11 5505 */ 5506 param: WebContextMenuParam, 5507 /** 5508 * The menu corresponding event is passed to the kernel. 5509 * 5510 * @syscap SystemCapability.Web.Webview.Core 5511 * @atomicservice 5512 * @since 11 5513 */ 5514 result: WebContextMenuResult 5515 }) => boolean): WebAttribute; 5516 5517 /** 5518 * Triggered when called to allow custom hide of the context menu. 5519 * 5520 * @param { OnContextMenuHideCallback } callback The triggered function when called to allow custom hide of the context menu. 5521 * @returns { WebAttribute } 5522 * @syscap SystemCapability.Web.Webview.Core 5523 * @atomicservice 5524 * @since 11 5525 */ 5526 onContextMenuHide(callback: OnContextMenuHideCallback): WebAttribute; 5527 5528 /** 5529 * Set whether media playback needs to be triggered by user gestures. 5530 * 5531 * @param { boolean } access True if it needs to be triggered manually by the user else false. 5532 * @returns { WebAttribute } 5533 * @syscap SystemCapability.Web.Webview.Core 5534 * @since 9 5535 */ 5536 /** 5537 * Set whether media playback needs to be triggered by user gestures. 5538 * 5539 * @param { boolean } access True if it needs to be triggered manually by the user else false. 5540 * @returns { WebAttribute } 5541 * @syscap SystemCapability.Web.Webview.Core 5542 * @crossplatform 5543 * @atomicservice 5544 * @since 11 5545 */ 5546 mediaPlayGestureAccess(access: boolean): WebAttribute; 5547 5548 /** 5549 * Notify search result to host application through onSearchResultReceive. 5550 * 5551 * @param { function } callback Function Triggered when the host application call searchAllAsync 5552 * or searchNext api on WebController and the request is valid. 5553 * @returns { WebAttribute } 5554 * @syscap SystemCapability.Web.Webview.Core 5555 * @since 9 5556 */ 5557 /** 5558 * Notify search result to host application through onSearchResultReceive. 5559 * 5560 * @param { function } callback Function Triggered when the host application call searchAllAsync 5561 * or searchNext api on WebController and the request is valid. 5562 * @returns { WebAttribute } 5563 * @syscap SystemCapability.Web.Webview.Core 5564 * @atomicservice 5565 * @since 11 5566 */ 5567 onSearchResultReceive(callback: (event?: { 5568 /** 5569 * The ordinal number of the currently matched lookup item (starting from 0). 5570 * 5571 * @syscap SystemCapability.Web.Webview.Core 5572 * @atomicservice 5573 * @since 11 5574 */ 5575 activeMatchOrdinal: number, 5576 /** 5577 * The number of all matched keywords. 5578 * 5579 * @syscap SystemCapability.Web.Webview.Core 5580 * @atomicservice 5581 * @since 11 5582 */ 5583 numberOfMatches: number, 5584 /** 5585 * Find out whether the operation is completed on the next page. The method may be called back multiple times until isDoneCounting is true. 5586 * 5587 * @syscap SystemCapability.Web.Webview.Core 5588 * @atomicservice 5589 * @since 11 5590 */ 5591 isDoneCounting: boolean 5592 }) => void): WebAttribute; 5593 5594 /** 5595 * Triggered when the scroll bar slides to the specified position. 5596 * 5597 * @param { function } callback Function Triggered when the scroll bar slides to the specified position. 5598 * @returns { WebAttribute } 5599 * @syscap SystemCapability.Web.Webview.Core 5600 * @since 9 5601 */ 5602 /** 5603 * Triggered when the scroll bar slides to the specified position. 5604 * 5605 * @param { function } callback Function Triggered when the scroll bar slides to the specified position. 5606 * @returns { WebAttribute } 5607 * @syscap SystemCapability.Web.Webview.Core 5608 * @crossplatform 5609 * @atomicservice 5610 * @since 11 5611 */ 5612 onScroll(callback: (event: { 5613 /** 5614 * The X offset of the scroll. 5615 * 5616 * @syscap SystemCapability.Web.Webview.Core 5617 * @crossplatform 5618 * @atomicservice 5619 * @since 11 5620 */ 5621 xOffset: number, 5622 /** 5623 * The Y offset of the scroll. 5624 * 5625 * @syscap SystemCapability.Web.Webview.Core 5626 * @crossplatform 5627 * @atomicservice 5628 * @since 11 5629 */ 5630 yOffset: number 5631 }) => void): WebAttribute; 5632 5633 /** 5634 * Triggered when the Web page receives an ssl Error. 5635 * 5636 * @param { function } callback The triggered callback when the Web page receives an ssl Error. 5637 * @returns { WebAttribute } 5638 * @syscap SystemCapability.Web.Webview.Core 5639 * @since 9 5640 */ 5641 /** 5642 * Triggered when the Web page receives an ssl Error. 5643 * 5644 * @param { function } callback The triggered callback when the Web page receives an ssl Error. 5645 * @returns { WebAttribute } 5646 * @syscap SystemCapability.Web.Webview.Core 5647 * @atomicservice 5648 * @since 11 5649 */ 5650 onSslErrorEventReceive(callback: (event: { 5651 /** 5652 * Notifies the user of the operation behavior of the web component. 5653 * 5654 * @syscap SystemCapability.Web.Webview.Core 5655 * @atomicservice 5656 * @since 11 5657 */ 5658 handler: SslErrorHandler, 5659 /** 5660 * Error codes. 5661 * 5662 * @syscap SystemCapability.Web.Webview.Core 5663 * @atomicservice 5664 * @since 11 5665 */ 5666 error: SslError 5667 }) => void): WebAttribute; 5668 5669 /** 5670 * Triggered when the Web page needs ssl client certificate from the user. 5671 * 5672 * @param { function } callback The triggered callback when needs ssl client certificate from the user. 5673 * @returns { WebAttribute } 5674 * @syscap SystemCapability.Web.Webview.Core 5675 * @since 9 5676 */ 5677 /** 5678 * Triggered when the Web page needs ssl client certificate from the user. 5679 * 5680 * @param { function } callback The triggered callback when needs ssl client certificate from the user. 5681 * @returns { WebAttribute } 5682 * @syscap SystemCapability.Web.Webview.Core 5683 * @atomicservice 5684 * @since 11 5685 */ 5686 onClientAuthenticationRequest(callback: (event: { 5687 /** 5688 * Notifies the user of the operation behavior of the web component. 5689 * 5690 * @syscap SystemCapability.Web.Webview.Core 5691 * @atomicservice 5692 * @since 11 5693 */ 5694 handler : ClientAuthenticationHandler, 5695 /** 5696 * The hostname of the requesting certificate server. 5697 * 5698 * @syscap SystemCapability.Web.Webview.Core 5699 * @atomicservice 5700 * @since 11 5701 */ 5702 host : string, 5703 /** 5704 * The port number of the request certificate server. 5705 * 5706 * @syscap SystemCapability.Web.Webview.Core 5707 * @atomicservice 5708 * @since 11 5709 */ 5710 port : number, 5711 /** 5712 * Acceptable asymmetric key types. 5713 * 5714 * @syscap SystemCapability.Web.Webview.Core 5715 * @atomicservice 5716 * @since 11 5717 */ 5718 keyTypes : Array<string>, 5719 /** 5720 * Certificates that match the private key are acceptable to the issuer. 5721 * 5722 * @syscap SystemCapability.Web.Webview.Core 5723 * @atomicservice 5724 * @since 11 5725 */ 5726 issuers : Array<string> 5727 }) => void): WebAttribute; 5728 5729 /** 5730 * Triggered when web page requires the user to create a window. 5731 * 5732 * @param { function } callback The triggered callback when web page requires the user to create a window. 5733 * @returns { WebAttribute } 5734 * @syscap SystemCapability.Web.Webview.Core 5735 * @since 9 5736 */ 5737 /** 5738 * Triggered when web page requires the user to create a window. 5739 * 5740 * @param { function } callback The triggered callback when web page requires the user to create a window. 5741 * @returns { WebAttribute } 5742 * @syscap SystemCapability.Web.Webview.Core 5743 * @atomicservice 5744 * @since 11 5745 */ 5746 onWindowNew(callback: (event: { 5747 /** 5748 * true indicates the request to create a dialog and false indicates a new tab. 5749 * 5750 * @syscap SystemCapability.Web.Webview.Core 5751 * @atomicservice 5752 * @since 11 5753 */ 5754 isAlert: boolean, 5755 /** 5756 * true indicates that it is triggered by the user, and false indicates that it is triggered by a non-user. 5757 * 5758 * @syscap SystemCapability.Web.Webview.Core 5759 * @atomicservice 5760 * @since 11 5761 */ 5762 isUserTrigger: boolean, 5763 /** 5764 * Destination URL. 5765 * 5766 * @syscap SystemCapability.Web.Webview.Core 5767 * @atomicservice 5768 * @since 11 5769 */ 5770 targetUrl: string, 5771 /** 5772 * Lets you set the WebviewController instance for creating a new window. 5773 * 5774 * @syscap SystemCapability.Web.Webview.Core 5775 * @atomicservice 5776 * @since 11 5777 */ 5778 handler: ControllerHandler 5779 }) => void): WebAttribute; 5780 5781 /** 5782 * Triggered when web page requires the user to close a window. 5783 * 5784 * @param { function } callback The triggered callback when web page requires the user to close a window. 5785 * @returns { WebAttribute } 5786 * @syscap SystemCapability.Web.Webview.Core 5787 * @since 9 5788 */ 5789 /** 5790 * Triggered when web page requires the user to close a window. 5791 * 5792 * @param { function } callback The triggered callback when web page requires the user to close a window. 5793 * @returns { WebAttribute } 5794 * @syscap SystemCapability.Web.Webview.Core 5795 * @atomicservice 5796 * @since 11 5797 */ 5798 onWindowExit(callback: () => void): WebAttribute; 5799 5800 /** 5801 * Set whether multiple windows are supported. 5802 * 5803 * @param { boolean } multiWindow True if it needs to be triggered manually by the user else false. 5804 * @returns { WebAttribute } 5805 * @syscap SystemCapability.Web.Webview.Core 5806 * @since 9 5807 */ 5808 /** 5809 * Set whether multiple windows are supported. 5810 * 5811 * @param { boolean } multiWindow True if it needs to be triggered manually by the user else false. 5812 * @returns { WebAttribute } 5813 * @syscap SystemCapability.Web.Webview.Core 5814 * @atomicservice 5815 * @since 11 5816 */ 5817 multiWindowAccess(multiWindow: boolean): WebAttribute; 5818 5819 /** 5820 * Key events notify the application before the WebView consumes them. 5821 * 5822 * @param { function } callback Key event info. 5823 * @returns { WebAttribute } True if the application consumes key events else false. 5824 * @syscap SystemCapability.Web.Webview.Core 5825 * @since 9 5826 */ 5827 /** 5828 * Key events notify the application before the WebView consumes them. 5829 * 5830 * @param { function } callback Key event info. 5831 * @returns { WebAttribute } True if the application consumes key events else false. 5832 * @syscap SystemCapability.Web.Webview.Core 5833 * @atomicservice 5834 * @since 11 5835 */ 5836 onInterceptKeyEvent(callback: (event: KeyEvent) => boolean): WebAttribute; 5837 5838 /** 5839 * Set the font of webview standard font library. The default font is "sans serif". 5840 * 5841 * @param { string } family Standard font set series. 5842 * @returns { WebAttribute } 5843 * @syscap SystemCapability.Web.Webview.Core 5844 * @since 9 5845 */ 5846 /** 5847 * Set the font of webview standard font library. The default font is "sans serif". 5848 * 5849 * @param { string } family Standard font set series. 5850 * @returns { WebAttribute } 5851 * @syscap SystemCapability.Web.Webview.Core 5852 * @atomicservice 5853 * @since 11 5854 */ 5855 webStandardFont(family: string): WebAttribute; 5856 5857 /** 5858 * Set the font of webview serif font library. The default font is "serif". 5859 * 5860 * @param { string } family Serif font set series. 5861 * @returns { WebAttribute } 5862 * @syscap SystemCapability.Web.Webview.Core 5863 * @since 9 5864 */ 5865 /** 5866 * Set the font of webview serif font library. The default font is "serif". 5867 * 5868 * @param { string } family Serif font set series. 5869 * @returns { WebAttribute } 5870 * @syscap SystemCapability.Web.Webview.Core 5871 * @atomicservice 5872 * @since 11 5873 */ 5874 webSerifFont(family: string): WebAttribute; 5875 5876 /** 5877 * Set the font of webview sans serif font library. The default font is "sans-serif". 5878 * 5879 * @param { string } family Sans serif font set series. 5880 * @returns { WebAttribute } 5881 * @syscap SystemCapability.Web.Webview.Core 5882 * @since 9 5883 */ 5884 /** 5885 * Set the font of webview sans serif font library. The default font is "sans-serif". 5886 * 5887 * @param { string } family Sans serif font set series. 5888 * @returns { WebAttribute } 5889 * @syscap SystemCapability.Web.Webview.Core 5890 * @atomicservice 5891 * @since 11 5892 */ 5893 webSansSerifFont(family: string): WebAttribute; 5894 5895 /** 5896 * Set the font of webview fixed font library. The default font is "monospace". 5897 * 5898 * @param { string } family Fixed font set series. 5899 * @returns { WebAttribute } 5900 * @syscap SystemCapability.Web.Webview.Core 5901 * @since 9 5902 */ 5903 /** 5904 * Set the font of webview fixed font library. The default font is "monospace". 5905 * 5906 * @param { string } family Fixed font set series. 5907 * @returns { WebAttribute } 5908 * @syscap SystemCapability.Web.Webview.Core 5909 * @atomicservice 5910 * @since 11 5911 */ 5912 webFixedFont(family: string): WebAttribute; 5913 5914 /** 5915 * Set the font of webview fantasy font library. The default font is "fantasy". 5916 * 5917 * @param { string } family fantasy font set series. 5918 * @returns { WebAttribute } 5919 * @syscap SystemCapability.Web.Webview.Core 5920 * @since 9 5921 */ 5922 /** 5923 * Set the font of webview fantasy font library. The default font is "fantasy". 5924 * 5925 * @param { string } family fantasy font set series. 5926 * @returns { WebAttribute } 5927 * @syscap SystemCapability.Web.Webview.Core 5928 * @atomicservice 5929 * @since 11 5930 */ 5931 webFantasyFont(family: string): WebAttribute; 5932 5933 /** 5934 * Set the font of webview cursive font library. The default font is "cursive". 5935 * 5936 * @param { string } family Cursive font set series. 5937 * @returns { WebAttribute } 5938 * @syscap SystemCapability.Web.Webview.Core 5939 * @since 9 5940 */ 5941 /** 5942 * Set the font of webview cursive font library. The default font is "cursive". 5943 * 5944 * @param { string } family Cursive font set series. 5945 * @returns { WebAttribute } 5946 * @syscap SystemCapability.Web.Webview.Core 5947 * @atomicservice 5948 * @since 11 5949 */ 5950 webCursiveFont(family: string): WebAttribute; 5951 5952 /** 5953 * Set the default fixed font value of webview. The default value is 13, ranging from 1 to 72. 5954 * 5955 * @param { number } size Font size. 5956 * @returns { WebAttribute } 5957 * @syscap SystemCapability.Web.Webview.Core 5958 * @since 9 5959 */ 5960 /** 5961 * Set the default fixed font value of webview. The default value is 13, ranging from 1 to 72. 5962 * 5963 * @param { number } size Font size. 5964 * @returns { WebAttribute } 5965 * @syscap SystemCapability.Web.Webview.Core 5966 * @atomicservice 5967 * @since 11 5968 */ 5969 defaultFixedFontSize(size: number): WebAttribute; 5970 5971 /** 5972 * Set the default font value of webview. The default value is 16, ranging from 1 to 72. 5973 * 5974 * @param { number } size Font size. 5975 * @returns { WebAttribute } 5976 * @syscap SystemCapability.Web.Webview.Core 5977 * @since 9 5978 */ 5979 /** 5980 * Set the default font value of webview. The default value is 16, ranging from 1 to 72. 5981 * 5982 * @param { number } size Font size. 5983 * @returns { WebAttribute } 5984 * @syscap SystemCapability.Web.Webview.Core 5985 * @atomicservice 5986 * @since 11 5987 */ 5988 defaultFontSize(size: number): WebAttribute; 5989 5990 /** 5991 * Set the minimum value of webview font. The default value is 8, ranging from 1 to 72. 5992 * 5993 * @param { number } size Font size. 5994 * @returns { WebAttribute } 5995 * @syscap SystemCapability.Web.Webview.Core 5996 * @since 9 5997 */ 5998 /** 5999 * Set the minimum value of webview font. The default value is 8, ranging from 1 to 72. 6000 * 6001 * @param { number } size Font size. 6002 * @returns { WebAttribute } 6003 * @syscap SystemCapability.Web.Webview.Core 6004 * @crossplatform 6005 * @atomicservice 6006 * @since 11 6007 */ 6008 minFontSize(size: number): WebAttribute; 6009 6010 /** 6011 * Set the logical minimum value of webview font. The default value is 8, ranging from 1 to 72. 6012 * 6013 * @param { number } size Font size. 6014 * @returns { WebAttribute } 6015 * @syscap SystemCapability.Web.Webview.Core 6016 * @since 9 6017 */ 6018 /** 6019 * Set the logical minimum value of webview font. The default value is 8, ranging from 1 to 72. 6020 * 6021 * @param { number } size Font size. 6022 * @returns { WebAttribute } 6023 * @syscap SystemCapability.Web.Webview.Core 6024 * @atomicservice 6025 * @since 11 6026 */ 6027 minLogicalFontSize(size: number): WebAttribute; 6028 6029 /** 6030 * Whether web component can load resource from network. 6031 * 6032 * @param { boolean } block {@code true} means it can't load resource from network; {@code false} otherwise. 6033 * @returns { WebAttribute } 6034 * @syscap SystemCapability.Web.Webview.Core 6035 * @since 9 6036 */ 6037 /** 6038 * Whether web component can load resource from network. 6039 * 6040 * @param { boolean } block {@code true} means it can't load resource from network; {@code false} otherwise. 6041 * @returns { WebAttribute } 6042 * @syscap SystemCapability.Web.Webview.Core 6043 * @atomicservice 6044 * @since 11 6045 */ 6046 blockNetwork(block: boolean): WebAttribute; 6047 6048 /** 6049 * Set whether paint horizontal scroll bar. 6050 * 6051 * @param { boolean } horizontalScrollBar True if it needs to paint horizontal scroll bar. 6052 * @returns { WebAttribute } 6053 * @syscap SystemCapability.Web.Webview.Core 6054 * @since 9 6055 */ 6056 /** 6057 * Set whether paint horizontal scroll bar. 6058 * 6059 * @param { boolean } horizontalScrollBar True if it needs to paint horizontal scroll bar. 6060 * @returns { WebAttribute } 6061 * @syscap SystemCapability.Web.Webview.Core 6062 * @crossplatform 6063 * @atomicservice 6064 * @since 11 6065 */ 6066 horizontalScrollBarAccess(horizontalScrollBar: boolean): WebAttribute; 6067 6068 /** 6069 * Set whether paint vertical scroll bar. 6070 * 6071 * @param { boolean } verticalScrollBar True if it needs to paint vertical scroll bar. 6072 * @returns { WebAttribute } 6073 * @syscap SystemCapability.Web.Webview.Core 6074 * @since 9 6075 */ 6076 /** 6077 * Set whether paint vertical scroll bar. 6078 * 6079 * @param { boolean } verticalScrollBar True if it needs to paint vertical scroll bar. 6080 * @returns { WebAttribute } 6081 * @syscap SystemCapability.Web.Webview.Core 6082 * @crossplatform 6083 * @atomicservice 6084 * @since 11 6085 */ 6086 verticalScrollBarAccess(verticalScrollBar: boolean): WebAttribute; 6087 6088 /** 6089 * Triggered when the application receive the url of an apple-touch-icon. 6090 * 6091 * @param { function } callback The triggered callback when the application receive an new url of an 6092 * apple-touch-icon. 6093 * @returns { WebAttribute } 6094 * @syscap SystemCapability.Web.Webview.Core 6095 * @since 9 6096 */ 6097 /** 6098 * Triggered when the application receive the url of an apple-touch-icon. 6099 * 6100 * @param { function } callback The triggered callback when the application receive an new url of an 6101 * apple-touch-icon. 6102 * @returns { WebAttribute } 6103 * @syscap SystemCapability.Web.Webview.Core 6104 * @atomicservice 6105 * @since 11 6106 */ 6107 onTouchIconUrlReceived(callback: (event: { 6108 /** 6109 * The apple-touch-icon URL address received. 6110 * 6111 * @syscap SystemCapability.Web.Webview.Core 6112 * @atomicservice 6113 * @since 11 6114 */ 6115 url: string, 6116 /** 6117 * Corresponding to whether apple-touch-icon is precomposited. 6118 * 6119 * @syscap SystemCapability.Web.Webview.Core 6120 * @atomicservice 6121 * @since 11 6122 */ 6123 precomposed: boolean 6124 }) => void): WebAttribute; 6125 6126 /** 6127 * Triggered when the application receive a new favicon for the current web page. 6128 * 6129 * @param { function } callback The triggered callback when the application receive a new favicon for the 6130 * current web page. 6131 * @returns { WebAttribute } 6132 * @syscap SystemCapability.Web.Webview.Core 6133 * @since 9 6134 */ 6135 /** 6136 * Triggered when the application receive a new favicon for the current web page. 6137 * 6138 * @param { function } callback The triggered callback when the application receive a new favicon for the 6139 * current web page. 6140 * @returns { WebAttribute } 6141 * @syscap SystemCapability.Web.Webview.Core 6142 * @atomicservice 6143 * @since 11 6144 */ 6145 onFaviconReceived(callback: (event: { 6146 /** 6147 * Received the Favicon icon for the PixelMap object. 6148 * 6149 * @syscap SystemCapability.Web.Webview.Core 6150 * @atomicservice 6151 * @since 11 6152 */ 6153 favicon: PixelMap 6154 }) => void): WebAttribute; 6155 6156 /** 6157 * Triggered when previous page will no longer be drawn and next page begin to draw. 6158 * 6159 * @param { function } callback The triggered callback when previous page will no longer be drawn and next 6160 * page begin to draw. 6161 * @returns { WebAttribute } 6162 * @syscap SystemCapability.Web.Webview.Core 6163 * @since 9 6164 */ 6165 /** 6166 * Triggered when previous page will no longer be drawn and next page begin to draw. 6167 * 6168 * @param { function } callback The triggered callback when previous page will no longer be drawn and next 6169 * page begin to draw. 6170 * @returns { WebAttribute } 6171 * @syscap SystemCapability.Web.Webview.Core 6172 * @crossplatform 6173 * @atomicservice 6174 * @since 11 6175 */ 6176 onPageVisible(callback: (event: { 6177 /** 6178 * The URL of page. 6179 * 6180 * @syscap SystemCapability.Web.Webview.Core 6181 * @crossplatform 6182 * @atomicservice 6183 * @since 11 6184 */ 6185 url: string 6186 }) => void): WebAttribute; 6187 6188 /** 6189 * Triggered when the form could be resubmitted. 6190 * 6191 * @param { function } callback The triggered callback to decision whether resend form data or not. 6192 * @returns { WebAttribute } 6193 * @syscap SystemCapability.Web.Webview.Core 6194 * @since 9 6195 */ 6196 /** 6197 * Triggered when the form could be resubmitted. 6198 * 6199 * @param { function } callback The triggered callback to decision whether resend form data or not. 6200 * @returns { WebAttribute } 6201 * @syscap SystemCapability.Web.Webview.Core 6202 * @atomicservice 6203 * @since 11 6204 */ 6205 onDataResubmitted(callback: (event: { 6206 /** 6207 * Form data resubmission handle. 6208 * 6209 * @syscap SystemCapability.Web.Webview.Core 6210 * @atomicservice 6211 * @since 11 6212 */ 6213 handler: DataResubmissionHandler 6214 }) => void): WebAttribute; 6215 6216 /** 6217 * Set whether enable pinch smooth mode. 6218 * 6219 * @param { boolean } isEnabled True if it needs to enable smooth mode. 6220 * @returns { WebAttribute } 6221 * @syscap SystemCapability.Web.Webview.Core 6222 * @since 9 6223 */ 6224 /** 6225 * Set whether enable pinch smooth mode. 6226 * 6227 * @param { boolean } isEnabled True if it needs to enable smooth mode. 6228 * @returns { WebAttribute } 6229 * @syscap SystemCapability.Web.Webview.Core 6230 * @atomicservice 6231 * @since 11 6232 */ 6233 pinchSmooth(isEnabled: boolean): WebAttribute; 6234 6235 /** 6236 * Whether the window can be open automatically through JavaScript. 6237 * 6238 * @param { boolean } flag If it is true, the window can be opened automatically through JavaScript. 6239 * If it is false and user behavior, the window can be opened automatically through JavaScript. 6240 * Otherwise, the window cannot be opened. 6241 * @returns { WebAttribute } 6242 * @syscap SystemCapability.Web.Webview.Core 6243 * @since 10 6244 */ 6245 /** 6246 * Whether the window can be open automatically through JavaScript. 6247 * 6248 * @param { boolean } flag If it is true, the window can be opened automatically through JavaScript. 6249 * If it is false and user behavior, the window can be opened automatically through JavaScript. 6250 * Otherwise, the window cannot be opened. 6251 * @returns { WebAttribute } 6252 * @syscap SystemCapability.Web.Webview.Core 6253 * @atomicservice 6254 * @since 11 6255 */ 6256 allowWindowOpenMethod(flag: boolean): WebAttribute; 6257 6258 /** 6259 * Triggered when the playing state of audio on web page changed. 6260 * 6261 * @param { function } callback The playing state of audio on web page. 6262 * @returns { WebAttribute } 6263 * @syscap SystemCapability.Web.Webview.Core 6264 * @since 10 6265 */ 6266 /** 6267 * Triggered when the playing state of audio on web page changed. 6268 * 6269 * @param { function } callback The playing state of audio on web page. 6270 * @returns { WebAttribute } 6271 * @syscap SystemCapability.Web.Webview.Core 6272 * @atomicservice 6273 * @since 11 6274 */ 6275 onAudioStateChanged(callback: (event: { 6276 /** 6277 * The audio playback status of the current page, true if playing true otherwise false 6278 * 6279 * @syscap SystemCapability.Web.Webview.Core 6280 * @atomicservice 6281 * @since 11 6282 */ 6283 playing: boolean 6284 }) => void): WebAttribute; 6285 6286 /** 6287 * Triggered when the first content rendering of web page. 6288 * 6289 * @param { function } callback 6290 * @returns { WebAttribute } 6291 * @syscap SystemCapability.Web.Webview.Core 6292 * @since 10 6293 */ 6294 /** 6295 * Triggered when the first content rendering of web page. 6296 * 6297 * @param { function } callback 6298 * @returns { WebAttribute } 6299 * @syscap SystemCapability.Web.Webview.Core 6300 * @atomicservice 6301 * @since 11 6302 */ 6303 onFirstContentfulPaint(callback: (event?: { 6304 /** 6305 * The time at which navigation begins, expressed in microseconds. 6306 * 6307 * @syscap SystemCapability.Web.Webview.Core 6308 * @atomicservice 6309 * @since 11 6310 */ 6311 navigationStartTick: number, 6312 /** 6313 * The time it takes to draw content for the first time from navigation, expressed in milliseconds. 6314 * 6315 * @syscap SystemCapability.Web.Webview.Core 6316 * @atomicservice 6317 * @since 11 6318 */ 6319 firstContentfulPaintMs: number 6320 }) => void): WebAttribute; 6321 6322 /** 6323 * Triggered when the resources loading is intercepted. 6324 * 6325 * @param { function } callback The triggered callback when the resources loading is intercepted. 6326 * @returns { WebAttribute } 6327 * @syscap SystemCapability.Web.Webview.Core 6328 * @since 10 6329 */ 6330 /** 6331 * Triggered when the resources loading is intercepted. 6332 * 6333 * @param { function } callback The triggered callback when the resources loading is intercepted. 6334 * @returns { WebAttribute } 6335 * @syscap SystemCapability.Web.Webview.Core 6336 * @crossplatform 6337 * @atomicservice 6338 * @since 11 6339 */ 6340 onLoadIntercept(callback: (event: { 6341 /** 6342 * The url of the event. 6343 * 6344 * @syscap SystemCapability.Web.Webview.Core 6345 * @crossplatform 6346 * @atomicservice 6347 * @since 11 6348 */ 6349 data: WebResourceRequest 6350 }) => boolean): WebAttribute; 6351 6352 /** 6353 * Triggered when The controller is bound to the web component, this controller must be a WebviewController. 6354 * This callback can not use the interface about manipulating web pages. 6355 * @param { function } callback The triggered callback when web controller initialization success. 6356 * @returns { WebAttribute } 6357 * @syscap SystemCapability.Web.Webview.Core 6358 * @since 10 6359 */ 6360 /** 6361 * Triggered when The controller is bound to the web component, this controller must be a WebviewController. 6362 * This callback can not use the interface about manipulating web pages. 6363 * @param { function } callback The triggered callback when web controller initialization success. 6364 * @returns { WebAttribute } 6365 * @syscap SystemCapability.Web.Webview.Core 6366 * @crossplatform 6367 * @atomicservice 6368 * @since 11 6369 */ 6370 onControllerAttached(callback: () => void): WebAttribute; 6371 6372 /** 6373 * Triggered when the over scrolling. 6374 * @param { function } callback Function Triggered when the over scrolling. 6375 * @returns { WebAttribute } 6376 * @syscap SystemCapability.Web.Webview.Core 6377 * @since 10 6378 */ 6379 /** 6380 * Triggered when the over scrolling. 6381 * @param { function } callback Function Triggered when the over scrolling. 6382 * @returns { WebAttribute } 6383 * @syscap SystemCapability.Web.Webview.Core 6384 * @atomicservice 6385 * @since 11 6386 */ 6387 onOverScroll(callback: (event: { 6388 /** 6389 * Based on the leftmost part of the page, the horizontal scroll offset is over. 6390 * 6391 * @syscap SystemCapability.Web.Webview.Core 6392 * @atomicservice 6393 * @since 11 6394 */ 6395 xOffset: number, 6396 /** 6397 * Based on the top of the page, the vertical scroll offset is over. 6398 * 6399 * @syscap SystemCapability.Web.Webview.Core 6400 * @atomicservice 6401 * @since 11 6402 */ 6403 yOffset: number 6404 }) => void): WebAttribute; 6405 6406 /** 6407 * Called when received website security risk check result. 6408 * 6409 * @param { OnSafeBrowsingCheckResultCallback } callback - Function triggered when received website security risk check result. 6410 * @returns { WebAttribute } 6411 * @syscap SystemCapability.Web.Webview.Core 6412 * @atomicservice 6413 * @since 11 6414 */ 6415 onSafeBrowsingCheckResult(callback: OnSafeBrowsingCheckResultCallback): WebAttribute; 6416 6417 /** 6418 * Called when the load committed. 6419 * 6420 * @param { OnNavigationEntryCommittedCallback } callback Function Triggered when a load committed. 6421 * @returns { WebAttribute } 6422 * @syscap SystemCapability.Web.Webview.Core 6423 * @atomicservice 6424 * @since 11 6425 */ 6426 onNavigationEntryCommitted(callback: OnNavigationEntryCommittedCallback): WebAttribute; 6427 6428 /** 6429 * Injects the JavaScripts before Webview creates the DOM tree, and then the JavaScript snippet will run after the document has been created. 6430 * @param { Array<ScriptItem> } scripts - The array of the JavaScripts to be injected. 6431 * @returns { WebAttribute } 6432 * @syscap SystemCapability.Web.Webview.Core 6433 * @atomicservice 6434 * @since 11 6435 */ 6436 javaScriptOnDocumentStart(scripts: Array<ScriptItem>): WebAttribute; 6437 6438 /** 6439 * Injects the JavaScripts before Webview creates the DOM tree, and then the JavaScript snippet will run after the document has been created. 6440 * @param { Array<ScriptItem> } scripts - The array of the JavaScripts to be injected. 6441 * @returns { WebAttribute } 6442 * @syscap SystemCapability.Web.Webview.Core 6443 * @atomicservice 6444 * @since 11 6445 */ 6446 javaScriptOnDocumentEnd(scripts: Array<ScriptItem>): WebAttribute; 6447 6448 /** 6449 * Set web layout Mode. 6450 * @param { WebLayoutMode } mode - The web layout mode, which can be {@link WebLayoutMode}. 6451 * @returns { WebAttribute } 6452 * @syscap SystemCapability.Web.Webview.Core 6453 * @atomicservice 6454 * @since 11 6455 */ 6456 layoutMode(mode: WebLayoutMode): WebAttribute; 6457 6458 /** 6459 * Called to setting the nested scroll options. 6460 * 6461 * @param { NestedScrollOptions } value - options for nested scrolling. 6462 * @returns { WebAttribute } the attribute of the scroll. 6463 * @syscap SystemCapability.Web.Webview.Core 6464 * @atomicservice 6465 * @since 11 6466 */ 6467 nestedScroll(value: NestedScrollOptions): WebAttribute; 6468 6469 /** 6470 * Sets the enable native embed mode for web. 6471 * 6472 * @param { boolean } mode - True if it needs to enable native embed mode. 6473 * @returns { WebAttribute } 6474 * @syscap SystemCapability.Web.Webview.Core 6475 * @atomicservice 6476 * @since 11 6477 */ 6478 enableNativeEmbedMode(mode: boolean): WebAttribute; 6479 6480 /** 6481 * Triggered when embed lifecycle changes. 6482 * 6483 * @param { function } callback - Function Triggered when embed lifecycle changes. 6484 * @returns { WebAttribute } 6485 * @syscap SystemCapability.Web.Webview.Core 6486 * @atomicservice 6487 * @since 11 6488 */ 6489 onNativeEmbedLifecycleChange(callback: (event: NativeEmbedDataInfo) => void): WebAttribute; 6490 6491 /** 6492 * Triggered when gesture effect on embed tag. 6493 * 6494 * @param { function } callback - Function Triggered when gesture effect on embed tag. 6495 * @returns { WebAttribute } 6496 * @syscap SystemCapability.Web.Webview.Core 6497 * @atomicservice 6498 * @since 11 6499 */ 6500 onNativeEmbedGestureEvent(callback: (event: NativeEmbedTouchInfo) => void): WebAttribute; 6501 6502 /** 6503 * Called to set copy option 6504 * 6505 * @param { CopyOptions } value - copy option. 6506 * @returns { WebAttribute } the attribute of the scroll. 6507 * @syscap SystemCapability.Web.Webview.Core 6508 * @atomicservice 6509 * @since 11 6510 */ 6511 copyOptions(value: CopyOptions): WebAttribute; 6512} 6513 6514/** 6515 * Defines Web Component. 6516 * 6517 * @syscap SystemCapability.Web.Webview.Core 6518 * @atomicservice 6519 * @since 8 6520 */ 6521/** 6522 * Defines Web Component. 6523 * 6524 * @syscap SystemCapability.Web.Webview.Core 6525 * @crossplatform 6526 * @since 10 6527 */ 6528/** 6529 * Defines Web Component. 6530 * 6531 * @syscap SystemCapability.Web.Webview.Core 6532 * @crossplatform 6533 * @atomicservice 6534 * @since 11 6535 */ 6536declare const Web: WebInterface; 6537 6538/** 6539 * Defines Web Component instance. 6540 * 6541 * @syscap SystemCapability.Web.Webview.Core 6542 * @since 8 6543 */ 6544/** 6545 * Defines Web Component instance. 6546 * 6547 * @syscap SystemCapability.Web.Webview.Core 6548 * @atomicservice 6549 * @since 11 6550 */ 6551declare const WebInstance: WebAttribute; 6552