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 * @file 18 * @kit ArkWeb 19 */ 20 21/** 22 * Provides methods for controlling the web controller. 23 * 24 * @syscap SystemCapability.Web.Webview.Core 25 * @since 9 26 */ 27/** 28 * Provides methods for controlling the web controller. 29 * 30 * @syscap SystemCapability.Web.Webview.Core 31 * @crossplatform 32 * @since 10 33 */ 34/** 35 * Provides methods for controlling the web controller. 36 * 37 * @typedef { import('../api/@ohos.web.webview').default.WebviewController } 38 * @syscap SystemCapability.Web.Webview.Core 39 * @crossplatform 40 * @atomicservice 41 * @since 11 42 */ 43declare type WebviewController = import('../api/@ohos.web.webview').default.WebviewController; 44 45/** 46 * The callback of load committed. 47 * 48 * @typedef { function } OnNavigationEntryCommittedCallback 49 * @param { LoadCommittedDetails } loadCommittedDetails - callback information of onNavigationEntryCommitted. 50 * @syscap SystemCapability.Web.Webview.Core 51 * @atomicservice 52 * @since 11 53 */ 54type OnNavigationEntryCommittedCallback = (loadCommittedDetails: LoadCommittedDetails) => void; 55 56/** 57 * The callback of ssl error event. 58 * 59 * @typedef { function } OnSslErrorEventCallback 60 * @param { SslErrorEvent } sslErrorEvent - callback information of onSslErrorEvent. 61 * @syscap SystemCapability.Web.Webview.Core 62 * @atomicservice 63 * @since 12 64 */ 65type OnSslErrorEventCallback = (sslErrorEvent: SslErrorEvent) => void; 66 67/** 68 * The callback of largestContentfulPaint. 69 * 70 * @typedef { function } OnLargestContentfulPaintCallback 71 * @param { LargestContentfulPaint } largestContentfulPaint - callback information of onLargestContentfulPaint. 72 * @syscap SystemCapability.Web.Webview.Core 73 * @atomicservice 74 * @since 12 75 */ 76type OnLargestContentfulPaintCallback = (largestContentfulPaint: LargestContentfulPaint) => void; 77 78/** 79 * The callback of firstMeaningfulPaint. 80 * 81 * @typedef { function } OnFirstMeaningfulPaintCallback 82 * @param { FirstMeaningfulPaint } firstMeaningfulPaint - callback information of onFirstMeaningfulPaint. 83 * @syscap SystemCapability.Web.Webview.Core 84 * @atomicservice 85 * @since 12 86 */ 87type OnFirstMeaningfulPaintCallback = (firstMeaningfulPaint: FirstMeaningfulPaint) => void; 88 89/** 90 * The callback of onOverrideUrlLoading. 91 * Should not call WebviewController.loadUrl with the request's URL and then return true. 92 * 93 * @typedef { function } OnOverrideUrlLoadingCallback 94 * @param { WebResourceRequest } webResourceRequest - callback information of onOverrideUrlLoading. 95 * @returns { boolean } - Returning true causes the current Web to abort loading the URL, 96 * false causes the Web to continue loading the url as usual. 97 * @syscap SystemCapability.Web.Webview.Core 98 * @atomicservice 99 * @since 12 100 */ 101type OnOverrideUrlLoadingCallback = (webResourceRequest: WebResourceRequest) => boolean; 102 103/** 104 * The callback of Intelligent Tracking Prevention. 105 * 106 * @typedef { function } OnIntelligentTrackingPreventionCallback 107 * @param { IntelligentTrackingPreventionDetails } details - callback information of onIntelligentTrackingPrevention. 108 * @syscap SystemCapability.Web.Webview.Core 109 * @atomicservice 110 * @since 12 111 */ 112type OnIntelligentTrackingPreventionCallback = (details: IntelligentTrackingPreventionDetails) => void; 113 114/** 115 * The callback of onNativeEmbedVisibilityChange. 116 * 117 * @typedef { function } OnNativeEmbedVisibilityChangeCallback 118 * @param { NativeEmbedVisibilityInfo } nativeEmbedVisibilityInfo - callback information of onNativeEmbedVisibilityChange. 119 * @syscap SystemCapability.Web.Webview.Core 120 * @since 12 121 */ 122type OnNativeEmbedVisibilityChangeCallback = (nativeEmbedVisibilityInfo: NativeEmbedVisibilityInfo) => void; 123 124/** 125 * The configuration of native media player. 126 * 127 * @typedef NativeMediaPlayerConfig 128 * @syscap SystemCapability.Web.Webview.Core 129 * @atomicservice 130 * @since 12 131 */ 132declare interface NativeMediaPlayerConfig { 133 /** 134 * Should playing web media by native application instead of web player. 135 * 136 * @type { boolean } 137 * @syscap SystemCapability.Web.Webview.Core 138 * @atomicservice 139 * @since 12 140 */ 141 enable: boolean; 142 143 /** 144 * The contents painted by native media player should overlay web page. 145 * 146 * @type { boolean } 147 * @syscap SystemCapability.Web.Webview.Core 148 * @atomicservice 149 * @since 12 150 */ 151 shouldOverlay: boolean; 152} 153 154/** 155 * The callback of render process not responding. 156 * 157 * @typedef { function } OnRenderProcessNotRespondingCallback 158 * @param { RenderProcessNotRespondingData } data - details of onRenderProcessNotResponding. 159 * @syscap SystemCapability.Web.Webview.Core 160 * @since 12 161 */ 162type OnRenderProcessNotRespondingCallback = (data : RenderProcessNotRespondingData) => void; 163 164/** 165 * The callback of render process responding. 166 * 167 * @typedef { function } OnRenderProcessRespondingCallback 168 * @syscap SystemCapability.Web.Webview.Core 169 * @since 12 170 */ 171type OnRenderProcessRespondingCallback = () => void; 172 173/** 174* The callback of ViewportFit Changed. 175 * 176 * @typedef { function } OnViewportFitChangedCallback 177 * @param { ViewportFit } viewportFit - details of OnViewportFitChangedCallback. 178 * @syscap SystemCapability.Web.Webview.Core 179 * @atomicservice 180 * @since 12 181 */ 182type OnViewportFitChangedCallback = (viewportFit: ViewportFit) => void; 183 184/** 185 * The callback of ads block 186 * 187 * @typedef { function } OnAdsBlockedCallback 188 * @param { AdsBlockedDetails } details - details of OnAdsBlockedCallback. 189 * @syscap SystemCapability.Web.Webview.Core 190 * @atomicservice 191 * @since 12 192 */ 193type OnAdsBlockedCallback = (details: AdsBlockedDetails) => void; 194 195/** 196 * Defines the ads block details. 197 * 198 * @interface AdsBlockedDetails 199 * @syscap SystemCapability.Web.Webview.Core 200 * @atomicservice 201 * @since 12 202 */ 203declare interface AdsBlockedDetails { 204 /** 205 * The url of main frame. 206 * 207 * @type { string } 208 * @syscap SystemCapability.Web.Webview.Core 209 * @atomicservice 210 * @since 12 211 */ 212 url: string; 213 214 /** 215 * the url of ads. 216 * 217 * @type { Array<string> } 218 * @syscap SystemCapability.Web.Webview.Core 219 * @atomicservice 220 * @since 12 221 */ 222 adsBlocked: Array<string>; 223} 224 225/** 226 * Defines the web keyboard options when onInterceptKeyboardAttach event return. 227 * 228 * @interface WebKeyboardOptions 229 * @syscap SystemCapability.Web.Webview.Core 230 * @atomicservice 231 * @since 12 232 */ 233declare interface WebKeyboardOptions { 234 /** 235 * Whether the system keyboard is used. 236 * 237 * @type { boolean } 238 * @syscap SystemCapability.Web.Webview.Core 239 * @atomicservice 240 * @since 12 241 */ 242 useSystemKeyboard: boolean; 243 /** 244 * Set the enter key type when the system keyboard is used, the "enter" key related to the {@link inputMethodEngine}. 245 * 246 * @type { ?number } 247 * @syscap SystemCapability.Web.Webview.Core 248 * @atomicservice 249 * @since 12 250 */ 251 enterKeyType?: number; 252 /** 253 * Set the custom keyboard builder when the custom keyboard is used. 254 * 255 * @type { ?CustomBuilder } 256 * @syscap SystemCapability.Web.Webview.Core 257 * @atomicservice 258 * @since 12 259 */ 260 customKeyboard?: CustomBuilder; 261} 262 263/** 264 * Define the controller to interact with a custom keyboard, related to the {@link onInterceptKeyboardAttach} event. 265 * 266 * @syscap SystemCapability.Web.Webview.Core 267 * @atomicservice 268 * @since 12 269 */ 270declare class WebKeyboardController { 271 /** 272 * Constructor. 273 * 274 * @syscap SystemCapability.Web.Webview.Core 275 * @atomicservice 276 * @since 12 277 */ 278 constructor(); 279 280 /** 281 * Insert text into Editor. 282 * 283 * @param { string } text - text which will be inserted. 284 * @syscap SystemCapability.Web.Webview.Core 285 * @since 12 286 */ 287 insertText(text: string): void; 288 /** 289 * Delete text from back to front. 290 * 291 * @param { number } length - length of text, which will be deleted from back to front. 292 * @syscap SystemCapability.Web.Webview.Core 293 * @since 12 294 */ 295 deleteForward(length: number): void; 296 /** 297 * Delete text from front to back. 298 * 299 * @param { number } length - length of text, which will be deleted from front to back. 300 * @syscap SystemCapability.Web.Webview.Core 301 * @since 12 302 */ 303 deleteBackward(length: number): void; 304 /** 305 * Send the function of the key. 306 * 307 * @param { number } key - action indicates the "enter" key related to the {@link inputMethodEngine} 308 * @syscap SystemCapability.Web.Webview.Core 309 * @since 12 310 */ 311 sendFunctionKey(key: number): void; 312 /** 313 * Close the custom keyboard. 314 * 315 * @syscap SystemCapability.Web.Webview.Core 316 * @since 12 317 */ 318 close(): void; 319} 320 321/** 322 * Defines the web keyboard callback info related to the {@link onInterceptKeyboardAttach} event. 323 * 324 * @interface WebKeyboardCallbackInfo 325 * @syscap SystemCapability.Web.Webview.Core 326 * @atomicservice 327 * @since 12 328 */ 329declare interface WebKeyboardCallbackInfo { 330 /** 331 * The web keyboard controller. 332 * 333 * @type { WebKeyboardController } 334 * @syscap SystemCapability.Web.Webview.Core 335 * @atomicservice 336 * @since 12 337 */ 338 controller: WebKeyboardController; 339 /** 340 * The attributes of web input element. 341 * 342 * @type { Record<string, string> } 343 * @syscap SystemCapability.Web.Webview.Core 344 * @atomicservice 345 * @since 12 346 */ 347 attributes: Record<string, string>; 348} 349 350/** 351 * The callback of onInterceptKeyboardAttach event. 352 * 353 * @typedef { function } WebKeyboardCallback 354 * @param { WebKeyboardCallbackInfo } keyboardCallbackInfo - callback information of onInterceptKeyboardAttach. 355 * @returns { WebKeyboardOptions } Return the web keyboard options of this web component. 356 * @syscap SystemCapability.Web.Webview.Core 357 * @atomicservice 358 * @since 12 359 */ 360type WebKeyboardCallback = (keyboardCallbackInfo: WebKeyboardCallbackInfo) => WebKeyboardOptions; 361 362/** 363 * Enum type supplied to {@link getMessageLevel} for receiving the console log level of JavaScript. 364 * 365 * @enum { number } 366 * @syscap SystemCapability.Web.Webview.Core 367 * @since 8 368 */ 369/** 370 * Enum type supplied to {@link getMessageLevel} for receiving the console log level of JavaScript. 371 * 372 * @enum { number } 373 * @syscap SystemCapability.Web.Webview.Core 374 * @crossplatform 375 * @atomicservice 376 * @since 11 377 */ 378declare enum MessageLevel { 379 /** 380 * Debug level. 381 * 382 * @syscap SystemCapability.Web.Webview.Core 383 * @since 8 384 */ 385 /** 386 * Debug level. 387 * 388 * @syscap SystemCapability.Web.Webview.Core 389 * @crossplatform 390 * @atomicservice 391 * @since 11 392 */ 393 Debug, 394 395 /** 396 * Error level. 397 * 398 * @syscap SystemCapability.Web.Webview.Core 399 * @since 8 400 */ 401 /** 402 * Error level. 403 * 404 * @syscap SystemCapability.Web.Webview.Core 405 * @crossplatform 406 * @atomicservice 407 * @since 11 408 */ 409 Error, 410 411 /** 412 * Info level. 413 * 414 * @syscap SystemCapability.Web.Webview.Core 415 * @since 8 416 */ 417 /** 418 * Info level. 419 * 420 * @syscap SystemCapability.Web.Webview.Core 421 * @crossplatform 422 * @atomicservice 423 * @since 11 424 */ 425 Info, 426 427 /** 428 * Log level. 429 * 430 * @syscap SystemCapability.Web.Webview.Core 431 * @since 8 432 */ 433 /** 434 * Log level. 435 * 436 * @syscap SystemCapability.Web.Webview.Core 437 * @crossplatform 438 * @atomicservice 439 * @since 11 440 */ 441 Log, 442 443 /** 444 * Warn level. 445 * 446 * @syscap SystemCapability.Web.Webview.Core 447 * @since 8 448 */ 449 /** 450 * Warn level. 451 * 452 * @syscap SystemCapability.Web.Webview.Core 453 * @crossplatform 454 * @atomicservice 455 * @since 11 456 */ 457 Warn, 458} 459 460/** 461 * The Web's behavior to load from HTTP or HTTPS. Defaults to MixedMode.None. 462 * 463 * @enum { number } 464 * @syscap SystemCapability.Web.Webview.Core 465 * @since 8 466 */ 467/** 468 * The Web's behavior to load from HTTP or HTTPS. Defaults to MixedMode.None. 469 * 470 * @enum { number } 471 * @syscap SystemCapability.Web.Webview.Core 472 * @atomicservice 473 * @since 11 474 */ 475declare enum MixedMode { 476 /** 477 * Allows all sources. 478 * 479 * @syscap SystemCapability.Web.Webview.Core 480 * @since 8 481 */ 482 /** 483 * Allows all sources. 484 * 485 * @syscap SystemCapability.Web.Webview.Core 486 * @atomicservice 487 * @since 11 488 */ 489 All, 490 491 /** 492 * Allows sources Compatibly. 493 * 494 * @syscap SystemCapability.Web.Webview.Core 495 * @since 8 496 */ 497 /** 498 * Allows sources Compatibly. 499 * 500 * @syscap SystemCapability.Web.Webview.Core 501 * @atomicservice 502 * @since 11 503 */ 504 Compatible, 505 506 /** 507 * Don't allow unsecure sources from a secure origin. 508 * 509 * @syscap SystemCapability.Web.Webview.Core 510 * @since 8 511 */ 512 /** 513 * Don't allow unsecure sources from a secure origin. 514 * 515 * @syscap SystemCapability.Web.Webview.Core 516 * @atomicservice 517 * @since 11 518 */ 519 None, 520} 521 522/** 523 * The callback of safe browsing check. 524 * 525 * @typedef { function } OnSafeBrowsingCheckResultCallback 526 * @param { ThreatType } threatType - callback information of onSafeBrowsingCheckResult. 527 * @syscap SystemCapability.Web.Webview.Core 528 * @atomicservice 529 * @since 11 530 */ 531type OnSafeBrowsingCheckResultCallback = (threatType: ThreatType) => void; 532 533/** 534 * Enum type supplied to {@link getHitTest} for indicating the cursor node HitTest. 535 * 536 * @enum { number } 537 * @syscap SystemCapability.Web.Webview.Core 538 * @since 8 539 */ 540/** 541 * Enum type supplied to {@link getHitTest} for indicating the cursor node HitTest. 542 * 543 * @enum { number } 544 * @syscap SystemCapability.Web.Webview.Core 545 * @atomicservice 546 * @since 11 547 */ 548declare enum HitTestType { 549 /** 550 * The edit text. 551 * 552 * @syscap SystemCapability.Web.Webview.Core 553 * @since 8 554 */ 555 /** 556 * The edit text. 557 * 558 * @syscap SystemCapability.Web.Webview.Core 559 * @atomicservice 560 * @since 11 561 */ 562 EditText, 563 564 /** 565 * The email address. 566 * 567 * @syscap SystemCapability.Web.Webview.Core 568 * @since 8 569 */ 570 /** 571 * The email address. 572 * 573 * @syscap SystemCapability.Web.Webview.Core 574 * @atomicservice 575 * @since 11 576 */ 577 Email, 578 579 /** 580 * The HTML::a tag with src=http. 581 * 582 * @syscap SystemCapability.Web.Webview.Core 583 * @since 8 584 */ 585 /** 586 * The HTML::a tag with src=http. 587 * 588 * @syscap SystemCapability.Web.Webview.Core 589 * @atomicservice 590 * @since 11 591 */ 592 HttpAnchor, 593 594 /** 595 * The HTML::a tag with src=http + HTML::img. 596 * 597 * @syscap SystemCapability.Web.Webview.Core 598 * @since 8 599 */ 600 /** 601 * The HTML::a tag with src=http + HTML::img. 602 * 603 * @syscap SystemCapability.Web.Webview.Core 604 * @atomicservice 605 * @since 11 606 */ 607 HttpAnchorImg, 608 609 /** 610 * The HTML::img tag. 611 * 612 * @syscap SystemCapability.Web.Webview.Core 613 * @since 8 614 */ 615 /** 616 * The HTML::img tag. 617 * 618 * @syscap SystemCapability.Web.Webview.Core 619 * @atomicservice 620 * @since 11 621 */ 622 Img, 623 624 /** 625 * The map address. 626 * 627 * @syscap SystemCapability.Web.Webview.Core 628 * @since 8 629 */ 630 /** 631 * The map address. 632 * 633 * @syscap SystemCapability.Web.Webview.Core 634 * @atomicservice 635 * @since 11 636 */ 637 Map, 638 639 /** 640 * The phone number. 641 * 642 * @syscap SystemCapability.Web.Webview.Core 643 * @since 8 644 */ 645 /** 646 * The phone number. 647 * 648 * @syscap SystemCapability.Web.Webview.Core 649 * @atomicservice 650 * @since 11 651 */ 652 Phone, 653 654 /** 655 * Other unknown HitTest. 656 * 657 * @syscap SystemCapability.Web.Webview.Core 658 * @since 8 659 */ 660 /** 661 * Other unknown HitTest. 662 * 663 * @syscap SystemCapability.Web.Webview.Core 664 * @atomicservice 665 * @since 11 666 */ 667 Unknown, 668} 669 670/** 671 * Enum type supplied to {@link cacheMode} for setting the Web cache mode. 672 * 673 * @enum { number } 674 * @syscap SystemCapability.Web.Webview.Core 675 * @since 8 676 */ 677/** 678 * Enum type supplied to {@link cacheMode} for setting the Web cache mode. 679 * 680 * @enum { number } 681 * @syscap SystemCapability.Web.Webview.Core 682 * @atomicservice 683 * @since 11 684 */ 685declare enum CacheMode { 686 /** 687 * load cache when they are available and not expired, otherwise load online. 688 * 689 * @syscap SystemCapability.Web.Webview.Core 690 * @since 9 691 */ 692 /** 693 * load cache when they are available and not expired, otherwise load online. 694 * 695 * @syscap SystemCapability.Web.Webview.Core 696 * @atomicservice 697 * @since 11 698 */ 699 Default, 700 701 /** 702 * load cache when they are available, otherwise load online. 703 * 704 * @syscap SystemCapability.Web.Webview.Core 705 * @since 8 706 */ 707 /** 708 * load cache when they are available, otherwise load online. 709 * 710 * @syscap SystemCapability.Web.Webview.Core 711 * @atomicservice 712 * @since 11 713 */ 714 None, 715 716 /** 717 * Load online and not cache. 718 * 719 * @syscap SystemCapability.Web.Webview.Core 720 * @since 8 721 */ 722 /** 723 * Load online and not cache. 724 * 725 * @syscap SystemCapability.Web.Webview.Core 726 * @atomicservice 727 * @since 11 728 */ 729 Online, 730 731 /** 732 * load cache and not online. 733 * 734 * @syscap SystemCapability.Web.Webview.Core 735 * @since 8 736 */ 737 /** 738 * load cache and not online. 739 * 740 * @syscap SystemCapability.Web.Webview.Core 741 * @atomicservice 742 * @since 11 743 */ 744 Only, 745} 746 747/** 748 * Enum type supplied to {@link overScrollMode} for setting the web overScroll mode. 749 * 750 * @enum { number } 751 * @syscap SystemCapability.Web.Webview.Core 752 * @atomicservice 753 * @since 11 754 */ 755declare enum OverScrollMode { 756 /** 757 * Disable the web over-scroll mode. 758 * 759 * @syscap SystemCapability.Web.Webview.Core 760 * @atomicservice 761 * @since 11 762 */ 763 NEVER, 764 /** 765 * Enable the web over-scroll mode. 766 * 767 * @syscap SystemCapability.Web.Webview.Core 768 * @atomicservice 769 * @since 11 770 */ 771 ALWAYS 772} 773 774/** 775 * Enum type supplied to {@link blurOnKeyboardHideMode} for setting the web blurOnKeyboardHide mode. 776 * 777 * @enum { number } 778 * @syscap SystemCapability.Web.Webview.Core 779 * @atomicservice 780 * @since 14 781 */ 782declare enum BlurOnKeyboardHideMode { 783 /** 784 * The focused input elements on webview will not blur when soft keyboard is hidden manually. 785 * 786 * @syscap SystemCapability.Web.Webview.Core 787 * @atomicservice 788 * @since 14 789 */ 790 SILENT, 791 /** 792 * The focused input elements on webview will blur when soft keyboard is hidden manually. 793 * 794 * @syscap SystemCapability.Web.Webview.Core 795 * @atomicservice 796 * @since 14 797 */ 798 BLUR 799} 800 801/** 802 * Enum type supplied to {@link darkMode} for setting the web dark mode. 803 * 804 * @enum { number } 805 * @syscap SystemCapability.Web.Webview.Core 806 * @since 9 807 */ 808/** 809 * Enum type supplied to {@link darkMode} for setting the web dark mode. 810 * 811 * @enum { number } 812 * @syscap SystemCapability.Web.Webview.Core 813 * @atomicservice 814 * @since 11 815 */ 816declare enum WebDarkMode { 817 /** 818 * Disable the web dark mode. 819 * 820 * @syscap SystemCapability.Web.Webview.Core 821 * @since 9 822 */ 823 /** 824 * Disable the web dark mode. 825 * 826 * @syscap SystemCapability.Web.Webview.Core 827 * @atomicservice 828 * @since 11 829 */ 830 Off, 831 832 /** 833 * Enable the web dark mode. 834 * 835 * @syscap SystemCapability.Web.Webview.Core 836 * @since 9 837 */ 838 /** 839 * Enable the web dark mode. 840 * 841 * @syscap SystemCapability.Web.Webview.Core 842 * @atomicservice 843 * @since 11 844 */ 845 On, 846 847 /** 848 * Make web dark mode follow the system. 849 * 850 * @syscap SystemCapability.Web.Webview.Core 851 * @since 9 852 */ 853 /** 854 * Make web dark mode follow the system. 855 * 856 * @syscap SystemCapability.Web.Webview.Core 857 * @atomicservice 858 * @since 11 859 */ 860 Auto, 861} 862 863/** 864 * Enum type supplied to {@link captureMode} for setting the web capture mode. 865 * 866 * @enum { number } 867 * @syscap SystemCapability.Web.Webview.Core 868 * @since 10 869 */ 870/** 871 * Enum type supplied to {@link captureMode} for setting the web capture mode. 872 * 873 * @enum { number } 874 * @syscap SystemCapability.Web.Webview.Core 875 * @atomicservice 876 * @since 11 877 */ 878declare enum WebCaptureMode { 879 /** 880 * The home screen. 881 * @syscap SystemCapability.Web.Webview.Core 882 * @since 10 883 */ 884 /** 885 * The home screen. 886 * @syscap SystemCapability.Web.Webview.Core 887 * @atomicservice 888 * @since 11 889 */ 890 HOME_SCREEN = 0, 891} 892 893/** 894 * Enum type supplied to {@link threatType} for the website's threat type. 895 * 896 * @enum { number } 897 * @syscap SystemCapability.Web.Webview.Core 898 * @atomicservice 899 * @since 11 900 */ 901declare enum ThreatType { 902 /** 903 * Illegal websites. 904 * 905 * @syscap SystemCapability.Web.Webview.Core 906 * @atomicservice 907 * @since 11 908 */ 909 THREAT_ILLEGAL = 0, 910 911 /** 912 * Fraud websites. 913 * 914 * @syscap SystemCapability.Web.Webview.Core 915 * @atomicservice 916 * @since 11 917 */ 918 THREAT_FRAUD = 1, 919 920 /** 921 * Websites with security risks. 922 * 923 * @syscap SystemCapability.Web.Webview.Core 924 * @atomicservice 925 * @since 11 926 */ 927 THREAT_RISK = 2, 928 929 /** 930 * Websites suspected of containing unhealthy content. 931 * ArkWeb will not intercept this type of website and apps could handle it themselves. 932 * 933 * @syscap SystemCapability.Web.Webview.Core 934 * @atomicservice 935 * @since 11 936 */ 937 THREAT_WARNING = 3, 938} 939 940/** 941 * Defines the Media Options. 942 * 943 * @interface WebMediaOptions 944 * @syscap SystemCapability.Web.Webview.Core 945 * @since 10 946 */ 947/** 948 * Defines the Media Options. 949 * 950 * @interface WebMediaOptions 951 * @syscap SystemCapability.Web.Webview.Core 952 * @atomicservice 953 * @since 11 954 */ 955/** 956 * Defines the Media Options. 957 * 958 * @typedef WebMediaOptions 959 * @syscap SystemCapability.Web.Webview.Core 960 * @atomicservice 961 * @since 12 962 */ 963declare interface WebMediaOptions { 964 /** 965 * The time interval for audio playback to resume. 966 * 967 * @type { ?number } 968 * @syscap SystemCapability.Web.Webview.Core 969 * @since 10 970 */ 971 /** 972 * The time interval for audio playback to resume. 973 * 974 * @type { ?number } 975 * @syscap SystemCapability.Web.Webview.Core 976 * @atomicservice 977 * @since 11 978 */ 979 resumeInterval?: number; 980 /** 981 * Whether the audio of each web is exclusive. 982 * 983 * @type { ?boolean } 984 * @syscap SystemCapability.Web.Webview.Core 985 * @since 10 986 */ 987 /** 988 * Whether the audio of each web is exclusive. 989 * 990 * @type { ?boolean } 991 * @syscap SystemCapability.Web.Webview.Core 992 * @atomicservice 993 * @since 11 994 */ 995 audioExclusive?: boolean; 996} 997 998/** 999 * Defines the screen capture configuration. 1000 * 1001 * @interface ScreenCaptureConfig 1002 * @syscap SystemCapability.Web.Webview.Core 1003 * @since 10 1004 */ 1005/** 1006 * Defines the screen capture configuration. 1007 * 1008 * @interface ScreenCaptureConfig 1009 * @syscap SystemCapability.Web.Webview.Core 1010 * @atomicservice 1011 * @since 11 1012 */ 1013/** 1014 * Defines the screen capture configuration. 1015 * 1016 * @typedef ScreenCaptureConfig 1017 * @syscap SystemCapability.Web.Webview.Core 1018 * @atomicservice 1019 * @since 12 1020 */ 1021declare interface ScreenCaptureConfig { 1022 /** 1023 * The mode for selecting the recording area. 1024 * 1025 * @type { WebCaptureMode } 1026 * @syscap SystemCapability.Web.Webview.Core 1027 * @since 10 1028 */ 1029 /** 1030 * The mode for selecting the recording area. 1031 * 1032 * @type { WebCaptureMode } 1033 * @syscap SystemCapability.Web.Webview.Core 1034 * @atomicservice 1035 * @since 11 1036 */ 1037 captureMode: WebCaptureMode; 1038} 1039 1040/** 1041 * Define the handler to exit the full screen mode, related to the {@link onFullScreenEnter} event. 1042 * 1043 * @syscap SystemCapability.Web.Webview.Core 1044 * @since 9 1045 */ 1046/** 1047 * Define the handler to exit the full screen mode, related to the {@link onFullScreenEnter} event. 1048 * 1049 * @syscap SystemCapability.Web.Webview.Core 1050 * @atomicservice 1051 * @since 11 1052 */ 1053declare class FullScreenExitHandler { 1054 /** 1055 * Constructor. 1056 * 1057 * @syscap SystemCapability.Web.Webview.Core 1058 * @since 9 1059 */ 1060 /** 1061 * Constructor. 1062 * 1063 * @syscap SystemCapability.Web.Webview.Core 1064 * @atomicservice 1065 * @since 11 1066 */ 1067 constructor(); 1068 1069 /** 1070 * Exit the full screen mode. 1071 * 1072 * @syscap SystemCapability.Web.Webview.Core 1073 * @since 9 1074 */ 1075 /** 1076 * Exit the full screen mode. 1077 * 1078 * @syscap SystemCapability.Web.Webview.Core 1079 * @atomicservice 1080 * @since 11 1081 */ 1082 exitFullScreen(): void; 1083} 1084 1085/** 1086 * Defines the event details when the web component enter full screen mode. 1087 * 1088 * @typedef FullScreenEnterEvent 1089 * @syscap SystemCapability.Web.Webview.Core 1090 * @atomicservice 1091 * @since 12 1092 */ 1093declare interface FullScreenEnterEvent { 1094 /** 1095 * A function handle to exit full-screen mode. 1096 * 1097 * @type { FullScreenExitHandler } 1098 * @syscap SystemCapability.Web.Webview.Core 1099 * @atomicservice 1100 * @since 12 1101 */ 1102 handler: FullScreenExitHandler; 1103 /** 1104 * The intrinsic width of the video if the fullscreen element contains video element, expressed in CSS pixels. 1105 * 1106 * @type { ?number } 1107 * @syscap SystemCapability.Web.Webview.Core 1108 * @atomicservice 1109 * @since 12 1110 */ 1111 videoWidth?: number; 1112 /** 1113 * The intrinsic height of the video if the fullscreen element contains video element, expressed in CSS pixels. 1114 * 1115 * @type { ?number } 1116 * @syscap SystemCapability.Web.Webview.Core 1117 * @atomicservice 1118 * @since 12 1119 */ 1120 videoHeight?: number; 1121} 1122 1123/** 1124 * The callback when the web component enter full screen mode. 1125 * 1126 * @typedef { function } OnFullScreenEnterCallback 1127 * @param { FullScreenEnterEvent } event - callback information of onFullScreenEnter. 1128 * @syscap SystemCapability.Web.Webview.Core 1129 * @atomicservice 1130 * @since 12 1131 */ 1132type OnFullScreenEnterCallback = (event: FullScreenEnterEvent) => void; 1133 1134/** 1135 * Enum type supplied to {@link renderExitReason} when onRenderExited being called. 1136 * 1137 * @enum { number } 1138 * @syscap SystemCapability.Web.Webview.Core 1139 * @since 9 1140 */ 1141/** 1142 * Enum type supplied to {@link renderExitReason} when onRenderExited being called. 1143 * 1144 * @enum { number } 1145 * @syscap SystemCapability.Web.Webview.Core 1146 * @atomicservice 1147 * @since 11 1148 */ 1149declare enum RenderExitReason { 1150 /** 1151 * Render process non-zero exit status. 1152 * 1153 * @syscap SystemCapability.Web.Webview.Core 1154 * @since 9 1155 */ 1156 /** 1157 * Render process non-zero exit status. 1158 * 1159 * @syscap SystemCapability.Web.Webview.Core 1160 * @atomicservice 1161 * @since 11 1162 */ 1163 ProcessAbnormalTermination, 1164 1165 /** 1166 * SIGKILL or task manager kill. 1167 * 1168 * @syscap SystemCapability.Web.Webview.Core 1169 * @since 9 1170 */ 1171 /** 1172 * SIGKILL or task manager kill. 1173 * 1174 * @syscap SystemCapability.Web.Webview.Core 1175 * @atomicservice 1176 * @since 11 1177 */ 1178 ProcessWasKilled, 1179 1180 /** 1181 * Segmentation fault. 1182 * 1183 * @syscap SystemCapability.Web.Webview.Core 1184 * @since 9 1185 */ 1186 /** 1187 * Segmentation fault. 1188 * 1189 * @syscap SystemCapability.Web.Webview.Core 1190 * @atomicservice 1191 * @since 11 1192 */ 1193 ProcessCrashed, 1194 1195 /** 1196 * Out of memory. 1197 * 1198 * @syscap SystemCapability.Web.Webview.Core 1199 * @since 9 1200 */ 1201 /** 1202 * Out of memory. 1203 * 1204 * @syscap SystemCapability.Web.Webview.Core 1205 * @atomicservice 1206 * @since 11 1207 */ 1208 ProcessOom, 1209 1210 /** 1211 * Unknown reason. 1212 * 1213 * @syscap SystemCapability.Web.Webview.Core 1214 * @since 9 1215 */ 1216 /** 1217 * Unknown reason. 1218 * 1219 * @syscap SystemCapability.Web.Webview.Core 1220 * @atomicservice 1221 * @since 11 1222 */ 1223 ProcessExitUnknown, 1224} 1225 1226 /** 1227 * The callback of custom hide of the context menu. 1228 * 1229 * @typedef { function } OnContextMenuHideCallback 1230 * @syscap SystemCapability.Web.Webview.Core 1231 * @atomicservice 1232 * @since 11 1233 */ 1234 type OnContextMenuHideCallback = () => void; 1235 1236/** 1237 * Enum type supplied to {@link error} when onSslErrorEventReceive being called. 1238 * 1239 * @enum { number } 1240 * @syscap SystemCapability.Web.Webview.Core 1241 * @since 9 1242 */ 1243/** 1244 * Enum type supplied to {@link error} when onSslErrorEventReceive being called. 1245 * 1246 * @enum { number } 1247 * @syscap SystemCapability.Web.Webview.Core 1248 * @atomicservice 1249 * @since 11 1250 */ 1251declare enum SslError { 1252 /** 1253 * General error. 1254 * 1255 * @syscap SystemCapability.Web.Webview.Core 1256 * @since 9 1257 */ 1258 /** 1259 * General error. 1260 * 1261 * @syscap SystemCapability.Web.Webview.Core 1262 * @atomicservice 1263 * @since 11 1264 */ 1265 Invalid, 1266 1267 /** 1268 * Hostname mismatch. 1269 * 1270 * @syscap SystemCapability.Web.Webview.Core 1271 * @since 9 1272 */ 1273 /** 1274 * Hostname mismatch. 1275 * 1276 * @syscap SystemCapability.Web.Webview.Core 1277 * @atomicservice 1278 * @since 11 1279 */ 1280 HostMismatch, 1281 1282 /** 1283 * The certificate date is invalid. 1284 * 1285 * @syscap SystemCapability.Web.Webview.Core 1286 * @since 9 1287 */ 1288 /** 1289 * The certificate date is invalid. 1290 * 1291 * @syscap SystemCapability.Web.Webview.Core 1292 * @atomicservice 1293 * @since 11 1294 */ 1295 DateInvalid, 1296 1297 /** 1298 * The certificate authority is not trusted. 1299 * 1300 * @syscap SystemCapability.Web.Webview.Core 1301 * @since 9 1302 */ 1303 /** 1304 * The certificate authority is not trusted. 1305 * 1306 * @syscap SystemCapability.Web.Webview.Core 1307 * @atomicservice 1308 * @since 11 1309 */ 1310 Untrusted, 1311} 1312 1313/** 1314 * Enum type supplied to {@link FileSelectorParam} when onFileSelectorShow being called. 1315 * 1316 * @enum { number } 1317 * @syscap SystemCapability.Web.Webview.Core 1318 * @since 9 1319 */ 1320/** 1321 * Enum type supplied to {@link FileSelectorParam} when onFileSelectorShow being called. 1322 * 1323 * @enum { number } 1324 * @syscap SystemCapability.Web.Webview.Core 1325 * @crossplatform 1326 * @atomicservice 1327 * @since 11 1328 */ 1329declare enum FileSelectorMode { 1330 /** 1331 * Allows single file to be selected. 1332 * 1333 * @syscap SystemCapability.Web.Webview.Core 1334 * @since 9 1335 */ 1336 /** 1337 * Allows single file to be selected. 1338 * 1339 * @syscap SystemCapability.Web.Webview.Core 1340 * @crossplatform 1341 * @atomicservice 1342 * @since 11 1343 */ 1344 FileOpenMode, 1345 1346 /** 1347 * Allows multiple files to be selected. 1348 * 1349 * @syscap SystemCapability.Web.Webview.Core 1350 * @since 9 1351 */ 1352 /** 1353 * Allows multiple files to be selected. 1354 * 1355 * @syscap SystemCapability.Web.Webview.Core 1356 * @crossplatform 1357 * @atomicservice 1358 * @since 11 1359 */ 1360 FileOpenMultipleMode, 1361 1362 /** 1363 * Allows file folders to be selected. 1364 * 1365 * @syscap SystemCapability.Web.Webview.Core 1366 * @since 9 1367 */ 1368 /** 1369 * Allows file folders to be selected. 1370 * 1371 * @syscap SystemCapability.Web.Webview.Core 1372 * @crossplatform 1373 * @atomicservice 1374 * @since 11 1375 */ 1376 FileOpenFolderMode, 1377 1378 /** 1379 * Allows select files to save. 1380 * 1381 * @syscap SystemCapability.Web.Webview.Core 1382 * @since 9 1383 */ 1384 /** 1385 * Allows select files to save. 1386 * 1387 * @syscap SystemCapability.Web.Webview.Core 1388 * @crossplatform 1389 * @atomicservice 1390 * @since 11 1391 */ 1392 FileSaveMode, 1393} 1394 1395/** 1396 * Enum type supplied to {@link layoutMode} for setting the web layout mode. 1397 * 1398 * @enum { number } 1399 * @syscap SystemCapability.Web.Webview.Core 1400 * @atomicservice 1401 * @since 11 1402 */ 1403declare enum WebLayoutMode { 1404 /** 1405 * Web layout follows the system. 1406 * 1407 * @syscap SystemCapability.Web.Webview.Core 1408 * @atomicservice 1409 * @since 11 1410 */ 1411 NONE, 1412 1413 /** 1414 * Adaptive web layout based on page size. 1415 * 1416 * @syscap SystemCapability.Web.Webview.Core 1417 * @atomicservice 1418 * @since 11 1419 */ 1420 FIT_CONTENT, 1421} 1422 1423/** 1424 * Enum type supplied to {@link RenderProcessNotRespondingData} when onRenderProcessNotResponding is called. 1425 * 1426 * @enum { number } 1427 * @syscap SystemCapability.Web.Webview.Core 1428 * @since 12 1429 */ 1430declare enum RenderProcessNotRespondingReason { 1431 /** 1432 * Timeout for input sent to render process. 1433 * 1434 * @syscap SystemCapability.Web.Webview.Core 1435 * @since 12 1436 */ 1437 INPUT_TIMEOUT, 1438 1439 /** 1440 * Timeout for navigation commit. 1441 * 1442 * @syscap SystemCapability.Web.Webview.Core 1443 * @since 12 1444 */ 1445 NAVIGATION_COMMIT_TIMEOUT, 1446} 1447 1448/** 1449 * Encompassed message information as parameters to {@link onFileSelectorShow} method. 1450 * 1451 * @syscap SystemCapability.Web.Webview.Core 1452 * @since 9 1453 */ 1454/** 1455 * Encompassed message information as parameters to {@link onFileSelectorShow} method. 1456 * 1457 * @syscap SystemCapability.Web.Webview.Core 1458 * @crossplatform 1459 * @atomicservice 1460 * @since 11 1461 */ 1462declare class FileSelectorParam { 1463 /** 1464 * Constructor. 1465 * 1466 * @syscap SystemCapability.Web.Webview.Core 1467 * @since 9 1468 */ 1469 /** 1470 * Constructor. 1471 * 1472 * @syscap SystemCapability.Web.Webview.Core 1473 * @crossplatform 1474 * @atomicservice 1475 * @since 11 1476 */ 1477 constructor(); 1478 1479 /** 1480 * Gets the title of this file selector. 1481 * @returns { string } Return the title of this file selector. 1482 * @syscap SystemCapability.Web.Webview.Core 1483 * @since 9 1484 */ 1485 /** 1486 * Gets the title of this file selector. 1487 * @returns { string } Return the title of this file selector. 1488 * @syscap SystemCapability.Web.Webview.Core 1489 * @crossplatform 1490 * @atomicservice 1491 * @since 11 1492 */ 1493 getTitle(): string; 1494 1495 /** 1496 * Gets the FileSelectorMode of this file selector. 1497 * @returns { FileSelectorMode } Return the FileSelectorMode of this file selector. 1498 * @syscap SystemCapability.Web.Webview.Core 1499 * @since 9 1500 */ 1501 /** 1502 * Gets the FileSelectorMode of this file selector. 1503 * @returns { FileSelectorMode } Return the FileSelectorMode of this file selector. 1504 * @syscap SystemCapability.Web.Webview.Core 1505 * @crossplatform 1506 * @atomicservice 1507 * @since 11 1508 */ 1509 getMode(): FileSelectorMode; 1510 1511 /** 1512 * Gets an array of acceptable MIME type. 1513 * @returns { Array<string> } Return an array of acceptable MIME type. 1514 * @syscap SystemCapability.Web.Webview.Core 1515 * @since 9 1516 */ 1517 /** 1518 * Gets an array of acceptable MIME type. 1519 * @returns { Array<string> } Return an array of acceptable MIME type. 1520 * @syscap SystemCapability.Web.Webview.Core 1521 * @crossplatform 1522 * @atomicservice 1523 * @since 11 1524 */ 1525 getAcceptType(): Array<string>; 1526 1527 /** 1528 * Gets whether this file selector use a live media captured value. 1529 * 1530 * @returns { boolean } Return {@code true} if captured media; return {@code false} otherwise. 1531 * @syscap SystemCapability.Web.Webview.Core 1532 * @since 9 1533 */ 1534 /** 1535 * Gets whether this file selector use a live media captured value. 1536 * 1537 * @returns { boolean } Return {@code true} if captured media; return {@code false} otherwise. 1538 * @syscap SystemCapability.Web.Webview.Core 1539 * @crossplatform 1540 * @atomicservice 1541 * @since 11 1542 */ 1543 isCapture(): boolean; 1544} 1545 1546/** 1547 * Defines the js result. 1548 * 1549 * @syscap SystemCapability.Web.Webview.Core 1550 * @since 8 1551 */ 1552/** 1553 * Defines the js result. 1554 * 1555 * @syscap SystemCapability.Web.Webview.Core 1556 * @crossplatform 1557 * @atomicservice 1558 * @since 11 1559 */ 1560declare class JsResult { 1561 /** 1562 * Constructor. 1563 * 1564 * @syscap SystemCapability.Web.Webview.Core 1565 * @since 8 1566 */ 1567 /** 1568 * Constructor. 1569 * 1570 * @syscap SystemCapability.Web.Webview.Core 1571 * @crossplatform 1572 * @atomicservice 1573 * @since 11 1574 */ 1575 constructor(); 1576 1577 /** 1578 * Handle the user's JavaScript result if cancel the dialog. 1579 * 1580 * @syscap SystemCapability.Web.Webview.Core 1581 * @since 8 1582 */ 1583 /** 1584 * Handle the user's JavaScript result if cancel the dialog. 1585 * 1586 * @syscap SystemCapability.Web.Webview.Core 1587 * @crossplatform 1588 * @atomicservice 1589 * @since 11 1590 */ 1591 handleCancel(): void; 1592 1593 /** 1594 * Handle the user's JavaScript result if confirm the dialog. 1595 * 1596 * @syscap SystemCapability.Web.Webview.Core 1597 * @since 8 1598 */ 1599 /** 1600 * Handle the user's JavaScript result if confirm the dialog. 1601 * 1602 * @syscap SystemCapability.Web.Webview.Core 1603 * @crossplatform 1604 * @atomicservice 1605 * @since 11 1606 */ 1607 handleConfirm(): void; 1608 1609 /** 1610 * Handle the user's JavaScript result if confirm the prompt dialog. 1611 * 1612 * @param { string } result 1613 * @syscap SystemCapability.Web.Webview.Core 1614 * @since 9 1615 */ 1616 /** 1617 * Handle the user's JavaScript result if confirm the prompt dialog. 1618 * 1619 * @param { string } result 1620 * @syscap SystemCapability.Web.Webview.Core 1621 * @crossplatform 1622 * @atomicservice 1623 * @since 11 1624 */ 1625 handlePromptConfirm(result: string): void; 1626} 1627 1628/** 1629 * Defines the file selector result, related to {@link onFileSelectorShow} method. 1630 * 1631 * @syscap SystemCapability.Web.Webview.Core 1632 * @since 9 1633 */ 1634/** 1635 * Defines the file selector result, related to {@link onFileSelectorShow} method. 1636 * 1637 * @syscap SystemCapability.Web.Webview.Core 1638 * @crossplatform 1639 * @atomicservice 1640 * @since 11 1641 */ 1642declare class FileSelectorResult { 1643 /** 1644 * Constructor. 1645 * 1646 * @syscap SystemCapability.Web.Webview.Core 1647 * @since 9 1648 */ 1649 /** 1650 * Constructor. 1651 * 1652 * @syscap SystemCapability.Web.Webview.Core 1653 * @crossplatform 1654 * @atomicservice 1655 * @since 11 1656 */ 1657 constructor(); 1658 1659 /** 1660 * select a list of files. 1661 * 1662 * @param { Array<string> } fileList 1663 * @syscap SystemCapability.Web.Webview.Core 1664 * @since 9 1665 */ 1666 /** 1667 * select a list of files. 1668 * 1669 * @param { Array<string> } fileList 1670 * @syscap SystemCapability.Web.Webview.Core 1671 * @crossplatform 1672 * @atomicservice 1673 * @since 11 1674 */ 1675 handleFileList(fileList: Array<string>): void; 1676} 1677 1678/** 1679 * Defines the http auth request result, related to {@link onHttpAuthRequest} method. 1680 * 1681 * @syscap SystemCapability.Web.Webview.Core 1682 * @since 9 1683 */ 1684/** 1685 * Defines the http auth request result, related to {@link onHttpAuthRequest} method. 1686 * 1687 * @syscap SystemCapability.Web.Webview.Core 1688 * @crossplatform 1689 * @atomicservice 1690 * @since 11 1691 */ 1692declare class HttpAuthHandler { 1693 /** 1694 * Constructor. 1695 * 1696 * @syscap SystemCapability.Web.Webview.Core 1697 * @since 9 1698 */ 1699 /** 1700 * Constructor. 1701 * 1702 * @syscap SystemCapability.Web.Webview.Core 1703 * @crossplatform 1704 * @atomicservice 1705 * @since 11 1706 */ 1707 constructor(); 1708 1709 /** 1710 * confirm. 1711 * 1712 * @param { string } userName 1713 * @param { string } password 1714 * @returns { boolean } 1715 * @syscap SystemCapability.Web.Webview.Core 1716 * @since 9 1717 */ 1718 /** 1719 * confirm. 1720 * 1721 * @param { string } userName 1722 * @param { string } password 1723 * @returns { boolean } 1724 * @syscap SystemCapability.Web.Webview.Core 1725 * @crossplatform 1726 * @atomicservice 1727 * @since 11 1728 */ 1729 confirm(userName: string, password: string): boolean; 1730 1731 /** 1732 * cancel. 1733 * 1734 * @syscap SystemCapability.Web.Webview.Core 1735 * @since 9 1736 */ 1737 /** 1738 * cancel. 1739 * 1740 * @syscap SystemCapability.Web.Webview.Core 1741 * @crossplatform 1742 * @atomicservice 1743 * @since 11 1744 */ 1745 cancel(): void; 1746 1747 /** 1748 * isHttpAuthInfoSaved. 1749 * 1750 * @returns { boolean } 1751 * @syscap SystemCapability.Web.Webview.Core 1752 * @since 9 1753 */ 1754 /** 1755 * isHttpAuthInfoSaved. 1756 * 1757 * @returns { boolean } 1758 * @syscap SystemCapability.Web.Webview.Core 1759 * @crossplatform 1760 * @atomicservice 1761 * @since 11 1762 */ 1763 isHttpAuthInfoSaved(): boolean; 1764} 1765 1766/** 1767 * Defines the ssl error request result, related to {@link onSslErrorEventReceive} method. 1768 * 1769 * @syscap SystemCapability.Web.Webview.Core 1770 * @since 9 1771 */ 1772/** 1773 * Defines the ssl error request result, related to {@link onSslErrorEventReceive} method. 1774 * 1775 * @syscap SystemCapability.Web.Webview.Core 1776 * @atomicservice 1777 * @since 11 1778 */ 1779declare class SslErrorHandler { 1780 /** 1781 * Constructor. 1782 * 1783 * @syscap SystemCapability.Web.Webview.Core 1784 * @since 9 1785 */ 1786 /** 1787 * Constructor. 1788 * 1789 * @syscap SystemCapability.Web.Webview.Core 1790 * @atomicservice 1791 * @since 11 1792 */ 1793 constructor(); 1794 1795 /** 1796 * Confirm to use the SSL certificate. 1797 * 1798 * @syscap SystemCapability.Web.Webview.Core 1799 * @since 9 1800 */ 1801 /** 1802 * Confirm to use the SSL certificate. 1803 * 1804 * @syscap SystemCapability.Web.Webview.Core 1805 * @atomicservice 1806 * @since 11 1807 */ 1808 handleConfirm(): void; 1809 1810 /** 1811 * Cancel this request. 1812 * 1813 * @syscap SystemCapability.Web.Webview.Core 1814 * @since 9 1815 */ 1816 /** 1817 * Cancel this request. 1818 * 1819 * @syscap SystemCapability.Web.Webview.Core 1820 * @atomicservice 1821 * @since 11 1822 */ 1823 handleCancel(): void; 1824} 1825 1826/** 1827 * Defines the client certificate request result, related to {@link onClientAuthenticationRequest} method. 1828 * 1829 * @syscap SystemCapability.Web.Webview.Core 1830 * @since 9 1831 */ 1832/** 1833 * Defines the client certificate request result, related to {@link onClientAuthenticationRequest} method. 1834 * 1835 * @syscap SystemCapability.Web.Webview.Core 1836 * @atomicservice 1837 * @since 11 1838 */ 1839declare class ClientAuthenticationHandler { 1840 /** 1841 * Constructor. 1842 * 1843 * @syscap SystemCapability.Web.Webview.Core 1844 * @since 9 1845 */ 1846 /** 1847 * Constructor. 1848 * 1849 * @syscap SystemCapability.Web.Webview.Core 1850 * @atomicservice 1851 * @since 11 1852 */ 1853 constructor(); 1854 1855 /** 1856 * Confirm to use the specified private key and client certificate chain. 1857 * 1858 * @param { string } priKeyFile - The file that store private key. 1859 * @param { string } certChainFile - The file that store client certificate chain. 1860 * @syscap SystemCapability.Web.Webview.Core 1861 * @since 9 1862 */ 1863 /** 1864 * Confirm to use the specified private key and client certificate chain. 1865 * 1866 * @param { string } priKeyFile - The file that store private key. 1867 * @param { string } certChainFile - The file that store client certificate chain. 1868 * @syscap SystemCapability.Web.Webview.Core 1869 * @atomicservice 1870 * @since 11 1871 */ 1872 confirm(priKeyFile: string, certChainFile: string): void; 1873 1874 /** 1875 * Confirm to use the authUri.The authUri can be obtained from certificate management. 1876 * 1877 * @param { string } authUri is the key of credentials.The credentials contain sign info and client certificates info. 1878 * @syscap SystemCapability.Web.Webview.Core 1879 * @since 10 1880 */ 1881 /** 1882 * Confirm to use the authUri.The authUri can be obtained from certificate management. 1883 * 1884 * @param { string } authUri is the key of credentials.The credentials contain sign info and client certificates info. 1885 * @syscap SystemCapability.Web.Webview.Core 1886 * @atomicservice 1887 * @since 11 1888 */ 1889 confirm(authUri: string): void; 1890 1891 /** 1892 * Cancel this certificate request. 1893 * 1894 * @syscap SystemCapability.Web.Webview.Core 1895 * @since 9 1896 */ 1897 /** 1898 * Cancel this certificate request. 1899 * 1900 * @syscap SystemCapability.Web.Webview.Core 1901 * @atomicservice 1902 * @since 11 1903 */ 1904 cancel(): void; 1905 1906 /** 1907 * Ignore this certificate request temporarily. 1908 * 1909 * @syscap SystemCapability.Web.Webview.Core 1910 * @since 9 1911 */ 1912 /** 1913 * Ignore this certificate request temporarily. 1914 * 1915 * @syscap SystemCapability.Web.Webview.Core 1916 * @atomicservice 1917 * @since 11 1918 */ 1919 ignore(): void; 1920} 1921 1922/** 1923 * Defines the accessible resource type, related to {@link onPermissionRequest} method. 1924 * 1925 * @enum { string } 1926 * @syscap SystemCapability.Web.Webview.Core 1927 * @since 9 1928 */ 1929/** 1930 * Defines the accessible resource type, related to {@link onPermissionRequest} method. 1931 * 1932 * @enum { string } 1933 * @syscap SystemCapability.Web.Webview.Core 1934 * @crossplatform 1935 * @atomicservice 1936 * @since 11 1937 */ 1938declare enum ProtectedResourceType { 1939 /** 1940 * The MidiSysex resource. 1941 * 1942 * @syscap SystemCapability.Web.Webview.Core 1943 * @since 9 1944 */ 1945 /** 1946 * The MidiSysex resource. 1947 * 1948 * @syscap SystemCapability.Web.Webview.Core 1949 * @atomicservice 1950 * @since 11 1951 */ 1952 MidiSysex = 'TYPE_MIDI_SYSEX', 1953 1954 /** 1955 * The video capture resource, such as camera. 1956 * 1957 * @syscap SystemCapability.Web.Webview.Core 1958 * @since 10 1959 */ 1960 /** 1961 * The video capture resource, such as camera. 1962 * 1963 * @syscap SystemCapability.Web.Webview.Core 1964 * @crossplatform 1965 * @atomicservice 1966 * @since 11 1967 */ 1968 VIDEO_CAPTURE = 'TYPE_VIDEO_CAPTURE', 1969 1970 /** 1971 * The audio capture resource, such as microphone. 1972 * 1973 * @syscap SystemCapability.Web.Webview.Core 1974 * @since 10 1975 */ 1976 /** 1977 * The audio capture resource, such as microphone. 1978 * 1979 * @syscap SystemCapability.Web.Webview.Core 1980 * @crossplatform 1981 * @atomicservice 1982 * @since 11 1983 */ 1984 AUDIO_CAPTURE = 'TYPE_AUDIO_CAPTURE', 1985 1986 /** 1987 * The sensor resource, such as accelerometer. 1988 * 1989 * @syscap SystemCapability.Web.Webview.Core 1990 * @atomicservice 1991 * @since 12 1992 */ 1993 SENSOR = 'TYPE_SENSOR' 1994} 1995 1996/** 1997 * Defines the onPermissionRequest callback, related to {@link onPermissionRequest} method. 1998 * 1999 * @syscap SystemCapability.Web.Webview.Core 2000 * @since 9 2001 */ 2002/** 2003 * Defines the onPermissionRequest callback, related to {@link onPermissionRequest} method. 2004 * 2005 * @syscap SystemCapability.Web.Webview.Core 2006 * @crossplatform 2007 * @atomicservice 2008 * @since 11 2009 */ 2010declare class PermissionRequest { 2011 /** 2012 * Constructor. 2013 * 2014 * @syscap SystemCapability.Web.Webview.Core 2015 * @since 9 2016 */ 2017 /** 2018 * Constructor. 2019 * 2020 * @syscap SystemCapability.Web.Webview.Core 2021 * @crossplatform 2022 * @atomicservice 2023 * @since 11 2024 */ 2025 constructor(); 2026 2027 /** 2028 * Reject the request. 2029 * 2030 * @syscap SystemCapability.Web.Webview.Core 2031 * @since 9 2032 */ 2033 /** 2034 * Reject the request. 2035 * 2036 * @syscap SystemCapability.Web.Webview.Core 2037 * @crossplatform 2038 * @atomicservice 2039 * @since 11 2040 */ 2041 deny(): void; 2042 2043 /** 2044 * Gets the source if the webpage that attempted to access the restricted resource. 2045 * 2046 * @returns { string } 2047 * @syscap SystemCapability.Web.Webview.Core 2048 * @since 9 2049 */ 2050 /** 2051 * Gets the source if the webpage that attempted to access the restricted resource. 2052 * 2053 * @returns { string } 2054 * @syscap SystemCapability.Web.Webview.Core 2055 * @crossplatform 2056 * @atomicservice 2057 * @since 11 2058 */ 2059 getOrigin(): string; 2060 2061 /** 2062 * Gets the resource that the webpage is trying to access. 2063 * 2064 * @returns { Array<string> } 2065 * @syscap SystemCapability.Web.Webview.Core 2066 * @since 9 2067 */ 2068 /** 2069 * Gets the resource that the webpage is trying to access. 2070 * 2071 * @returns { Array<string> } 2072 * @syscap SystemCapability.Web.Webview.Core 2073 * @crossplatform 2074 * @atomicservice 2075 * @since 11 2076 */ 2077 getAccessibleResource(): Array<string>; 2078 2079 /** 2080 * Grant origin access to a given resource. 2081 * 2082 * @param { Array<string> } resources 2083 * @syscap SystemCapability.Web.Webview.Core 2084 * @since 9 2085 */ 2086 /** 2087 * Grant origin access to a given resource. 2088 * 2089 * @param { Array<string> } resources 2090 * @syscap SystemCapability.Web.Webview.Core 2091 * @crossplatform 2092 * @atomicservice 2093 * @since 11 2094 */ 2095 grant(resources: Array<string>): void; 2096} 2097 2098/** 2099 * Defines the onScreenCapture callback, related to {@link onScreenCapture} method. 2100 * @syscap SystemCapability.Web.Webview.Core 2101 * @since 10 2102 */ 2103/** 2104 * Defines the onScreenCapture callback, related to {@link onScreenCapture} method. 2105 * @syscap SystemCapability.Web.Webview.Core 2106 * @atomicservice 2107 * @since 11 2108 */ 2109declare class ScreenCaptureHandler { 2110 /** 2111 * Constructor. 2112 * @syscap SystemCapability.Web.Webview.Core 2113 * @since 10 2114 */ 2115 /** 2116 * Constructor. 2117 * @syscap SystemCapability.Web.Webview.Core 2118 * @atomicservice 2119 * @since 11 2120 */ 2121 constructor(); 2122 2123 /** 2124 * Gets the source of the webpage that attempted to access the restricted resource. 2125 * 2126 * @returns { string } 2127 * @syscap SystemCapability.Web.Webview.Core 2128 * @since 10 2129 */ 2130 /** 2131 * Gets the source of the webpage that attempted to access the restricted resource. 2132 * 2133 * @returns { string } 2134 * @syscap SystemCapability.Web.Webview.Core 2135 * @atomicservice 2136 * @since 11 2137 */ 2138 getOrigin(): string; 2139 2140 /** 2141 * Grant origin access to a given resource. 2142 * @param { ScreenCaptureConfig } config The screen capture configuration. 2143 * @syscap SystemCapability.Web.Webview.Core 2144 * @since 10 2145 */ 2146 /** 2147 * Grant origin access to a given resource. 2148 * @param { ScreenCaptureConfig } config The screen capture configuration. 2149 * @syscap SystemCapability.Web.Webview.Core 2150 * @atomicservice 2151 * @since 11 2152 */ 2153 grant(config: ScreenCaptureConfig): void; 2154 2155 /** 2156 * Reject the request. 2157 * @syscap SystemCapability.Web.Webview.Core 2158 * @since 10 2159 */ 2160 /** 2161 * Reject the request. 2162 * @syscap SystemCapability.Web.Webview.Core 2163 * @atomicservice 2164 * @since 11 2165 */ 2166 deny(): void; 2167} 2168 2169/** 2170 * Defines the onDataResubmission callback, related to {@link onDataResubmission} method. 2171 * 2172 * @syscap SystemCapability.Web.Webview.Core 2173 * @since 9 2174 */ 2175/** 2176 * Defines the onDataResubmission callback, related to {@link onDataResubmission} method. 2177 * 2178 * @syscap SystemCapability.Web.Webview.Core 2179 * @atomicservice 2180 * @since 11 2181 */ 2182declare class DataResubmissionHandler { 2183 /** 2184 * Constructor. 2185 * 2186 * @syscap SystemCapability.Web.Webview.Core 2187 * @since 9 2188 */ 2189 /** 2190 * Constructor. 2191 * 2192 * @syscap SystemCapability.Web.Webview.Core 2193 * @atomicservice 2194 * @since 11 2195 */ 2196 constructor(); 2197 2198 /** 2199 * Resend related form data. 2200 * 2201 * @syscap SystemCapability.Web.Webview.Core 2202 * @since 9 2203 */ 2204 /** 2205 * Resend related form data. 2206 * 2207 * @syscap SystemCapability.Web.Webview.Core 2208 * @atomicservice 2209 * @since 11 2210 */ 2211 resend(): void; 2212 2213 /** 2214 * Do not resend related form data. 2215 * 2216 * @syscap SystemCapability.Web.Webview.Core 2217 * @since 9 2218 */ 2219 /** 2220 * Do not resend related form data. 2221 * 2222 * @syscap SystemCapability.Web.Webview.Core 2223 * @atomicservice 2224 * @since 11 2225 */ 2226 cancel(): void; 2227} 2228 2229/** 2230 * Defines the onWindowNew callback, related to {@link onWindowNew} method. 2231 * 2232 * @syscap SystemCapability.Web.Webview.Core 2233 * @since 9 2234 */ 2235/** 2236 * Defines the onWindowNew callback, related to {@link onWindowNew} method. 2237 * 2238 * @syscap SystemCapability.Web.Webview.Core 2239 * @atomicservice 2240 * @since 11 2241 */ 2242declare class ControllerHandler { 2243 /** 2244 * Constructor. 2245 * 2246 * @syscap SystemCapability.Web.Webview.Core 2247 * @since 9 2248 */ 2249 /** 2250 * Constructor. 2251 * 2252 * @syscap SystemCapability.Web.Webview.Core 2253 * @atomicservice 2254 * @since 11 2255 */ 2256 constructor(); 2257 2258 /** 2259 * Set WebController object. 2260 * 2261 * @param { WebviewController } controller 2262 * @syscap SystemCapability.Web.Webview.Core 2263 * @since 9 2264 */ 2265 /** 2266 * Set WebController object. 2267 * 2268 * @param { WebviewController } controller 2269 * @syscap SystemCapability.Web.Webview.Core 2270 * @atomicservice 2271 * @since 11 2272 */ 2273 setWebController(controller: WebviewController): void; 2274} 2275 2276/** 2277 * Defines the context menu source type, related to {@link onContextMenuShow} method. 2278 * 2279 * @enum { number } 2280 * @syscap SystemCapability.Web.Webview.Core 2281 * @since 9 2282 */ 2283/** 2284 * Defines the context menu source type, related to {@link onContextMenuShow} method. 2285 * 2286 * @enum { number } 2287 * @syscap SystemCapability.Web.Webview.Core 2288 * @atomicservice 2289 * @since 11 2290 */ 2291declare enum ContextMenuSourceType { 2292 /** 2293 * Other source types. 2294 * 2295 * @syscap SystemCapability.Web.Webview.Core 2296 * @since 9 2297 */ 2298 /** 2299 * Other source types. 2300 * 2301 * @syscap SystemCapability.Web.Webview.Core 2302 * @atomicservice 2303 * @since 11 2304 */ 2305 None, 2306 2307 /** 2308 * Mouse. 2309 * 2310 * @syscap SystemCapability.Web.Webview.Core 2311 * @since 9 2312 */ 2313 /** 2314 * Mouse. 2315 * 2316 * @syscap SystemCapability.Web.Webview.Core 2317 * @atomicservice 2318 * @since 11 2319 */ 2320 Mouse, 2321 2322 /** 2323 * Long press. 2324 * 2325 * @syscap SystemCapability.Web.Webview.Core 2326 * @since 9 2327 */ 2328 /** 2329 * Long press. 2330 * 2331 * @syscap SystemCapability.Web.Webview.Core 2332 * @atomicservice 2333 * @since 11 2334 */ 2335 LongPress, 2336} 2337 2338/** 2339 * Defines the context menu media type, related to {@link onContextMenuShow} method. 2340 * 2341 * @enum { number } 2342 * @syscap SystemCapability.Web.Webview.Core 2343 * @since 9 2344 */ 2345/** 2346 * Defines the context menu media type, related to {@link onContextMenuShow} method. 2347 * 2348 * @enum { number } 2349 * @syscap SystemCapability.Web.Webview.Core 2350 * @atomicservice 2351 * @since 11 2352 */ 2353declare enum ContextMenuMediaType { 2354 /** 2355 * Not a special node or other media types. 2356 * 2357 * @syscap SystemCapability.Web.Webview.Core 2358 * @since 9 2359 */ 2360 /** 2361 * Not a special node or other media types. 2362 * 2363 * @syscap SystemCapability.Web.Webview.Core 2364 * @atomicservice 2365 * @since 11 2366 */ 2367 None, 2368 2369 /** 2370 * Image. 2371 * 2372 * @syscap SystemCapability.Web.Webview.Core 2373 * @since 9 2374 */ 2375 /** 2376 * Image. 2377 * 2378 * @syscap SystemCapability.Web.Webview.Core 2379 * @atomicservice 2380 * @since 11 2381 */ 2382 Image, 2383} 2384 2385/** 2386 * Defines the context menu input field type, related to {@link onContextMenuShow} method. 2387 * 2388 * @enum { number } 2389 * @syscap SystemCapability.Web.Webview.Core 2390 * @since 9 2391 */ 2392/** 2393 * Defines the context menu input field type, related to {@link onContextMenuShow} method. 2394 * 2395 * @enum { number } 2396 * @syscap SystemCapability.Web.Webview.Core 2397 * @atomicservice 2398 * @since 11 2399 */ 2400declare enum ContextMenuInputFieldType { 2401 /** 2402 * Not an input field. 2403 * 2404 * @syscap SystemCapability.Web.Webview.Core 2405 * @since 9 2406 */ 2407 /** 2408 * Not an input field. 2409 * 2410 * @syscap SystemCapability.Web.Webview.Core 2411 * @atomicservice 2412 * @since 11 2413 */ 2414 None, 2415 2416 /** 2417 * The plain text type. 2418 * 2419 * @syscap SystemCapability.Web.Webview.Core 2420 * @since 9 2421 */ 2422 /** 2423 * The plain text type. 2424 * 2425 * @syscap SystemCapability.Web.Webview.Core 2426 * @atomicservice 2427 * @since 11 2428 */ 2429 PlainText, 2430 2431 /** 2432 * The password type. 2433 * 2434 * @syscap SystemCapability.Web.Webview.Core 2435 * @since 9 2436 */ 2437 /** 2438 * The password type. 2439 * 2440 * @syscap SystemCapability.Web.Webview.Core 2441 * @atomicservice 2442 * @since 11 2443 */ 2444 Password, 2445 2446 /** 2447 * The number type. 2448 * 2449 * @syscap SystemCapability.Web.Webview.Core 2450 * @since 9 2451 */ 2452 /** 2453 * The number type. 2454 * 2455 * @syscap SystemCapability.Web.Webview.Core 2456 * @atomicservice 2457 * @since 11 2458 */ 2459 Number, 2460 2461 /** 2462 * The telephone type. 2463 * 2464 * @syscap SystemCapability.Web.Webview.Core 2465 * @since 9 2466 */ 2467 /** 2468 * The telephone type. 2469 * 2470 * @syscap SystemCapability.Web.Webview.Core 2471 * @atomicservice 2472 * @since 11 2473 */ 2474 Telephone, 2475 2476 /** 2477 * Other types. 2478 * 2479 * @syscap SystemCapability.Web.Webview.Core 2480 * @since 9 2481 */ 2482 /** 2483 * Other types. 2484 * 2485 * @syscap SystemCapability.Web.Webview.Core 2486 * @atomicservice 2487 * @since 11 2488 */ 2489 Other, 2490} 2491 2492/** 2493 * Defines the embed status, related to {@link NativeEmbedDataInfo}. 2494 * 2495 * @enum { number } 2496 * @syscap SystemCapability.Web.Webview.Core 2497 * @atomicservice 2498 * @since 11 2499 */ 2500declare enum NativeEmbedStatus { 2501 2502 /** 2503 * The embed tag create. 2504 * 2505 * @syscap SystemCapability.Web.Webview.Core 2506 * @atomicservice 2507 * @since 11 2508 */ 2509 CREATE = 0, 2510 2511 /** 2512 * The embed tag update. 2513 * 2514 * @syscap SystemCapability.Web.Webview.Core 2515 * @atomicservice 2516 * @since 11 2517 */ 2518 UPDATE = 1, 2519 2520 /** 2521 * The embed tag destroy. 2522 * 2523 * @syscap SystemCapability.Web.Webview.Core 2524 * @atomicservice 2525 * @since 11 2526 */ 2527 DESTROY = 2, 2528 2529 /** 2530 * The embed tag enter backforward cache. 2531 * 2532 * @syscap SystemCapability.Web.Webview.Core 2533 * @atomicservice 2534 * @since 12 2535 */ 2536 ENTER_BFCACHE = 3, 2537 2538 /** 2539 * The embed tag leave backforward cache. 2540 * 2541 * @syscap SystemCapability.Web.Webview.Core 2542 * @atomicservice 2543 * @since 12 2544 */ 2545 LEAVE_BFCACHE = 4, 2546} 2547 2548/** 2549 * Defines the context menu supported event bit flags, related to {@link onContextMenuShow} method. 2550 * 2551 * @enum { number } 2552 * @syscap SystemCapability.Web.Webview.Core 2553 * @since 9 2554 */ 2555/** 2556 * Defines the context menu supported event bit flags, related to {@link onContextMenuShow} method. 2557 * 2558 * @enum { number } 2559 * @syscap SystemCapability.Web.Webview.Core 2560 * @atomicservice 2561 * @since 11 2562 */ 2563declare enum ContextMenuEditStateFlags { 2564 /** 2565 * Not editable. 2566 * 2567 * @syscap SystemCapability.Web.Webview.Core 2568 * @since 9 2569 */ 2570 /** 2571 * Not editable. 2572 * 2573 * @syscap SystemCapability.Web.Webview.Core 2574 * @atomicservice 2575 * @since 11 2576 */ 2577 NONE = 0, 2578 /** 2579 * Clipping is supported. 2580 * 2581 * @syscap SystemCapability.Web.Webview.Core 2582 * @since 9 2583 */ 2584 /** 2585 * Clipping is supported. 2586 * 2587 * @syscap SystemCapability.Web.Webview.Core 2588 * @atomicservice 2589 * @since 11 2590 */ 2591 CAN_CUT = 1 << 0, 2592 /** 2593 * Copies are supported. 2594 * 2595 * @syscap SystemCapability.Web.Webview.Core 2596 * @since 9 2597 */ 2598 /** 2599 * Copies are supported. 2600 * 2601 * @syscap SystemCapability.Web.Webview.Core 2602 * @atomicservice 2603 * @since 11 2604 */ 2605 CAN_COPY = 1 << 1, 2606 /** 2607 * Support for pasting. 2608 * 2609 * @syscap SystemCapability.Web.Webview.Core 2610 * @since 9 2611 */ 2612 /** 2613 * Support for pasting. 2614 * 2615 * @syscap SystemCapability.Web.Webview.Core 2616 * @atomicservice 2617 * @since 11 2618 */ 2619 CAN_PASTE = 1 << 2, 2620 /** 2621 * Select all is supported. 2622 * 2623 * @syscap SystemCapability.Web.Webview.Core 2624 * @since 9 2625 */ 2626 /** 2627 * Select all is supported. 2628 * 2629 * @syscap SystemCapability.Web.Webview.Core 2630 * @atomicservice 2631 * @since 11 2632 */ 2633 CAN_SELECT_ALL = 1 << 3, 2634} 2635 2636/** 2637 * Enum type supplied to {@link navigationType} for the navigation's type. 2638 * 2639 * @enum { number } 2640 * @syscap SystemCapability.Web.Webview.Core 2641 * @atomicservice 2642 * @since 11 2643 */ 2644declare enum WebNavigationType { 2645 /** 2646 * Unknown type. 2647 * 2648 * @syscap SystemCapability.Web.Webview.Core 2649 * @atomicservice 2650 * @since 11 2651 */ 2652 UNKNOWN = 0, 2653 2654 /** 2655 * A new entry was created due to a navigation happened on the main frame. 2656 * Contains all situations that will generate a mainframe navigation entry, 2657 * which means that navigations to a hash on the same document or history.pushState 2658 * also belong to this type. 2659 * 2660 * @syscap SystemCapability.Web.Webview.Core 2661 * @atomicservice 2662 * @since 11 2663 */ 2664 MAIN_FRAME_NEW_ENTRY = 1, 2665 2666 /** 2667 * Navigate to an existing entry due to a navigation on the main frame. 2668 * e.g. 2669 * 1. History navigations. 2670 * 2. Reloads (contains loading the same url). 2671 * 3. Same-document navigations(history.replaceState(), location.replace()). 2672 * 2673 * @syscap SystemCapability.Web.Webview.Core 2674 * @atomicservice 2675 * @since 11 2676 */ 2677 MAIN_FRAME_EXISTING_ENTRY = 2, 2678 2679 /** 2680 * A navigation happened on subframe which was triggered by user. 2681 * 2682 * @syscap SystemCapability.Web.Webview.Core 2683 * @atomicservice 2684 * @since 11 2685 */ 2686 NAVIGATION_TYPE_NEW_SUBFRAME = 4, 2687 2688 /** 2689 * A navigation happened on the subframe automatically. 2690 * 2691 * @syscap SystemCapability.Web.Webview.Core 2692 * @atomicservice 2693 * @since 11 2694 */ 2695 NAVIGATION_TYPE_AUTO_SUBFRAME = 5, 2696} 2697 2698 2699/** 2700 * Defines the web render mode, related to {@link RenderMode}. 2701 * 2702 * @enum { number } 2703 * @syscap SystemCapability.Web.Webview.Core 2704 * @atomicservice 2705 * @since 12 2706 */ 2707declare enum RenderMode { 2708 /** 2709 * Web and arkui render asynchronously 2710 * 2711 * @syscap SystemCapability.Web.Webview.Core 2712 * @atomicservice 2713 * @since 12 2714 */ 2715 ASYNC_RENDER = 0, 2716 2717 /** 2718 * Web and arkui render synchronously 2719 * 2720 * @syscap SystemCapability.Web.Webview.Core 2721 * @atomicservice 2722 * @since 12 2723 */ 2724 SYNC_RENDER = 1, 2725} 2726 2727/** 2728 * Defines the viewport-fit type, related to {@link ViewportFit}. 2729 * 2730 * @enum { number } 2731 * @syscap SystemCapability.Web.Webview.Core 2732 * @atomicservice 2733 * @since 12 2734 */ 2735declare enum ViewportFit { 2736 /** 2737 * No effect - the whole web page is viewable(default) 2738 * 2739 * @syscap SystemCapability.Web.Webview.Core 2740 * @atomicservice 2741 * @since 12 2742 */ 2743 AUTO = 0, 2744 2745 /** 2746 * The initial layout viewport and the visual viewport are set to the 2747 * largest rectangle which is inscribe in the display of the device. 2748 * 2749 * @syscap SystemCapability.Web.Webview.Core 2750 * @atomicservice 2751 * @since 12 2752 */ 2753 CONTAINS = 1, 2754 2755 /** 2756 * The initial layout viewport and the visual viewport are set to the 2757 * circumscribe rectangle of the physical screen of the device. 2758 * 2759 * @syscap SystemCapability.Web.Webview.Core 2760 * @atomicservice 2761 * @since 12 2762 */ 2763 COVER = 2, 2764} 2765 2766/** 2767 * Defines the context menu param, related to {@link WebContextMenuParam} method. 2768 * 2769 * @syscap SystemCapability.Web.Webview.Core 2770 * @since 9 2771 */ 2772/** 2773 * Defines the context menu param, related to {@link WebContextMenuParam} method. 2774 * 2775 * @syscap SystemCapability.Web.Webview.Core 2776 * @atomicservice 2777 * @since 11 2778 */ 2779declare class WebContextMenuParam { 2780 /** 2781 * Constructor. 2782 * 2783 * @syscap SystemCapability.Web.Webview.Core 2784 * @since 9 2785 */ 2786 /** 2787 * Constructor. 2788 * 2789 * @syscap SystemCapability.Web.Webview.Core 2790 * @atomicservice 2791 * @since 11 2792 */ 2793 constructor(); 2794 2795 /** 2796 * Horizontal offset coordinates of the menu within the Web component. 2797 * 2798 * @returns { number } The context menu x coordinate. 2799 * @syscap SystemCapability.Web.Webview.Core 2800 * @since 9 2801 */ 2802 /** 2803 * Horizontal offset coordinates of the menu within the Web component. 2804 * 2805 * @returns { number } The context menu x coordinate. 2806 * @syscap SystemCapability.Web.Webview.Core 2807 * @atomicservice 2808 * @since 11 2809 */ 2810 x(): number; 2811 2812 /** 2813 * Vertical offset coordinates for the menu within the Web component. 2814 * 2815 * @returns { number } The context menu y coordinate. 2816 * @syscap SystemCapability.Web.Webview.Core 2817 * @since 9 2818 */ 2819 /** 2820 * Vertical offset coordinates for the menu within the Web component. 2821 * 2822 * @returns { number } The context menu y coordinate. 2823 * @syscap SystemCapability.Web.Webview.Core 2824 * @atomicservice 2825 * @since 11 2826 */ 2827 y(): number; 2828 2829 /** 2830 * If the long-press location is the link returns the link's security-checked URL. 2831 * 2832 * @returns { string } If relate to a link return link url, else return null. 2833 * @syscap SystemCapability.Web.Webview.Core 2834 * @since 9 2835 */ 2836 /** 2837 * If the long-press location is the link returns the link's security-checked URL. 2838 * 2839 * @returns { string } If relate to a link return link url, else return null. 2840 * @syscap SystemCapability.Web.Webview.Core 2841 * @atomicservice 2842 * @since 11 2843 */ 2844 getLinkUrl(): string; 2845 2846 /** 2847 * If the long-press location is the link returns the link's original URL. 2848 * 2849 * @returns { string } If relate to a link return unfiltered link url, else return null. 2850 * @syscap SystemCapability.Web.Webview.Core 2851 * @since 9 2852 */ 2853 /** 2854 * If the long-press location is the link returns the link's original URL. 2855 * 2856 * @returns { string } If relate to a link return unfiltered link url, else return null. 2857 * @syscap SystemCapability.Web.Webview.Core 2858 * @atomicservice 2859 * @since 11 2860 */ 2861 getUnfilteredLinkUrl(): string; 2862 2863 /** 2864 * Returns the SRC URL if the selected element has a SRC attribute. 2865 * 2866 * @returns { string } If this context menu is "src" attribute, return link url, else return null. 2867 * @syscap SystemCapability.Web.Webview.Core 2868 * @since 9 2869 */ 2870 /** 2871 * Returns the SRC URL if the selected element has a SRC attribute. 2872 * 2873 * @returns { string } If this context menu is "src" attribute, return link url, else return null. 2874 * @syscap SystemCapability.Web.Webview.Core 2875 * @atomicservice 2876 * @since 11 2877 */ 2878 getSourceUrl(): string; 2879 2880 /** 2881 * Long press menu location has image content. 2882 * 2883 * @returns { boolean } Return whether this context menu has image content. 2884 * @syscap SystemCapability.Web.Webview.Core 2885 * @since 9 2886 */ 2887 /** 2888 * Long press menu location has image content. 2889 * 2890 * @returns { boolean } Return whether this context menu has image content. 2891 * @syscap SystemCapability.Web.Webview.Core 2892 * @atomicservice 2893 * @since 11 2894 */ 2895 existsImageContents(): boolean; 2896 2897 /** 2898 * Returns the type of context node. 2899 * 2900 * @returns { ContextMenuMediaType } Returns the type of context node. 2901 * @syscap SystemCapability.Web.Webview.Core 2902 * @since 9 2903 */ 2904 /** 2905 * Returns the type of context node. 2906 * 2907 * @returns { ContextMenuMediaType } Returns the type of context node. 2908 * @syscap SystemCapability.Web.Webview.Core 2909 * @atomicservice 2910 * @since 11 2911 */ 2912 getMediaType(): ContextMenuMediaType; 2913 2914 /** 2915 * Returns the text of the selection. 2916 * 2917 * @returns { string } Returns the text of the selection. 2918 * @syscap SystemCapability.Web.Webview.Core 2919 * @since 9 2920 */ 2921 /** 2922 * Returns the text of the selection. 2923 * 2924 * @returns { string } Returns the text of the selection. 2925 * @syscap SystemCapability.Web.Webview.Core 2926 * @atomicservice 2927 * @since 11 2928 */ 2929 getSelectionText(): string; 2930 2931 /** 2932 * Returns the context menu source type. 2933 * 2934 * @returns { ContextMenuSourceType } 2935 * @syscap SystemCapability.Web.Webview.Core 2936 * @since 9 2937 */ 2938 /** 2939 * Returns the context menu source type. 2940 * 2941 * @returns { ContextMenuSourceType } 2942 * @syscap SystemCapability.Web.Webview.Core 2943 * @atomicservice 2944 * @since 11 2945 */ 2946 getSourceType(): ContextMenuSourceType; 2947 2948 /** 2949 * Returns input field type if the context menu was invoked on an input field. 2950 * 2951 * @returns { ContextMenuInputFieldType } Input field type if the context menu was invoked on an input field. 2952 * @syscap SystemCapability.Web.Webview.Core 2953 * @since 9 2954 */ 2955 /** 2956 * Returns input field type if the context menu was invoked on an input field. 2957 * 2958 * @returns { ContextMenuInputFieldType } Input field type if the context menu was invoked on an input field. 2959 * @syscap SystemCapability.Web.Webview.Core 2960 * @atomicservice 2961 * @since 11 2962 */ 2963 getInputFieldType(): ContextMenuInputFieldType; 2964 2965 /** 2966 * Returns whether the context is editable. 2967 * 2968 * @returns { boolean } 2969 * @syscap SystemCapability.Web.Webview.Core 2970 * @since 9 2971 */ 2972 /** 2973 * Returns whether the context is editable. 2974 * 2975 * @returns { boolean } 2976 * @syscap SystemCapability.Web.Webview.Core 2977 * @atomicservice 2978 * @since 11 2979 */ 2980 isEditable(): boolean; 2981 2982 /** 2983 * Returns the context editable flags {@link ContextMenuEditStateFlags}. 2984 * 2985 * @returns { number } 2986 * @syscap SystemCapability.Web.Webview.Core 2987 * @since 9 2988 */ 2989 /** 2990 * Returns the context editable flags {@link ContextMenuEditStateFlags}. 2991 * 2992 * @returns { number } 2993 * @syscap SystemCapability.Web.Webview.Core 2994 * @atomicservice 2995 * @since 11 2996 */ 2997 getEditStateFlags(): number; 2998 2999 /** 3000 * Returns the selection menu preview width. 3001 * 3002 * @returns { number } The preview menu width. 3003 * @syscap SystemCapability.Web.Webview.Core 3004 * @since 13 3005 */ 3006 getPreviewWidth(): number; 3007 3008 /** 3009 * Returns the selection menu preview height. 3010 * 3011 * @returns { number } The preview menu height. 3012 * @syscap SystemCapability.Web.Webview.Core 3013 * @since 13 3014 */ 3015 getPreviewHeight(): number; 3016} 3017 3018/** 3019 * Defines the context menu result, related to {@link WebContextMenuResult} method. 3020 * 3021 * @syscap SystemCapability.Web.Webview.Core 3022 * @since 9 3023 */ 3024/** 3025 * Defines the context menu result, related to {@link WebContextMenuResult} method. 3026 * 3027 * @syscap SystemCapability.Web.Webview.Core 3028 * @atomicservice 3029 * @since 11 3030 */ 3031declare class WebContextMenuResult { 3032 /** 3033 * Constructor. 3034 * 3035 * @syscap SystemCapability.Web.Webview.Core 3036 * @since 9 3037 */ 3038 /** 3039 * Constructor. 3040 * 3041 * @syscap SystemCapability.Web.Webview.Core 3042 * @atomicservice 3043 * @since 11 3044 */ 3045 constructor(); 3046 3047 /** 3048 * When close context menu without other call in WebContextMenuResult, 3049 * User should call this function to close menu 3050 * 3051 * @syscap SystemCapability.Web.Webview.Core 3052 * @since 9 3053 */ 3054 /** 3055 * When close context menu without other call in WebContextMenuResult, 3056 * User should call this function to close menu 3057 * 3058 * @syscap SystemCapability.Web.Webview.Core 3059 * @atomicservice 3060 * @since 11 3061 */ 3062 closeContextMenu(): void; 3063 3064 /** 3065 * If WebContextMenuParam has image content, this function will copy image related to this context menu. 3066 * If WebContextMenuParam has no image content, this function will do nothing. 3067 * 3068 * @syscap SystemCapability.Web.Webview.Core 3069 * @since 9 3070 */ 3071 /** 3072 * If WebContextMenuParam has image content, this function will copy image related to this context menu. 3073 * If WebContextMenuParam has no image content, this function will do nothing. 3074 * 3075 * @syscap SystemCapability.Web.Webview.Core 3076 * @atomicservice 3077 * @since 11 3078 */ 3079 copyImage(): void; 3080 3081 /** 3082 * Executes the copy operation related to this context menu. 3083 * 3084 * @syscap SystemCapability.Web.Webview.Core 3085 * @since 9 3086 */ 3087 /** 3088 * Executes the copy operation related to this context menu. 3089 * 3090 * @syscap SystemCapability.Web.Webview.Core 3091 * @atomicservice 3092 * @since 11 3093 */ 3094 copy(): void; 3095 3096 /** 3097 * Executes the paste operation related to this context menu. 3098 * 3099 * @syscap SystemCapability.Web.Webview.Core 3100 * @since 9 3101 */ 3102 /** 3103 * Executes the paste operation related to this context menu. 3104 * 3105 * @syscap SystemCapability.Web.Webview.Core 3106 * @atomicservice 3107 * @since 11 3108 */ 3109 paste(): void; 3110 3111 /** 3112 * Executes the cut operation related to this context menu. 3113 * 3114 * @syscap SystemCapability.Web.Webview.Core 3115 * @since 9 3116 */ 3117 /** 3118 * Executes the cut operation related to this context menu. 3119 * 3120 * @syscap SystemCapability.Web.Webview.Core 3121 * @atomicservice 3122 * @since 11 3123 */ 3124 cut(): void; 3125 3126 /** 3127 * Executes the selectAll operation related to this context menu. 3128 * 3129 * @syscap SystemCapability.Web.Webview.Core 3130 * @since 9 3131 */ 3132 /** 3133 * Executes the selectAll operation related to this context menu. 3134 * 3135 * @syscap SystemCapability.Web.Webview.Core 3136 * @atomicservice 3137 * @since 11 3138 */ 3139 selectAll(): void; 3140} 3141 3142/** 3143 * Encompassed message information as parameters to {@link onConsole} method. 3144 * 3145 * @syscap SystemCapability.Web.Webview.Core 3146 * @since 8 3147 */ 3148/** 3149 * Encompassed message information as parameters to {@link onConsole} method. 3150 * 3151 * @syscap SystemCapability.Web.Webview.Core 3152 * @crossplatform 3153 * @atomicservice 3154 * @since 11 3155 */ 3156declare class ConsoleMessage { 3157 /** 3158 * Constructor. 3159 * 3160 * @param { string } message - The console message. 3161 * @param { string } sourceId - The Web source file's path and name. 3162 * @param { number } lineNumber - The line number of the console message. 3163 * @param { MessageLevel } messageLevel - The console log level. 3164 * @syscap SystemCapability.Web.Webview.Core 3165 * @since 8 3166 * @deprecated since 9 3167 * @useinstead ohos.web.ConsoleMessage#constructor 3168 */ 3169 constructor(message: string, sourceId: string, lineNumber: number, messageLevel: MessageLevel); 3170 3171 /** 3172 * Constructor. 3173 * 3174 * @syscap SystemCapability.Web.Webview.Core 3175 * @since 9 3176 */ 3177 /** 3178 * Constructor. 3179 * 3180 * @syscap SystemCapability.Web.Webview.Core 3181 * @crossplatform 3182 * @atomicservice 3183 * @since 11 3184 */ 3185 constructor(); 3186 3187 /** 3188 * Gets the message of a console message. 3189 * 3190 * @returns { string } Return the message of a console message. 3191 * @syscap SystemCapability.Web.Webview.Core 3192 * @since 8 3193 */ 3194 /** 3195 * Gets the message of a console message. 3196 * 3197 * @returns { string } Return the message of a console message. 3198 * @syscap SystemCapability.Web.Webview.Core 3199 * @crossplatform 3200 * @atomicservice 3201 * @since 11 3202 */ 3203 getMessage(): string; 3204 3205 /** 3206 * Gets the Web source file's path and name of a console message. 3207 * 3208 * @returns { string } Return the Web source file's path and name of a console message. 3209 * @syscap SystemCapability.Web.Webview.Core 3210 * @since 8 3211 */ 3212 /** 3213 * Gets the Web source file's path and name of a console message. 3214 * 3215 * @returns { string } Return the Web source file's path and name of a console message. 3216 * @syscap SystemCapability.Web.Webview.Core 3217 * @atomicservice 3218 * @since 11 3219 */ 3220 getSourceId(): string; 3221 3222 /** 3223 * Gets the line number of a console message. 3224 * 3225 * @returns { number } Return the line number of a console message. 3226 * @syscap SystemCapability.Web.Webview.Core 3227 * @since 8 3228 */ 3229 /** 3230 * Gets the line number of a console message. 3231 * 3232 * @returns { number } Return the line number of a console message. 3233 * @syscap SystemCapability.Web.Webview.Core 3234 * @atomicservice 3235 * @since 11 3236 */ 3237 getLineNumber(): number; 3238 3239 /** 3240 * Gets the message level of a console message. 3241 * 3242 * @returns { MessageLevel } Return the message level of a console message, which can be {@link MessageLevel}. 3243 * @syscap SystemCapability.Web.Webview.Core 3244 * @since 8 3245 */ 3246 /** 3247 * Gets the message level of a console message. 3248 * 3249 * @returns { MessageLevel } Return the message level of a console message, which can be {@link MessageLevel}. 3250 * @syscap SystemCapability.Web.Webview.Core 3251 * @crossplatform 3252 * @atomicservice 3253 * @since 11 3254 */ 3255 getMessageLevel(): MessageLevel; 3256} 3257 3258/** 3259 * Encompassed message information as parameters to {@link onConsole} method. 3260 * 3261 * @syscap SystemCapability.Web.Webview.Core 3262 * @since 8 3263 */ 3264/** 3265 * Defines the Web resource request. 3266 * 3267 * @syscap SystemCapability.Web.Webview.Core 3268 * @since 8 3269 */ 3270/** 3271 * Defines the Web resource request. 3272 * 3273 * @syscap SystemCapability.Web.Webview.Core 3274 * @crossplatform 3275 * @since 10 3276 */ 3277/** 3278 * Defines the Web resource request. 3279 * 3280 * @syscap SystemCapability.Web.Webview.Core 3281 * @crossplatform 3282 * @atomicservice 3283 * @since 11 3284 */ 3285declare class WebResourceRequest { 3286 /** 3287 * Constructor. 3288 * 3289 * @syscap SystemCapability.Web.Webview.Core 3290 * @since 8 3291 */ 3292 /** 3293 * Constructor. 3294 * 3295 * @syscap SystemCapability.Web.Webview.Core 3296 * @crossplatform 3297 * @since 10 3298 */ 3299 /** 3300 * Constructor. 3301 * 3302 * @syscap SystemCapability.Web.Webview.Core 3303 * @crossplatform 3304 * @atomicservice 3305 * @since 11 3306 */ 3307 constructor(); 3308 3309 /** 3310 * Gets request headers. 3311 * 3312 * @returns { Array<Header> } Return the request headers 3313 * @syscap SystemCapability.Web.Webview.Core 3314 * @since 8 3315 */ 3316 /** 3317 * Gets request headers. 3318 * 3319 * @returns { Array<Header> } Return the request headers 3320 * @syscap SystemCapability.Web.Webview.Core 3321 * @atomicservice 3322 * @since 11 3323 */ 3324 getRequestHeader(): Array<Header>; 3325 3326 /** 3327 * Gets the request URL. 3328 * 3329 * @returns { string } Return the request URL. 3330 * @syscap SystemCapability.Web.Webview.Core 3331 * @since 8 3332 */ 3333 /** 3334 * Gets the request URL. 3335 * 3336 * @returns { string } Return the request URL. 3337 * @syscap SystemCapability.Web.Webview.Core 3338 * @crossplatform 3339 * @since 10 3340 */ 3341 /** 3342 * Gets the request URL. 3343 * 3344 * @returns { string } Return the request URL. 3345 * @syscap SystemCapability.Web.Webview.Core 3346 * @crossplatform 3347 * @atomicservice 3348 * @since 11 3349 */ 3350 getRequestUrl(): string; 3351 3352 /** 3353 * Check whether the request is associated with gesture. 3354 * 3355 * @returns { boolean } Return {@code true} if the request is associated with gesture;return {@code false} otherwise. 3356 * @syscap SystemCapability.Web.Webview.Core 3357 * @since 8 3358 */ 3359 /** 3360 * Check whether the request is associated with gesture. 3361 * 3362 * @returns { boolean } Return {@code true} if the request is associated with gesture;return {@code false} otherwise. 3363 * @syscap SystemCapability.Web.Webview.Core 3364 * @atomicservice 3365 * @since 11 3366 */ 3367 isRequestGesture(): boolean; 3368 3369 /** 3370 * Check whether the request is for getting the main frame. 3371 * 3372 * @returns { boolean } Return {@code true} if the request is associated with gesture for getting the main frame; return {@code false} otherwise. 3373 * @syscap SystemCapability.Web.Webview.Core 3374 * @since 8 3375 */ 3376 /** 3377 * Check whether the request is for getting the main frame. 3378 * 3379 * @returns { boolean } Return {@code true} if the request is associated with gesture for getting the main frame; return {@code false} otherwise. 3380 * @syscap SystemCapability.Web.Webview.Core 3381 * @atomicservice 3382 * @since 11 3383 */ 3384 isMainFrame(): boolean; 3385 3386 /** 3387 * Check whether the request redirects. 3388 * 3389 * @returns { boolean } Return {@code true} if the request redirects; return {@code false} otherwise. 3390 * @syscap SystemCapability.Web.Webview.Core 3391 * @since 8 3392 */ 3393 /** 3394 * Check whether the request redirects. 3395 * 3396 * @returns { boolean } Return {@code true} if the request redirects; return {@code false} otherwise. 3397 * @syscap SystemCapability.Web.Webview.Core 3398 * @atomicservice 3399 * @since 11 3400 */ 3401 isRedirect(): boolean; 3402 3403 /** 3404 * Get request method. 3405 * 3406 * @returns { string } Return the request method. 3407 * @syscap SystemCapability.Web.Webview.Core 3408 * @since 9 3409 */ 3410 /** 3411 * Get request method. 3412 * 3413 * @returns { string } Return the request method. 3414 * @syscap SystemCapability.Web.Webview.Core 3415 * @atomicservice 3416 * @since 11 3417 */ 3418 getRequestMethod(): string; 3419} 3420 3421/** 3422 * Defines the Web resource response. 3423 * 3424 * @syscap SystemCapability.Web.Webview.Core 3425 * @since 8 3426 */ 3427/** 3428 * Defines the Web resource response. 3429 * 3430 * @syscap SystemCapability.Web.Webview.Core 3431 * @crossplatform 3432 * @atomicservice 3433 * @since 11 3434 */ 3435declare class WebResourceResponse { 3436 /** 3437 * Constructor. 3438 * 3439 * @syscap SystemCapability.Web.Webview.Core 3440 * @since 8 3441 */ 3442 /** 3443 * Constructor. 3444 * 3445 * @syscap SystemCapability.Web.Webview.Core 3446 * @crossplatform 3447 * @atomicservice 3448 * @since 11 3449 */ 3450 constructor(); 3451 3452 /** 3453 * Gets the response data. 3454 * 3455 * @returns { string } Return the response data. 3456 * @syscap SystemCapability.Web.Webview.Core 3457 * @since 8 3458 */ 3459 /** 3460 * Gets the response data. 3461 * 3462 * @returns { string } Return the response data. 3463 * @syscap SystemCapability.Web.Webview.Core 3464 * @atomicservice 3465 * @since 11 3466 */ 3467 getResponseData(): string; 3468 3469 /** 3470 * Gets the response data. 3471 * 3472 * @returns { string | number | ArrayBuffer | Resource | undefined } Return the response data. 3473 * string type indicate string in HTML format. 3474 * number type indicate file handle. 3475 * Resource type indicate $rawfile resource. 3476 * ArrayBuffer type indicate binary data. 3477 * @syscap SystemCapability.Web.Webview.Core 3478 * @since 13 3479 */ 3480 getResponseDataEx(): string | number | ArrayBuffer | Resource | undefined; 3481 3482 /** 3483 * Gets the response encoding. 3484 * 3485 * @returns { string } Return the response encoding. 3486 * @syscap SystemCapability.Web.Webview.Core 3487 * @since 8 3488 */ 3489 /** 3490 * Gets the response encoding. 3491 * 3492 * @returns { string } Return the response encoding. 3493 * @syscap SystemCapability.Web.Webview.Core 3494 * @crossplatform 3495 * @atomicservice 3496 * @since 11 3497 */ 3498 getResponseEncoding(): string; 3499 3500 /** 3501 * Gets the response MIME type. 3502 * 3503 * @returns { string } Return the response MIME type. 3504 * @syscap SystemCapability.Web.Webview.Core 3505 * @since 8 3506 */ 3507 /** 3508 * Gets the response MIME type. 3509 * 3510 * @returns { string } Return the response MIME type. 3511 * @syscap SystemCapability.Web.Webview.Core 3512 * @crossplatform 3513 * @atomicservice 3514 * @since 11 3515 */ 3516 getResponseMimeType(): string; 3517 3518 /** 3519 * Gets the reason message. 3520 * 3521 * @returns { string } Return the reason message. 3522 * @syscap SystemCapability.Web.Webview.Core 3523 * @since 8 3524 */ 3525 /** 3526 * Gets the reason message. 3527 * 3528 * @returns { string } Return the reason message. 3529 * @syscap SystemCapability.Web.Webview.Core 3530 * @atomicservice 3531 * @since 11 3532 */ 3533 getReasonMessage(): string; 3534 3535 /** 3536 * Gets the response headers. 3537 * 3538 * @returns { Array<Header> } Return the response headers. 3539 * @syscap SystemCapability.Web.Webview.Core 3540 * @since 8 3541 */ 3542 /** 3543 * Gets the response headers. 3544 * 3545 * @returns { Array<Header> } Return the response headers. 3546 * @syscap SystemCapability.Web.Webview.Core 3547 * @atomicservice 3548 * @since 11 3549 */ 3550 getResponseHeader(): Array<Header>; 3551 3552 /** 3553 * Gets the response code. 3554 * 3555 * @returns { number } Return the response code. 3556 * @syscap SystemCapability.Web.Webview.Core 3557 * @since 8 3558 */ 3559 /** 3560 * Gets the response code. 3561 * 3562 * @returns { number } Return the response code. 3563 * @syscap SystemCapability.Web.Webview.Core 3564 * @crossplatform 3565 * @atomicservice 3566 * @since 11 3567 */ 3568 getResponseCode(): number; 3569 3570 /** 3571 * Sets the response data. 3572 * 3573 * @param { string | number | Resource } data - the response data. 3574 * @syscap SystemCapability.Web.Webview.Core 3575 * @since 9 3576 */ 3577 /** 3578 * Sets the response data. 3579 * 3580 * @param { string | number | Resource } data - the response data. 3581 * string type indicate strings in HTML format. 3582 * number type indicate file handle. 3583 * Resource type indicate $rawfile resource. 3584 * @syscap SystemCapability.Web.Webview.Core 3585 * @since 10 3586 */ 3587 /** 3588 * Sets the response data. 3589 * 3590 * @param { string | number | Resource | ArrayBuffer } data - the response data. 3591 * string type indicate strings in HTML format. 3592 * number type indicate file handle. 3593 * Resource type indicate $rawfile resource. 3594 * ArrayBuffer type indicate binary data. 3595 * @syscap SystemCapability.Web.Webview.Core 3596 * @atomicservice 3597 * @since 11 3598 */ 3599 setResponseData(data: string | number | Resource | ArrayBuffer): void; 3600 3601 /** 3602 * Sets the response encoding. 3603 * 3604 * @param { string } encoding the response encoding. 3605 * @syscap SystemCapability.Web.Webview.Core 3606 * @since 9 3607 */ 3608 /** 3609 * Sets the response encoding. 3610 * 3611 * @param { string } encoding the response encoding. 3612 * @syscap SystemCapability.Web.Webview.Core 3613 * @atomicservice 3614 * @since 11 3615 */ 3616 /** 3617 * Sets the response encoding. 3618 * 3619 * @param { string } encoding the response encoding. 3620 * @syscap SystemCapability.Web.Webview.Core 3621 * @atomicservice 3622 * @since 12 3623 */ 3624 setResponseEncoding(encoding: string): void; 3625 3626 /** 3627 * Sets the response MIME type. 3628 * 3629 * @param { string } mimeType the response MIME type. 3630 * @syscap SystemCapability.Web.Webview.Core 3631 * @since 9 3632 */ 3633 /** 3634 * Sets the response MIME type. 3635 * 3636 * @param { string } mimeType the response MIME type. 3637 * @syscap SystemCapability.Web.Webview.Core 3638 * @atomicservice 3639 * @since 11 3640 */ 3641 /** 3642 * Sets the response MIME type. 3643 * 3644 * @param { string } mimeType the response MIME type. 3645 * @syscap SystemCapability.Web.Webview.Core 3646 * @atomicservice 3647 * @since 12 3648 */ 3649 setResponseMimeType(mimeType: string): void; 3650 3651 /** 3652 * Sets the reason message. 3653 * 3654 * @param { string } reason the reason message. 3655 * @syscap SystemCapability.Web.Webview.Core 3656 * @since 9 3657 */ 3658 /** 3659 * Sets the reason message. 3660 * 3661 * @param { string } reason the reason message. 3662 * @syscap SystemCapability.Web.Webview.Core 3663 * @atomicservice 3664 * @since 11 3665 */ 3666 /** 3667 * Sets the reason message. 3668 * 3669 * @param { string } reason the reason message. 3670 * @syscap SystemCapability.Web.Webview.Core 3671 * @atomicservice 3672 * @since 12 3673 */ 3674 setReasonMessage(reason: string): void; 3675 3676 /** 3677 * Sets the response headers. 3678 * 3679 * @param { Array<Header> } header the response headers. 3680 * @syscap SystemCapability.Web.Webview.Core 3681 * @since 9 3682 */ 3683 /** 3684 * Sets the response headers. 3685 * 3686 * @param { Array<Header> } header the response headers. 3687 * @syscap SystemCapability.Web.Webview.Core 3688 * @atomicservice 3689 * @since 11 3690 */ 3691 /** 3692 * Sets the response headers. 3693 * 3694 * @param { Array<Header> } header the response headers. 3695 * @syscap SystemCapability.Web.Webview.Core 3696 * @atomicservice 3697 * @since 12 3698 */ 3699 setResponseHeader(header: Array<Header>): void; 3700 3701 /** 3702 * Sets the response code. 3703 * 3704 * @param { number } code the response code. 3705 * @syscap SystemCapability.Web.Webview.Core 3706 * @since 9 3707 */ 3708 /** 3709 * Sets the response code. 3710 * 3711 * @param { number } code the response code. 3712 * @syscap SystemCapability.Web.Webview.Core 3713 * @atomicservice 3714 * @since 11 3715 */ 3716 /** 3717 * Sets the response code. 3718 * 3719 * @param { number } code the response code. 3720 * @syscap SystemCapability.Web.Webview.Core 3721 * @atomicservice 3722 * @since 12 3723 */ 3724 setResponseCode(code: number): void; 3725 3726 /** 3727 * Sets the response is ready or not. 3728 * 3729 * @param { boolean } IsReady whether the response is ready. 3730 * @syscap SystemCapability.Web.Webview.Core 3731 * @since 9 3732 */ 3733 /** 3734 * Sets the response is ready or not. 3735 * 3736 * @param { boolean } IsReady whether the response is ready. 3737 * @syscap SystemCapability.Web.Webview.Core 3738 * @atomicservice 3739 * @since 11 3740 */ 3741 /** 3742 * Sets the response is ready or not. 3743 * 3744 * @param { boolean } IsReady whether the response is ready. 3745 * @syscap SystemCapability.Web.Webview.Core 3746 * @atomicservice 3747 * @since 12 3748 */ 3749 setResponseIsReady(IsReady: boolean): void; 3750 3751 /** 3752 * Gets whether the response is ready. 3753 * 3754 * @returns { boolean } True indicates the response data is ready and false is not ready. 3755 * @syscap SystemCapability.Web.Webview.Core 3756 * @since 13 3757 */ 3758 getResponseIsReady(): boolean; 3759} 3760 3761/** 3762 * Defines the Web's request/response header. 3763 * 3764 * @interface Header 3765 * @syscap SystemCapability.Web.Webview.Core 3766 * @since 8 3767 */ 3768/** 3769 * Defines the Web's request/response header. 3770 * 3771 * @interface Header 3772 * @syscap SystemCapability.Web.Webview.Core 3773 * @atomicservice 3774 * @since 11 3775 */ 3776/** 3777 * Defines the Web's request/response header. 3778 * 3779 * @typedef Header 3780 * @syscap SystemCapability.Web.Webview.Core 3781 * @atomicservice 3782 * @since 12 3783 */ 3784declare interface Header { 3785 /** 3786 * Gets the key of the request/response header. 3787 * 3788 * @type { string } 3789 * @syscap SystemCapability.Web.Webview.Core 3790 * @since 8 3791 */ 3792 /** 3793 * Gets the key of the request/response header. 3794 * 3795 * @type { string } 3796 * @syscap SystemCapability.Web.Webview.Core 3797 * @atomicservice 3798 * @since 11 3799 */ 3800 headerKey: string; 3801 3802 /** 3803 * Gets the value of the request/response header. 3804 * 3805 * @type { string } 3806 * @syscap SystemCapability.Web.Webview.Core 3807 * @since 8 3808 */ 3809 /** 3810 * Gets the value of the request/response header. 3811 * 3812 * @type { string } 3813 * @syscap SystemCapability.Web.Webview.Core 3814 * @atomicservice 3815 * @since 11 3816 */ 3817 headerValue: string; 3818} 3819 3820/** 3821 * Defines the Web resource error. 3822 * 3823 * @syscap SystemCapability.Web.Webview.Core 3824 * @since 8 3825 */ 3826/** 3827 * Defines the Web resource error. 3828 * 3829 * @syscap SystemCapability.Web.Webview.Core 3830 * @crossplatform 3831 * @since 10 3832 */ 3833/** 3834 * Defines the Web resource error. 3835 * 3836 * @syscap SystemCapability.Web.Webview.Core 3837 * @crossplatform 3838 * @atomicservice 3839 * @since 11 3840 */ 3841declare class WebResourceError { 3842 /** 3843 * Constructor. 3844 * 3845 * @syscap SystemCapability.Web.Webview.Core 3846 * @since 8 3847 */ 3848 /** 3849 * Constructor. 3850 * 3851 * @syscap SystemCapability.Web.Webview.Core 3852 * @crossplatform 3853 * @since 10 3854 */ 3855 /** 3856 * Constructor. 3857 * 3858 * @syscap SystemCapability.Web.Webview.Core 3859 * @crossplatform 3860 * @atomicservice 3861 * @since 11 3862 */ 3863 constructor(); 3864 3865 /** 3866 * Gets the info of the Web resource error. 3867 * 3868 * @returns { string } Return the info of the Web resource error. 3869 * @syscap SystemCapability.Web.Webview.Core 3870 * @since 8 3871 */ 3872 /** 3873 * Gets the info of the Web resource error. 3874 * 3875 * @returns { string } Return the info of the Web resource error. 3876 * @syscap SystemCapability.Web.Webview.Core 3877 * @crossplatform 3878 * @since 10 3879 */ 3880 /** 3881 * Gets the info of the Web resource error. 3882 * 3883 * @returns { string } Return the info of the Web resource error. 3884 * @syscap SystemCapability.Web.Webview.Core 3885 * @crossplatform 3886 * @atomicservice 3887 * @since 11 3888 */ 3889 getErrorInfo(): string; 3890 3891 /** 3892 * Gets the code of the Web resource error. 3893 * 3894 * @returns { number } Return the code of the Web resource error. 3895 * @syscap SystemCapability.Web.Webview.Core 3896 * @since 8 3897 */ 3898 /** 3899 * Gets the code of the Web resource error. 3900 * 3901 * @returns { number } Return the code of the Web resource error. 3902 * @syscap SystemCapability.Web.Webview.Core 3903 * @crossplatform 3904 * @since 10 3905 */ 3906 /** 3907 * Gets the code of the Web resource error. 3908 * 3909 * @returns { number } Return the code of the Web resource error. 3910 * @syscap SystemCapability.Web.Webview.Core 3911 * @crossplatform 3912 * @atomicservice 3913 * @since 11 3914 */ 3915 getErrorCode(): number; 3916} 3917 3918/** 3919 * Defines the js geolocation request. 3920 * 3921 * @syscap SystemCapability.Web.Webview.Core 3922 * @since 8 3923 */ 3924/** 3925 * Defines the js geolocation request. 3926 * 3927 * @syscap SystemCapability.Web.Webview.Core 3928 * @crossplatform 3929 * @atomicservice 3930 * @since 11 3931 */ 3932declare class JsGeolocation { 3933 /** 3934 * Constructor. 3935 * 3936 * @syscap SystemCapability.Web.Webview.Core 3937 * @since 8 3938 */ 3939 /** 3940 * Constructor. 3941 * 3942 * @syscap SystemCapability.Web.Webview.Core 3943 * @crossplatform 3944 * @atomicservice 3945 * @since 11 3946 */ 3947 constructor(); 3948 3949 /** 3950 * Report the geolocation permission status from users. 3951 * 3952 * @param { string } origin - The origin that ask for the geolocation permission. 3953 * @param { boolean } allow - The geolocation permission status. 3954 * @param { boolean } retain - Whether to allow the geolocation permission status to be saved to the system. 3955 * @syscap SystemCapability.Web.Webview.Core 3956 * @since 8 3957 */ 3958 /** 3959 * Report the geolocation permission status from users. 3960 * 3961 * @param { string } origin - The origin that ask for the geolocation permission. 3962 * @param { boolean } allow - The geolocation permission status. 3963 * @param { boolean } retain - Whether to allow the geolocation permission status to be saved to the system. 3964 * @syscap SystemCapability.Web.Webview.Core 3965 * @crossplatform 3966 * @atomicservice 3967 * @since 11 3968 */ 3969 invoke(origin: string, allow: boolean, retain: boolean): void; 3970} 3971 3972/** 3973 * Defines the Web cookie. 3974 * 3975 * @syscap SystemCapability.Web.Webview.Core 3976 * @since 8 3977 */ 3978/** 3979 * Defines the Web cookie. 3980 * 3981 * @syscap SystemCapability.Web.Webview.Core 3982 * @atomicservice 3983 * @since 11 3984 */ 3985declare class WebCookie { 3986 /** 3987 * Constructor. 3988 * 3989 * @syscap SystemCapability.Web.Webview.Core 3990 * @since 8 3991 */ 3992 /** 3993 * Constructor. 3994 * 3995 * @syscap SystemCapability.Web.Webview.Core 3996 * @atomicservice 3997 * @since 11 3998 */ 3999 constructor(); 4000 4001 /** 4002 * Sets the cookie. 4003 * 4004 * @syscap SystemCapability.Web.Webview.Core 4005 * @since 8 4006 * @deprecated since 9 4007 * @useinstead ohos.web.webview.webview.WebCookieManager#setCookie 4008 */ 4009 setCookie(); 4010 4011 /** 4012 * Saves the cookies. 4013 * 4014 * @syscap SystemCapability.Web.Webview.Core 4015 * @since 8 4016 * @deprecated since 9 4017 * @useinstead ohos.web.webview.webview.WebCookieManager#saveCookieAsync 4018 */ 4019 saveCookie(); 4020} 4021 4022/** 4023 * Defines the touch event result. 4024 * 4025 * @syscap SystemCapability.Web.Webview.Core 4026 * @atomicservice 4027 * @since 12 4028 */ 4029declare class EventResult { 4030 /** 4031 * Constructor. 4032 * 4033 * @syscap SystemCapability.Web.Webview.Core 4034 * @atomicservice 4035 * @since 12 4036 */ 4037 constructor(); 4038 4039 /** 4040 * Set whether the event is consumed. 4041 * 4042 * @param { boolean } result - True if the event is consumed. 4043 * @syscap SystemCapability.Web.Webview.Core 4044 * @atomicservice 4045 * @since 12 4046 */ 4047 setGestureEventResult(result: boolean): void; 4048 4049 /** 4050 * Set whether the event is consumed. 4051 * 4052 * @param { boolean } result - True if the event is consumed. 4053 * @param { boolean } stopPropagation - Stops the propagation of events farther along.Default value is true. 4054 * @syscap SystemCapability.Web.Webview.Core 4055 * @since 14 4056 */ 4057 setGestureEventResult(result: boolean, stopPropagation: boolean): void; 4058} 4059 4060/** 4061 * Defines the Web controller. 4062 * 4063 * @syscap SystemCapability.Web.Webview.Core 4064 * @since 8 4065 * @deprecated since 9 4066 * @useinstead ohos.web.webview.webview.WebviewController 4067 */ 4068declare class WebController { 4069 /** 4070 * Constructor. 4071 * 4072 * @syscap SystemCapability.Web.Webview.Core 4073 * @since 8 4074 * @deprecated since 9 4075 */ 4076 constructor(); 4077 4078 /** 4079 * Let the Web inactive. 4080 * 4081 * @syscap SystemCapability.Web.Webview.Core 4082 * @since 8 4083 * @deprecated since 9 4084 * @useinstead ohos.web.webview.webview.WebviewController#onInactive 4085 */ 4086 onInactive(): void; 4087 4088 /** 4089 * Let the Web active. 4090 * 4091 * @syscap SystemCapability.Web.Webview.Core 4092 * @since 8 4093 * @deprecated since 9 4094 * @useinstead ohos.web.webview.webview.WebviewController#onActive 4095 */ 4096 onActive(): void; 4097 4098 /** 4099 * Let the Web zoom by. 4100 * 4101 * @param { number } factor The zoom factor. 4102 * @syscap SystemCapability.Web.Webview.Core 4103 * @since 8 4104 * @deprecated since 9 4105 * @useinstead ohos.web.webview.webview.WebviewController#zoom 4106 */ 4107 zoom(factor: number): void; 4108 4109 /** 4110 * Clears the history in the Web. 4111 * 4112 * @syscap SystemCapability.Web.Webview.Core 4113 * @since 8 4114 * @deprecated since 9 4115 * @useinstead ohos.web.webview.webview.WebviewController#clearHistory 4116 */ 4117 clearHistory(): void; 4118 4119 /** 4120 * Loads a piece of code and execute JS code in the context of the currently displayed page. 4121 * 4122 * @param { object } options The options with a piece of code and a callback. 4123 * @syscap SystemCapability.Web.Webview.Core 4124 * @since 8 4125 * @deprecated since 9 4126 * @useinstead ohos.web.webview.webview.WebviewController#runJavaScript 4127 */ 4128 runJavaScript(options: { script: string, callback?: (result: string) => void }); 4129 4130 /** 4131 * Loads the data or URL. 4132 * 4133 * @param { object } options The options with the data or URL and other information. 4134 * @syscap SystemCapability.Web.Webview.Core 4135 * @since 8 4136 * @deprecated since 9 4137 * @useinstead ohos.web.webview.webview.WebviewController#loadData 4138 */ 4139 loadData(options: { data: string, mimeType: string, encoding: string, baseUrl?: string, historyUrl?: string }); 4140 4141 /** 4142 * Loads the given URL. 4143 * 4144 * @param { object } options The options with the URL and other information. 4145 * @syscap SystemCapability.Web.Webview.Core 4146 * @since 8 4147 * @deprecated since 9 4148 * @useinstead ohos.web.webview.webview.WebviewController#loadUrl 4149 */ 4150 loadUrl(options: { url: string | Resource, headers?: Array<Header> }); 4151 4152 /** 4153 * refreshes the current URL. 4154 * 4155 * @syscap SystemCapability.Web.Webview.Core 4156 * @since 8 4157 * @deprecated since 9 4158 * @useinstead ohos.web.webview.webview.WebviewController#refresh 4159 */ 4160 refresh(); 4161 4162 /** 4163 * Stops the current load. 4164 * 4165 * @syscap SystemCapability.Web.Webview.Core 4166 * @since 8 4167 * @deprecated since 9 4168 * @useinstead ohos.web.webview.webview.WebviewController#stop 4169 */ 4170 stop(); 4171 4172 /** 4173 * Registers the JavaScript object and method list. 4174 * 4175 * @param { object } options - The option with the JavaScript object and method list. 4176 * @syscap SystemCapability.Web.Webview.Core 4177 * @since 8 4178 * @deprecated since 9 4179 * @useinstead ohos.web.webview.webview.WebviewController#registerJavaScriptProxy 4180 */ 4181 registerJavaScriptProxy(options: { object: object, name: string, methodList: Array<string> }); 4182 4183 /** 4184 * Deletes a registered JavaScript object with given name. 4185 * 4186 * @param { string } name - The name of a registered JavaScript object to be deleted. 4187 * @syscap SystemCapability.Web.Webview.Core 4188 * @since 8 4189 * @deprecated since 9 4190 * @useinstead ohos.web.webview.webview.WebviewController#deleteJavaScriptRegister 4191 */ 4192 deleteJavaScriptRegister(name: string); 4193 4194 /** 4195 * Gets the type of HitTest. 4196 * 4197 * @returns { HitTestType } The type of HitTest. 4198 * @syscap SystemCapability.Web.Webview.Core 4199 * @since 8 4200 * @deprecated since 9 4201 * @useinstead ohos.web.webview.webview.WebviewController#getHitTest 4202 */ 4203 getHitTest(): HitTestType; 4204 4205 /** 4206 * Gets the request focus. 4207 * 4208 * @syscap SystemCapability.Web.Webview.Core 4209 * @since 8 4210 * @deprecated since 9 4211 * @useinstead ohos.web.webview.webview.WebviewController#requestFocus 4212 */ 4213 requestFocus(); 4214 4215 /** 4216 * Checks whether the web page can go back. 4217 * 4218 * @returns { boolean } Whether the web page can go back. 4219 * @syscap SystemCapability.Web.Webview.Core 4220 * @since 8 4221 * @deprecated since 9 4222 * @useinstead ohos.web.webview.webview.WebviewController#accessBackward 4223 */ 4224 accessBackward(): boolean; 4225 4226 /** 4227 * Checks whether the web page can go forward. 4228 * 4229 * @returns { boolean } 4230 * @syscap SystemCapability.Web.Webview.Core 4231 * @since 8 4232 * @deprecated since 9 4233 * @useinstead ohos.web.webview.webview.WebviewController#accessForward 4234 */ 4235 accessForward(): boolean; 4236 4237 /** 4238 * Checks whether the web page can go back or forward the given number of steps. 4239 * 4240 * @param { number } step The number of steps. 4241 * @returns { boolean } 4242 * @syscap SystemCapability.Web.Webview.Core 4243 * @since 8 4244 * @deprecated since 9 4245 * @useinstead ohos.web.webview.webview.WebviewController#accessStep 4246 */ 4247 accessStep(step: number): boolean; 4248 4249 /** 4250 * Goes back in the history of the web page. 4251 * 4252 * @syscap SystemCapability.Web.Webview.Core 4253 * @since 8 4254 * @deprecated since 9 4255 * @useinstead ohos.web.webview.webview.WebviewController#backward 4256 */ 4257 backward(); 4258 4259 /** 4260 * Goes forward in the history of the web page. 4261 * 4262 * @syscap SystemCapability.Web.Webview.Core 4263 * @since 8 4264 * @deprecated since 9 4265 * @useinstead ohos.web.webview.webview.WebviewController#forward 4266 */ 4267 forward(); 4268 4269 /** 4270 * Gets network cookie manager 4271 * 4272 * @returns { WebCookie } 4273 * @syscap SystemCapability.Web.Webview.Core 4274 * @since 9 4275 * @deprecated since 9 4276 * @useinstead ohos.web.webview.WebCookieManager 4277 */ 4278 getCookieManager(): WebCookie 4279} 4280 4281/** 4282 * Defines the Web options. 4283 * 4284 * @interface WebOptions 4285 * @syscap SystemCapability.Web.Webview.Core 4286 * @since 8 4287 */ 4288/** 4289 * Defines the Web options. 4290 * 4291 * @interface WebOptions 4292 * @syscap SystemCapability.Web.Webview.Core 4293 * @crossplatform 4294 * @since 10 4295 */ 4296/** 4297 * Defines the Web options. 4298 * 4299 * @interface WebOptions 4300 * @syscap SystemCapability.Web.Webview.Core 4301 * @crossplatform 4302 * @atomicservice 4303 * @since 11 4304 */ 4305/** 4306 * Defines the Web options. 4307 * 4308 * @typedef WebOptions 4309 * @syscap SystemCapability.Web.Webview.Core 4310 * @crossplatform 4311 * @atomicservice 4312 * @since 12 4313 */ 4314declare interface WebOptions { 4315 /** 4316 * Sets the address of the web page to be displayed. 4317 * 4318 * @type { string | Resource } 4319 * @syscap SystemCapability.Web.Webview.Core 4320 * @since 8 4321 */ 4322 /** 4323 * Sets the address of the web page to be displayed. 4324 * 4325 * @type { string | Resource } 4326 * @syscap SystemCapability.Web.Webview.Core 4327 * @crossplatform 4328 * @since 10 4329 */ 4330 /** 4331 * Sets the address of the web page to be displayed. 4332 * 4333 * @type { string | Resource } 4334 * @syscap SystemCapability.Web.Webview.Core 4335 * @crossplatform 4336 * @atomicservice 4337 * @since 11 4338 */ 4339 src: string | Resource; 4340 /** 4341 * Sets the controller of the Web. 4342 * 4343 * @type { WebController | WebviewController } 4344 * @syscap SystemCapability.Web.Webview.Core 4345 * @since 8 4346 */ 4347 /** 4348 * Sets the controller of the Web. 4349 * 4350 * @type { WebController | WebviewController } 4351 * @syscap SystemCapability.Web.Webview.Core 4352 * @since 9 4353 */ 4354 /** 4355 * Sets the controller of the Web. 4356 * 4357 * @type { WebController | WebviewController } 4358 * @syscap SystemCapability.Web.Webview.Core 4359 * @crossplatform 4360 * @since 10 4361 */ 4362 /** 4363 * Sets the controller of the Web. 4364 * 4365 * @type { WebController | WebviewController } 4366 * @syscap SystemCapability.Web.Webview.Core 4367 * @crossplatform 4368 * @atomicservice 4369 * @since 11 4370 */ 4371 controller: WebController | WebviewController; 4372 4373 /** 4374 * Sets the render mode of the web. 4375 * 4376 * @type { ?RenderMode } 4377 * @syscap SystemCapability.Web.Webview.Core 4378 * @atomicservice 4379 * @since 12 4380 */ 4381 renderMode? : RenderMode; 4382 4383 /** 4384 * Sets the incognito mode of the Web, the parameter is optional and default value is false. 4385 * When the Web is in incognito mode, cookies, records of websites, geolocation permissions 4386 * will not save in persistent files. 4387 * 4388 * @type { ?boolean } 4389 * @syscap SystemCapability.Web.Webview.Core 4390 * @atomicservice 4391 * @since 11 4392 */ 4393 incognitoMode? : boolean; 4394 4395 /** 4396 * Sets the shared render process token of the web. 4397 * When the web is in multiprocess mode, web with the same 4398 * sharedRenderProcessToken will attempt to reuse the same render process. 4399 * The shared render process will remain active until all associated 4400 * web are destroyed. 4401 * 4402 * @type { ?string } 4403 * @syscap SystemCapability.Web.Webview.Core 4404 * @since 12 4405 */ 4406 sharedRenderProcessToken? : string; 4407} 4408 4409/** 4410 * Defines the contents of the JavaScript to be injected. 4411 * 4412 * @interface ScriptItem 4413 * @syscap SystemCapability.Web.Webview.Core 4414 * @atomicservice 4415 * @since 11 4416 */ 4417/** 4418 * Defines the contents of the JavaScript to be injected. 4419 * 4420 * @typedef ScriptItem 4421 * @syscap SystemCapability.Web.Webview.Core 4422 * @atomicservice 4423 * @since 12 4424 */ 4425declare interface ScriptItem { 4426 /** 4427 * Sets the JavaScript to be injected. 4428 * 4429 * @type { string } 4430 * @syscap SystemCapability.Web.Webview.Core 4431 * @atomicservice 4432 * @since 11 4433 */ 4434 script: string; 4435 /** 4436 * Sets the rules of the JavaScript. 4437 * 4438 * @type { Array<string> } 4439 * @syscap SystemCapability.Web.Webview.Core 4440 * @atomicservice 4441 * @since 11 4442 */ 4443 scriptRules: Array<string>; 4444} 4445 4446/** 4447 * Defines the load committed details. 4448 * 4449 * @interface LoadCommittedDetails 4450 * @syscap SystemCapability.Web.Webview.Core 4451 * @atomicservice 4452 * @since 11 4453 */ 4454/** 4455 * Defines the load committed details. 4456 * 4457 * @typedef LoadCommittedDetails 4458 * @syscap SystemCapability.Web.Webview.Core 4459 * @atomicservice 4460 * @since 12 4461 */ 4462declare interface LoadCommittedDetails { 4463 /** 4464 * Check whether the request is for getting the main frame. 4465 * 4466 * @type { boolean } 4467 * @syscap SystemCapability.Web.Webview.Core 4468 * @atomicservice 4469 * @since 11 4470 */ 4471 isMainFrame: boolean; 4472 4473 /** 4474 * Whether the navigation happened without changing document. Examples of 4475 * same document navigations are: 4476 * 1. reference fragment navigations. 4477 * 2. pushState/replaceState. 4478 * 3. same page history navigation 4479 * 4480 * @type { boolean } 4481 * @syscap SystemCapability.Web.Webview.Core 4482 * @atomicservice 4483 * @since 11 4484 */ 4485 isSameDocument: boolean; 4486 4487 /** 4488 * True if the committed entry has replaced the existing one. Note that in 4489 * case of subframes, the NavigationEntry and FrameNavigationEntry objects 4490 * don't actually get replaced - they're reused, but with updated attributes. 4491 * 4492 * @type { boolean } 4493 * @syscap SystemCapability.Web.Webview.Core 4494 * @atomicservice 4495 * @since 11 4496 */ 4497 didReplaceEntry: boolean; 4498 4499 /** 4500 * The type of the navigation. 4501 * 4502 * @type { WebNavigationType } 4503 * @syscap SystemCapability.Web.Webview.Core 4504 * @atomicservice 4505 * @since 11 4506 */ 4507 navigationType: WebNavigationType; 4508 4509 /** 4510 * The url to navigate. 4511 * 4512 * @type { string } 4513 * @syscap SystemCapability.Web.Webview.Core 4514 * @atomicservice 4515 * @since 11 4516 */ 4517 url: string; 4518} 4519 4520/** 4521 * Defines the Intelligent Tracking Prevention details. 4522 * 4523 * @typedef IntelligentTrackingPreventionDetails 4524 * @syscap SystemCapability.Web.Webview.Core 4525 * @atomicservice 4526 * @since 12 4527 */ 4528declare interface IntelligentTrackingPreventionDetails { 4529 /** 4530 * The host of website url. 4531 * 4532 * @type { string } 4533 * @syscap SystemCapability.Web.Webview.Core 4534 * @atomicservice 4535 * @since 12 4536 */ 4537 host: string; 4538 4539 /** 4540 * The host of tracker url. 4541 * 4542 * @type { string } 4543 * @syscap SystemCapability.Web.Webview.Core 4544 * @atomicservice 4545 * @since 12 4546 */ 4547 trackerHost: string; 4548} 4549 4550/** 4551 * Defines the Web interface. 4552 * 4553 * @interface WebInterface 4554 * @syscap SystemCapability.Web.Webview.Core 4555 * @since 8 4556 */ 4557/** 4558 * Defines the Web interface. 4559 * 4560 * @interface WebInterface 4561 * @syscap SystemCapability.Web.Webview.Core 4562 * @crossplatform 4563 * @since 10 4564 */ 4565/** 4566 * Defines the Web interface. 4567 * 4568 * @interface WebInterface 4569 * @syscap SystemCapability.Web.Webview.Core 4570 * @crossplatform 4571 * @atomicservice 4572 * @since 11 4573 */ 4574/** 4575 * Defines the Web interface. 4576 * 4577 * @typedef WebInterface 4578 * @syscap SystemCapability.Web.Webview.Core 4579 * @crossplatform 4580 * @atomicservice 4581 * @since 12 4582 */ 4583interface WebInterface { 4584 /** 4585 * Sets Value. 4586 * 4587 * @param { WebOptions } value 4588 * @returns { WebAttribute } 4589 * @syscap SystemCapability.Web.Webview.Core 4590 * @since 8 4591 */ 4592 /** 4593 * Sets Value. 4594 * 4595 * @param { WebOptions } value 4596 * @returns { WebAttribute } 4597 * @syscap SystemCapability.Web.Webview.Core 4598 * @crossplatform 4599 * @since 10 4600 */ 4601 /** 4602 * Sets Value. 4603 * 4604 * @param { WebOptions } value 4605 * @returns { WebAttribute } 4606 * @syscap SystemCapability.Web.Webview.Core 4607 * @crossplatform 4608 * @atomicservice 4609 * @since 11 4610 */ 4611 (value: WebOptions): WebAttribute; 4612} 4613 4614/** 4615 * Defines the embed info. 4616 * 4617 * @interface NativeEmbedInfo 4618 * @syscap SystemCapability.Web.Webview.Core 4619 * @atomicservice 4620 * @since 11 4621 */ 4622/** 4623 * Defines the embed info. 4624 * 4625 * @typedef NativeEmbedInfo 4626 * @syscap SystemCapability.Web.Webview.Core 4627 * @atomicservice 4628 * @since 12 4629 */ 4630declare interface NativeEmbedInfo { 4631 /** 4632 * The embed id. 4633 * 4634 * @type { ?string } 4635 * @syscap SystemCapability.Web.Webview.Core 4636 * @atomicservice 4637 * @since 11 4638 */ 4639 id?: string; 4640 /** 4641 * Only when enableEmbedMode is true and type is marked as native/xxx will be recognized as a same layer component. 4642 * 4643 * @type { ?string } 4644 * @syscap SystemCapability.Web.Webview.Core 4645 * @atomicservice 4646 * @since 11 4647 */ 4648 type?: string; 4649 /** 4650 * The embed tag src. 4651 * 4652 * @type { ?string } 4653 * @syscap SystemCapability.Web.Webview.Core 4654 * @atomicservice 4655 * @since 11 4656 */ 4657 src?: string; 4658 /** 4659 * The coordinate position of embed element relative to the webComponent. 4660 * 4661 * @type { ?Position } 4662 * @syscap SystemCapability.Web.Webview.Core 4663 * @atomicservice 4664 * @since 12 4665 */ 4666 position?: Position; 4667 /** 4668 * The embed tag width. 4669 * 4670 * @type { ?number } 4671 * @syscap SystemCapability.Web.Webview.Core 4672 * @atomicservice 4673 * @since 11 4674 */ 4675 width?: number; 4676 /** 4677 * The embed tag height. 4678 * 4679 * @type { ?number } 4680 * @syscap SystemCapability.Web.Webview.Core 4681 * @atomicservice 4682 * @since 11 4683 */ 4684 height?: number; 4685 /** 4686 * The embed tag url. 4687 * 4688 * @type { ?string } 4689 * @syscap SystemCapability.Web.Webview.Core 4690 * @atomicservice 4691 * @since 11 4692 */ 4693 url?: string; 4694 /** 4695 * The embed tag name. 4696 * 4697 * @type { ?string } 4698 * @syscap SystemCapability.Web.Webview.Core 4699 * @atomicservice 4700 * @since 12 4701 */ 4702 tag?: string; 4703 /** 4704 * The embed param list information used by object tag. 4705 * 4706 * @type { ?Map<string, string> } 4707 * @syscap SystemCapability.Web.Webview.Core 4708 * @atomicservice 4709 * @since 12 4710 */ 4711 params?: Map<string, string>; 4712} 4713 4714/** 4715 * Defines the Embed Data info. 4716 * 4717 * @interface NativeEmbedDataInfo 4718 * @syscap SystemCapability.Web.Webview.Core 4719 * @atomicservice 4720 * @since 11 4721 */ 4722/** 4723 * Defines the Embed Data info. 4724 * 4725 * @typedef NativeEmbedDataInfo 4726 * @syscap SystemCapability.Web.Webview.Core 4727 * @atomicservice 4728 * @since 12 4729 */ 4730declare interface NativeEmbedDataInfo { 4731 /** 4732 * The embed status. 4733 * 4734 * @type { ?NativeEmbedStatus } 4735 * @syscap SystemCapability.Web.Webview.Core 4736 * @atomicservice 4737 * @since 11 4738 */ 4739 status?: NativeEmbedStatus; 4740 /** 4741 * The surface id. 4742 * 4743 * @type { ?string } 4744 * @syscap SystemCapability.Web.Webview.Core 4745 * @atomicservice 4746 * @since 11 4747 */ 4748 surfaceId?: string; 4749 /** 4750 * The embed id. 4751 * 4752 * @type { ?string } 4753 * @syscap SystemCapability.Web.Webview.Core 4754 * @atomicservice 4755 * @since 11 4756 */ 4757 embedId?: string; 4758 /** 4759 * The embed info. 4760 * 4761 * @type { ?NativeEmbedInfo } 4762 * @syscap SystemCapability.Web.Webview.Core 4763 * @atomicservice 4764 * @since 11 4765 */ 4766 info?: NativeEmbedInfo; 4767} 4768 4769/** 4770 * Defines the Embed Visibility info. 4771 * 4772 * @typedef NativeEmbedVisibilityInfo 4773 * @syscap SystemCapability.Web.Webview.Core 4774 * @since 12 4775 */ 4776declare interface NativeEmbedVisibilityInfo { 4777 /** 4778 * The embed visibility. 4779 * 4780 * @type { boolean } 4781 * @syscap SystemCapability.Web.Webview.Core 4782 * @since 12 4783 */ 4784 visibility: boolean; 4785 /** 4786 * The embed id. 4787 * 4788 * @type { string } 4789 * @syscap SystemCapability.Web.Webview.Core 4790 * @since 12 4791 */ 4792 embedId: string; 4793} 4794 4795/** 4796 * Defines the user touch info. 4797 * 4798 * @interface NativeEmbedTouchInfo 4799 * @syscap SystemCapability.Web.Webview.Core 4800 * @atomicservice 4801 * @since 11 4802 */ 4803/** 4804 * Defines the user touch info. 4805 * 4806 * @typedef NativeEmbedTouchInfo 4807 * @syscap SystemCapability.Web.Webview.Core 4808 * @atomicservice 4809 * @since 12 4810 */ 4811declare interface NativeEmbedTouchInfo { 4812 /** 4813 * The native embed id. 4814 * 4815 * @type { ?string } 4816 * @syscap SystemCapability.Web.Webview.Core 4817 * @atomicservice 4818 * @since 11 4819 */ 4820 embedId?: string; 4821 /** 4822 * An event sent when the state of contacts with a touch-sensitive surface changes. 4823 * 4824 * @type { ?TouchEvent } 4825 * @syscap SystemCapability.Web.Webview.Core 4826 * @atomicservice 4827 * @since 11 4828 */ 4829 touchEvent?: TouchEvent; 4830 /** 4831 * Handle the user's touch result. 4832 * 4833 * @type { ?EventResult } 4834 * @syscap SystemCapability.Web.Webview.Core 4835 * @atomicservice 4836 * @since 12 4837 */ 4838 result?: EventResult; 4839} 4840 4841 /** 4842 * Defines the first content paint rendering of web page. 4843 * 4844 * @typedef FirstMeaningfulPaint 4845 * @syscap SystemCapability.Web.Webview.Core 4846 * @atomicservice 4847 * @since 12 4848 */ 4849declare interface FirstMeaningfulPaint { 4850 /** 4851 * Start time of navigation. 4852 * 4853 * @type { ?number } 4854 * @syscap SystemCapability.Web.Webview.Core 4855 * @atomicservice 4856 * @since 12 4857 */ 4858 navigationStartTime?: number; 4859 4860 /** 4861 * Paint time of first meaningful content. 4862 * 4863 * @type { ?number } 4864 * @syscap SystemCapability.Web.Webview.Core 4865 * @atomicservice 4866 * @since 12 4867 */ 4868 firstMeaningfulPaintTime?: number; 4869} 4870 4871/** 4872 * Defines the largest content paint rendering of web page. 4873 * 4874 * @typedef LargestContentfulPaint 4875 * @syscap SystemCapability.Web.Webview.Core 4876 * @atomicservice 4877 * @since 12 4878 */ 4879declare interface LargestContentfulPaint { 4880 /** 4881 * Start time of navigation. 4882 * 4883 * @type { ?number } 4884 * @syscap SystemCapability.Web.Webview.Core 4885 * @atomicservice 4886 * @since 12 4887 */ 4888 navigationStartTime?: number; 4889 4890 /** 4891 * Paint time of largest image. 4892 * 4893 * @type { ?number } 4894 * @syscap SystemCapability.Web.Webview.Core 4895 * @atomicservice 4896 * @since 12 4897 */ 4898 largestImagePaintTime?: number; 4899 4900 /** 4901 * Paint time of largest text. 4902 * 4903 * @type { ?number } 4904 * @syscap SystemCapability.Web.Webview.Core 4905 * @atomicservice 4906 * @since 12 4907 */ 4908 largestTextPaintTime?: number; 4909 4910 /** 4911 * Bits per pixel of image. 4912 * 4913 * @type { ?number } 4914 * @syscap SystemCapability.Web.Webview.Core 4915 * @atomicservice 4916 * @since 12 4917 */ 4918 imageBPP?: number; 4919 4920 /** 4921 * Load start time of largest image. 4922 * 4923 * @type { ?number } 4924 * @syscap SystemCapability.Web.Webview.Core 4925 * @atomicservice 4926 * @since 12 4927 */ 4928 largestImageLoadStartTime?: number; 4929 4930 /** 4931 * Load end time of largest image. 4932 * 4933 * @type { ?number } 4934 * @syscap SystemCapability.Web.Webview.Core 4935 * @atomicservice 4936 * @since 12 4937 */ 4938 largestImageLoadEndTime?: number; 4939} 4940 4941/** 4942 * Defines the render process not responding info. 4943 * 4944 * @interface RenderProcessNotRespondingData 4945 * @syscap SystemCapability.Web.Webview.Core 4946 * @since 12 4947 */ 4948declare interface RenderProcessNotRespondingData { 4949 /** 4950 * JavaScript stack info of the webpage when render process not responding. 4951 * 4952 * @type { string } 4953 * @syscap SystemCapability.Web.Webview.Core 4954 * @since 12 4955 */ 4956 jsStack: string; 4957 4958 /** 4959 * Process id of render process not responding. 4960 * 4961 * @type { number } 4962 * @syscap SystemCapability.Web.Webview.Core 4963 * @since 12 4964 */ 4965 pid: number; 4966 4967 /** 4968 * Reason for the render process not responding. 4969 * 4970 * @type { RenderProcessNotRespondingReason } 4971 * @syscap SystemCapability.Web.Webview.Core 4972 * @since 12 4973 */ 4974 reason: RenderProcessNotRespondingReason; 4975} 4976 4977/** 4978 * Defines the triggered function at the end of web page loading. 4979 * 4980 * @typedef OnPageEndEvent 4981 * @syscap SystemCapability.Web.Webview.Core 4982 * @crossplatform 4983 * @atomicservice 4984 * @since 12 4985 */ 4986declare interface OnPageEndEvent { 4987 /** 4988 * The url of page. 4989 * 4990 * @type { string } 4991 * @syscap SystemCapability.Web.Webview.Core 4992 * @crossplatform 4993 * @atomicservice 4994 * @since 12 4995 */ 4996 url: string; 4997} 4998 4999/** 5000 * Defines the triggered function at the begin of web page loading. 5001 * 5002 * @typedef OnPageBeginEvent 5003 * @syscap SystemCapability.Web.Webview.Core 5004 * @crossplatform 5005 * @atomicservice 5006 * @since 12 5007 */ 5008declare interface OnPageBeginEvent { 5009 /** 5010 * The url of page. 5011 * 5012 * @type { string } 5013 * @syscap SystemCapability.Web.Webview.Core 5014 * @crossplatform 5015 * @atomicservice 5016 * @since 12 5017 */ 5018 url: string; 5019} 5020 5021/** 5022 * Defines the triggered function when the page loading progress changes. 5023 * 5024 * @typedef OnProgressChangeEvent 5025 * @syscap SystemCapability.Web.Webview.Core 5026 * @crossplatform 5027 * @atomicservice 5028 * @since 12 5029 */ 5030declare interface OnProgressChangeEvent { 5031 /** 5032 * The new progress of the page. 5033 * 5034 * @type { number } 5035 * @syscap SystemCapability.Web.Webview.Core 5036 * @crossplatform 5037 * @atomicservice 5038 * @since 12 5039 */ 5040 newProgress: number; 5041} 5042 5043/** 5044 * Defines the triggered function when the title of the main application document changes. 5045 * 5046 * @typedef OnTitleReceiveEvent 5047 * @syscap SystemCapability.Web.Webview.Core 5048 * @crossplatform 5049 * @atomicservice 5050 * @since 12 5051 */ 5052declare interface OnTitleReceiveEvent { 5053 /** 5054 * The title of the page. 5055 * 5056 * @type { string } 5057 * @syscap SystemCapability.Web.Webview.Core 5058 * @crossplatform 5059 * @atomicservice 5060 * @since 12 5061 */ 5062 title: string; 5063} 5064 5065/** 5066 * Defines the triggered function when requesting to show the geolocation permission. 5067 * 5068 * @typedef OnGeolocationShowEvent 5069 * @syscap SystemCapability.Web.Webview.Core 5070 * @crossplatform 5071 * @atomicservice 5072 * @since 12 5073 */ 5074declare interface OnGeolocationShowEvent { 5075 /** 5076 * Origin of the page. 5077 * 5078 * @type { string } 5079 * @syscap SystemCapability.Web.Webview.Core 5080 * @crossplatform 5081 * @atomicservice 5082 * @since 12 5083 */ 5084 origin: string; 5085 /** 5086 * Defines the js geolocation request. 5087 * 5088 * @type { JsGeolocation } 5089 * @syscap SystemCapability.Web.Webview.Core 5090 * @crossplatform 5091 * @atomicservice 5092 * @since 12 5093 */ 5094 geolocation: JsGeolocation; 5095} 5096 5097/** 5098 * Defines the triggered function when the web page wants to display a JavaScript alert() dialog. 5099 * 5100 * @typedef OnAlertEvent 5101 * @syscap SystemCapability.Web.Webview.Core 5102 * @crossplatform 5103 * @atomicservice 5104 * @since 12 5105 */ 5106declare interface OnAlertEvent { 5107 /** 5108 * The url of the page. 5109 * 5110 * @type { string } 5111 * @syscap SystemCapability.Web.Webview.Core 5112 * @crossplatform 5113 * @atomicservice 5114 * @since 12 5115 */ 5116 url: string; 5117 /** 5118 * The message of alert dialog. 5119 * 5120 * @type { string } 5121 * @syscap SystemCapability.Web.Webview.Core 5122 * @crossplatform 5123 * @atomicservice 5124 * @since 12 5125 */ 5126 message: string; 5127 /** 5128 * Handle the user's JavaScript result. 5129 * 5130 * @type { JsResult } 5131 * @syscap SystemCapability.Web.Webview.Core 5132 * @crossplatform 5133 * @atomicservice 5134 * @since 12 5135 */ 5136 result: JsResult; 5137} 5138 5139/** 5140 * Defines the triggered function when the web page wants to confirm navigation from JavaScript onbeforeunload. 5141 * 5142 * @typedef OnBeforeUnloadEvent 5143 * @syscap SystemCapability.Web.Webview.Core 5144 * @atomicservice 5145 * @since 12 5146 */ 5147declare interface OnBeforeUnloadEvent { 5148 /** 5149 * The url of the page. 5150 * 5151 * @type { string } 5152 * @syscap SystemCapability.Web.Webview.Core 5153 * @atomicservice 5154 * @since 12 5155 */ 5156 url: string; 5157 /** 5158 * The message of confirm dialog. 5159 * 5160 * @type { string } 5161 * @syscap SystemCapability.Web.Webview.Core 5162 * @atomicservice 5163 * @since 12 5164 */ 5165 message: string; 5166 /** 5167 * Handle the user's JavaScript result. 5168 * 5169 * @type { JsResult } 5170 * @syscap SystemCapability.Web.Webview.Core 5171 * @atomicservice 5172 * @since 12 5173 */ 5174 result: JsResult; 5175} 5176 5177/** 5178 * Defines the triggered function when the web page wants to display a JavaScript confirm() dialog. 5179 * 5180 * @typedef OnConfirmEvent 5181 * @syscap SystemCapability.Web.Webview.Core 5182 * @crossplatform 5183 * @atomicservice 5184 * @since 12 5185 */ 5186declare interface OnConfirmEvent { 5187 /** 5188 * The url of the page. 5189 * 5190 * @type { string } 5191 * @syscap SystemCapability.Web.Webview.Core 5192 * @crossplatform 5193 * @atomicservice 5194 * @since 12 5195 */ 5196 url: string; 5197 /** 5198 * The message of confirm dialog. 5199 * 5200 * @type { string } 5201 * @syscap SystemCapability.Web.Webview.Core 5202 * @crossplatform 5203 * @atomicservice 5204 * @since 12 5205 */ 5206 message: string; 5207 /** 5208 * Handle the user's JavaScript result. 5209 * 5210 * @type { JsResult } 5211 * @syscap SystemCapability.Web.Webview.Core 5212 * @crossplatform 5213 * @atomicservice 5214 * @since 12 5215 */ 5216 result: JsResult; 5217} 5218 5219/** 5220 * Defines the triggered function when the web page wants to display a JavaScript prompt() dialog. 5221 * 5222 * @typedef OnPromptEvent 5223 * @syscap SystemCapability.Web.Webview.Core 5224 * @crossplatform 5225 * @atomicservice 5226 * @since 12 5227 */ 5228declare interface OnPromptEvent { 5229 /** 5230 * The url of the page. 5231 * 5232 * @type { string } 5233 * @syscap SystemCapability.Web.Webview.Core 5234 * @crossplatform 5235 * @atomicservice 5236 * @since 12 5237 */ 5238 url: string; 5239 /** 5240 * The message of prompt dialog. 5241 * 5242 * @type { string } 5243 * @syscap SystemCapability.Web.Webview.Core 5244 * @crossplatform 5245 * @atomicservice 5246 * @since 12 5247 */ 5248 message: string; 5249 /** 5250 * The value of prompt dialog. 5251 * 5252 * @type { string } 5253 * @syscap SystemCapability.Web.Webview.Core 5254 * @crossplatform 5255 * @atomicservice 5256 * @since 12 5257 */ 5258 value: string; 5259 /** 5260 * Handle the user's JavaScript result. 5261 * 5262 * @type { JsResult } 5263 * @syscap SystemCapability.Web.Webview.Core 5264 * @crossplatform 5265 * @atomicservice 5266 * @since 12 5267 */ 5268 result: JsResult; 5269} 5270 5271/** 5272 * Defines the triggered function when the web page receives a JavaScript console message. 5273 * 5274 * @typedef OnConsoleEvent 5275 * @syscap SystemCapability.Web.Webview.Core 5276 * @crossplatform 5277 * @atomicservice 5278 * @since 12 5279 */ 5280declare interface OnConsoleEvent { 5281 /** 5282 * Console message information of the event. 5283 * 5284 * @type { ConsoleMessage } 5285 * @syscap SystemCapability.Web.Webview.Core 5286 * @crossplatform 5287 * @atomicservice 5288 * @since 12 5289 */ 5290 message: ConsoleMessage; 5291} 5292 5293/** 5294 * Defines the triggered function when the web page receives a web resource loading error. 5295 * 5296 * @typedef OnErrorReceiveEvent 5297 * @syscap SystemCapability.Web.Webview.Core 5298 * @crossplatform 5299 * @atomicservice 5300 * @since 12 5301 */ 5302declare interface OnErrorReceiveEvent { 5303 /** 5304 * The information of request. 5305 * 5306 * @type { WebResourceRequest } 5307 * @syscap SystemCapability.Web.Webview.Core 5308 * @crossplatform 5309 * @atomicservice 5310 * @since 12 5311 */ 5312 request: WebResourceRequest; 5313 /** 5314 * The information of error. 5315 * 5316 * @type { WebResourceError } 5317 * @syscap SystemCapability.Web.Webview.Core 5318 * @crossplatform 5319 * @atomicservice 5320 * @since 12 5321 */ 5322 error: WebResourceError; 5323} 5324 5325/** 5326 * Defines the triggered function when the web page receives a web resource loading HTTP error. 5327 * 5328 * @typedef OnHttpErrorReceiveEvent 5329 * @syscap SystemCapability.Web.Webview.Core 5330 * @crossplatform 5331 * @atomicservice 5332 * @since 12 5333 */ 5334declare interface OnHttpErrorReceiveEvent { 5335 /** 5336 * The information of request. 5337 * 5338 * @type { WebResourceRequest } 5339 * @syscap SystemCapability.Web.Webview.Core 5340 * @crossplatform 5341 * @atomicservice 5342 * @since 12 5343 */ 5344 request: WebResourceRequest; 5345 /** 5346 * Web resource response of event. 5347 * 5348 * @type { WebResourceResponse } 5349 * @syscap SystemCapability.Web.Webview.Core 5350 * @crossplatform 5351 * @atomicservice 5352 * @since 12 5353 */ 5354 response: WebResourceResponse; 5355} 5356 5357/** 5358 * Defines the triggered function when starting to download. 5359 * 5360 * @typedef OnDownloadStartEvent 5361 * @syscap SystemCapability.Web.Webview.Core 5362 * @crossplatform 5363 * @atomicservice 5364 * @since 12 5365 */ 5366declare interface OnDownloadStartEvent { 5367 /** 5368 * The URL of page. 5369 * 5370 * @type { string } 5371 * @syscap SystemCapability.Web.Webview.Core 5372 * @crossplatform 5373 * @atomicservice 5374 * @since 12 5375 */ 5376 url: string; 5377 /** 5378 * The userAgent of page. 5379 * 5380 * @type { string } 5381 * @syscap SystemCapability.Web.Webview.Core 5382 * @crossplatform 5383 * @atomicservice 5384 * @since 12 5385 */ 5386 userAgent: string; 5387 /** 5388 * The contentDisposition of page. 5389 * 5390 * @type { string } 5391 * @syscap SystemCapability.Web.Webview.Core 5392 * @atomicservice 5393 * @since 12 5394 */ 5395 contentDisposition: string; 5396 /** 5397 * The mimetype of page. 5398 * 5399 * @type { string } 5400 * @syscap SystemCapability.Web.Webview.Core 5401 * @crossplatform 5402 * @atomicservice 5403 * @since 12 5404 */ 5405 mimetype: string; 5406 /** 5407 * The contentLength of page. 5408 * 5409 * @type { number } 5410 * @syscap SystemCapability.Web.Webview.Core 5411 * @crossplatform 5412 * @atomicservice 5413 * @since 12 5414 */ 5415 contentLength: number; 5416} 5417 5418/** 5419 * Defines the triggered callback when the Web page refreshes accessed history. 5420 * 5421 * @typedef OnRefreshAccessedHistoryEvent 5422 * @syscap SystemCapability.Web.Webview.Core 5423 * @atomicservice 5424 * @since 12 5425 */ 5426declare interface OnRefreshAccessedHistoryEvent { 5427 /** 5428 * URL of the visit. 5429 * 5430 * @type { string } 5431 * @syscap SystemCapability.Web.Webview.Core 5432 * @atomicservice 5433 * @since 12 5434 */ 5435 url: string; 5436 /** 5437 * If true, the page is being reloaded, otherwise, means that the page is newly loaded. 5438 * 5439 * @type { boolean } 5440 * @syscap SystemCapability.Web.Webview.Core 5441 * @atomicservice 5442 * @since 12 5443 */ 5444 isRefreshed: boolean; 5445} 5446 5447/** 5448 * Defines the triggered when the render process exits. 5449 * 5450 * @typedef OnRenderExitedEvent 5451 * @syscap SystemCapability.Web.Webview.Core 5452 * @atomicservice 5453 * @since 12 5454 */ 5455declare interface OnRenderExitedEvent { 5456 /** 5457 * The specific reason why the rendering process exits abnormally. 5458 * 5459 * @type { RenderExitReason } 5460 * @syscap SystemCapability.Web.Webview.Core 5461 * @atomicservice 5462 * @since 12 5463 */ 5464 renderExitReason: RenderExitReason; 5465} 5466 5467/** 5468 * Defines the triggered when the file selector shows. 5469 * 5470 * @typedef OnShowFileSelectorEvent 5471 * @syscap SystemCapability.Web.Webview.Core 5472 * @crossplatform 5473 * @atomicservice 5474 * @since 12 5475 */ 5476declare interface OnShowFileSelectorEvent { 5477 /** 5478 * Defines the file selector result. 5479 * 5480 * @type { FileSelectorResult } 5481 * @syscap SystemCapability.Web.Webview.Core 5482 * @crossplatform 5483 * @atomicservice 5484 * @since 11 5485 */ 5486 result: FileSelectorResult; 5487 /** 5488 * Encompassed message information as parameters to fileSelector. 5489 * 5490 * @type { FileSelectorParam } 5491 * @syscap SystemCapability.Web.Webview.Core 5492 * @crossplatform 5493 * @atomicservice 5494 * @since 11 5495 */ 5496 fileSelector: FileSelectorParam; 5497} 5498 5499/** 5500 * Defines the triggered when the url loading. 5501 * 5502 * @typedef OnResourceLoadEvent 5503 * @syscap SystemCapability.Web.Webview.Core 5504 * @atomicservice 5505 * @since 12 5506 */ 5507declare interface OnResourceLoadEvent { 5508 /** 5509 * The URL of the loaded resource file. 5510 * 5511 * @type { string } 5512 * @syscap SystemCapability.Web.Webview.Core 5513 * @atomicservice 5514 * @since 12 5515 */ 5516 url: string; 5517} 5518 5519/** 5520 * Defines the triggered when the scale of WebView changed. 5521 * 5522 * @typedef OnScaleChangeEvent 5523 * @syscap SystemCapability.Web.Webview.Core 5524 * @crossplatform 5525 * @atomicservice 5526 * @since 12 5527 */ 5528declare interface OnScaleChangeEvent { 5529 /** 5530 * Old scale of the page. 5531 * 5532 * @type { number } 5533 * @syscap SystemCapability.Web.Webview.Core 5534 * @crossplatform 5535 * @atomicservice 5536 * @since 12 5537 */ 5538 oldScale: number; 5539 /** 5540 * New scale of the page. 5541 * 5542 * @type { number } 5543 * @syscap SystemCapability.Web.Webview.Core 5544 * @crossplatform 5545 * @atomicservice 5546 * @since 12 5547 */ 5548 newScale: number; 5549} 5550 5551/** 5552 * Defines the triggered when the browser needs credentials from the user. 5553 * 5554 * @typedef OnHttpAuthRequestEvent 5555 * @syscap SystemCapability.Web.Webview.Core 5556 * @crossplatform 5557 * @atomicservice 5558 * @since 12 5559 */ 5560declare interface OnHttpAuthRequestEvent { 5561 /** 5562 * Defines the http auth request result. 5563 * 5564 * @type { HttpAuthHandler } 5565 * @syscap SystemCapability.Web.Webview.Core 5566 * @crossplatform 5567 * @atomicservice 5568 * @since 12 5569 */ 5570 handler: HttpAuthHandler; 5571 /** 5572 * Host of the page. 5573 * 5574 * @type { string } 5575 * @syscap SystemCapability.Web.Webview.Core 5576 * @crossplatform 5577 * @atomicservice 5578 * @since 12 5579 */ 5580 host: string; 5581 /** 5582 * realm of the page. 5583 * 5584 * @type { string } 5585 * @syscap SystemCapability.Web.Webview.Core 5586 * @crossplatform 5587 * @atomicservice 5588 * @since 12 5589 */ 5590 realm: string; 5591} 5592 5593/** 5594 * Defines the triggered callback when the resources loading is intercepted. 5595 * 5596 * @typedef OnInterceptRequestEvent 5597 * @syscap SystemCapability.Web.Webview.Core 5598 * @atomicservice 5599 * @since 12 5600 */ 5601declare interface OnInterceptRequestEvent { 5602 /** 5603 * The information of request. 5604 * 5605 * @type { WebResourceRequest } 5606 * @syscap SystemCapability.Web.Webview.Core 5607 * @atomicservice 5608 * @since 12 5609 */ 5610 request: WebResourceRequest; 5611} 5612 5613/** 5614 * Defines the triggered callback when the host application that web content from the specified origin is 5615 * attempting to access the resources. 5616 * 5617 * @typedef OnPermissionRequestEvent 5618 * @syscap SystemCapability.Web.Webview.Core 5619 * @crossplatform 5620 * @atomicservice 5621 * @since 12 5622 */ 5623declare interface OnPermissionRequestEvent { 5624 /** 5625 * Defines the onPermissionRequest callback. 5626 * 5627 * @type { PermissionRequest } 5628 * @syscap SystemCapability.Web.Webview.Core 5629 * @crossplatform 5630 * @atomicservice 5631 * @since 12 5632 */ 5633 request: PermissionRequest; 5634} 5635 5636/** 5637 * Defines the triggered callback when the host application that web content from the specified origin is 5638 * requesting to capture screen. 5639 * 5640 * @typedef OnScreenCaptureRequestEvent 5641 * @syscap SystemCapability.Web.Webview.Core 5642 * @atomicservice 5643 * @since 12 5644 */ 5645declare interface OnScreenCaptureRequestEvent { 5646 /** 5647 * Notifies the user of the operation behavior of the web component. 5648 * 5649 * @type { ScreenCaptureHandler } 5650 * @syscap SystemCapability.Web.Webview.Core 5651 * @atomicservice 5652 * @since 12 5653 */ 5654 handler: ScreenCaptureHandler; 5655} 5656 5657/** 5658 * Defines the triggered callback when called to allow custom display of the context menu. 5659 * 5660 * @typedef OnContextMenuShowEvent 5661 * @syscap SystemCapability.Web.Webview.Core 5662 * @atomicservice 5663 * @since 12 5664 */ 5665declare interface OnContextMenuShowEvent { 5666 /** 5667 * The menu-related parameters. 5668 * 5669 * @type { WebContextMenuParam } 5670 * @syscap SystemCapability.Web.Webview.Core 5671 * @atomicservice 5672 * @since 12 5673 */ 5674 param: WebContextMenuParam; 5675 /** 5676 * The menu corresponding event is passed to the kernel. 5677 * 5678 * @type { WebContextMenuResult } 5679 * @syscap SystemCapability.Web.Webview.Core 5680 * @atomicservice 5681 * @since 12 5682 */ 5683 result: WebContextMenuResult; 5684} 5685 5686/** 5687 * Defines function Triggered when the host application call searchAllAsync. 5688 * 5689 * @typedef OnSearchResultReceiveEvent 5690 * @syscap SystemCapability.Web.Webview.Core 5691 * @atomicservice 5692 * @since 12 5693 */ 5694declare interface OnSearchResultReceiveEvent { 5695 /** 5696 * The ordinal number of the currently matched lookup item (starting from 0). 5697 * 5698 * @type { number } 5699 * @syscap SystemCapability.Web.Webview.Core 5700 * @atomicservice 5701 * @since 12 5702 */ 5703 activeMatchOrdinal: number; 5704 /** 5705 * The number of all matched keywords. 5706 * 5707 * @type { number } 5708 * @syscap SystemCapability.Web.Webview.Core 5709 * @atomicservice 5710 * @since 12 5711 */ 5712 numberOfMatches: number; 5713 /** 5714 * Indicates whether the current in-page search operation is complete. The method may be called back multiple times until isDoneCounting is true. 5715 * 5716 * @type { boolean } 5717 * @syscap SystemCapability.Web.Webview.Core 5718 * @atomicservice 5719 * @since 12 5720 */ 5721 isDoneCounting: boolean; 5722} 5723 5724/** 5725 * Defines function Triggered when the scroll bar slides to the specified position. 5726 * 5727 * @typedef OnScrollEvent 5728 * @syscap SystemCapability.Web.Webview.Core 5729 * @crossplatform 5730 * @atomicservice 5731 * @since 12 5732 */ 5733declare interface OnScrollEvent { 5734 /** 5735 * The X offset of the scroll. 5736 * 5737 * @type { number } 5738 * @syscap SystemCapability.Web.Webview.Core 5739 * @crossplatform 5740 * @atomicservice 5741 * @since 12 5742 */ 5743 xOffset: number; 5744 /** 5745 * The Y offset of the scroll. 5746 * 5747 * @type { number } 5748 * @syscap SystemCapability.Web.Webview.Core 5749 * @crossplatform 5750 * @atomicservice 5751 * @since 12 5752 */ 5753 yOffset: number; 5754} 5755 5756/** 5757 * Defines the triggered callback when the Web page receives an ssl Error. 5758 * 5759 * @typedef OnSslErrorEventReceiveEvent 5760 * @syscap SystemCapability.Web.Webview.Core 5761 * @atomicservice 5762 * @since 12 5763 */ 5764declare interface OnSslErrorEventReceiveEvent { 5765 /** 5766 * Notifies the user of the operation behavior of the web component. 5767 * 5768 * @type { SslErrorHandler } 5769 * @syscap SystemCapability.Web.Webview.Core 5770 * @atomicservice 5771 * @since 12 5772 */ 5773 handler: SslErrorHandler; 5774 /** 5775 * Error codes. 5776 * 5777 * @type { SslError } 5778 * @syscap SystemCapability.Web.Webview.Core 5779 * @atomicservice 5780 * @since 12 5781 */ 5782 error: SslError; 5783 /** 5784 * Certificate chain data in DER format. 5785 * 5786 * @type { ?Array<Uint8Array> } 5787 * @syscap SystemCapability.Web.Webview.Core 5788 * @since 15 5789 */ 5790 certChainData?: Array<Uint8Array>; 5791} 5792 5793/** 5794 * Defines the triggered callback when needs ssl client certificate from the user. 5795 * 5796 * @typedef OnClientAuthenticationEvent 5797 * @syscap SystemCapability.Web.Webview.Core 5798 * @atomicservice 5799 * @since 12 5800 */ 5801declare interface OnClientAuthenticationEvent { 5802 /** 5803 * Notifies the user of the operation behavior of the web component. 5804 * 5805 * @type { ClientAuthenticationHandler } 5806 * @syscap SystemCapability.Web.Webview.Core 5807 * @atomicservice 5808 * @since 12 5809 */ 5810 handler : ClientAuthenticationHandler; 5811 /** 5812 * The hostname of the requesting certificate server. 5813 * 5814 * @type { string } 5815 * @syscap SystemCapability.Web.Webview.Core 5816 * @atomicservice 5817 * @since 12 5818 */ 5819 host : string; 5820 /** 5821 * The port number of the request certificate server. 5822 * 5823 * @type { number } 5824 * @syscap SystemCapability.Web.Webview.Core 5825 * @atomicservice 5826 * @since 12 5827 */ 5828 port : number; 5829 /** 5830 * Acceptable asymmetric key types. 5831 * 5832 * @type { Array<string> } 5833 * @syscap SystemCapability.Web.Webview.Core 5834 * @atomicservice 5835 * @since 12 5836 */ 5837 keyTypes : Array<string>; 5838 /** 5839 * Certificates that match the private key are acceptable to the issuer. 5840 * 5841 * @type { Array<string> } 5842 * @syscap SystemCapability.Web.Webview.Core 5843 * @atomicservice 5844 * @since 12 5845 */ 5846 issuers : Array<string>; 5847} 5848 5849/** 5850 * Defines the triggered callback when web page requires the user to create a window. 5851 * 5852 * @typedef OnWindowNewEvent 5853 * @syscap SystemCapability.Web.Webview.Core 5854 * @atomicservice 5855 * @since 12 5856 */ 5857declare interface OnWindowNewEvent { 5858 /** 5859 * true indicates the request to create a dialog and false indicates a new tab. 5860 * 5861 * @type { boolean } 5862 * @syscap SystemCapability.Web.Webview.Core 5863 * @atomicservice 5864 * @since 12 5865 */ 5866 isAlert: boolean; 5867 /** 5868 * true indicates that it is triggered by the user, and false indicates that it is triggered by a non-user. 5869 * 5870 * @type { boolean } 5871 * @syscap SystemCapability.Web.Webview.Core 5872 * @atomicservice 5873 * @since 12 5874 */ 5875 isUserTrigger: boolean; 5876 /** 5877 * Destination URL. 5878 * 5879 * @type { string } 5880 * @syscap SystemCapability.Web.Webview.Core 5881 * @atomicservice 5882 * @since 12 5883 */ 5884 targetUrl: string; 5885 /** 5886 * Lets you set the WebviewController instance for creating a new window. 5887 * 5888 * @type { ControllerHandler } 5889 * @syscap SystemCapability.Web.Webview.Core 5890 * @atomicservice 5891 * @since 12 5892 */ 5893 handler: ControllerHandler; 5894} 5895 5896/** 5897 * Defines the triggered callback when the application receive an new url of an apple-touch-icon. 5898 * 5899 * @typedef OnTouchIconUrlReceivedEvent 5900 * @syscap SystemCapability.Web.Webview.Core 5901 * @atomicservice 5902 * @since 12 5903 */ 5904declare interface OnTouchIconUrlReceivedEvent { 5905 /** 5906 * The apple-touch-icon URL address received. 5907 * 5908 * @type { string } 5909 * @syscap SystemCapability.Web.Webview.Core 5910 * @atomicservice 5911 * @since 12 5912 */ 5913 url: string; 5914 /** 5915 * Corresponding to whether apple-touch-icon is precomposited. 5916 * 5917 * @type { boolean } 5918 * @syscap SystemCapability.Web.Webview.Core 5919 * @atomicservice 5920 * @since 12 5921 */ 5922 precomposed: boolean; 5923} 5924 5925/** 5926 * Defines the triggered callback when the application receive a new favicon for the current web page. 5927 * 5928 * @typedef OnFaviconReceivedEvent 5929 * @syscap SystemCapability.Web.Webview.Core 5930 * @atomicservice 5931 * @since 12 5932 */ 5933declare interface OnFaviconReceivedEvent { 5934 /** 5935 * Received the Favicon icon for the PixelMap object. 5936 * 5937 * @type { PixelMap } 5938 * @syscap SystemCapability.Web.Webview.Core 5939 * @atomicservice 5940 * @since 12 5941 */ 5942 favicon: PixelMap; 5943} 5944 5945/** 5946 * Defines the triggered callback when previous page will no longer be drawn and next page begin to draw. 5947 * 5948 * @typedef OnPageVisibleEvent 5949 * @syscap SystemCapability.Web.Webview.Core 5950 * @crossplatform 5951 * @atomicservice 5952 * @since 12 5953 */ 5954declare interface OnPageVisibleEvent { 5955 /** 5956 * The URL of page. 5957 * 5958 * @type { string } 5959 * @syscap SystemCapability.Web.Webview.Core 5960 * @crossplatform 5961 * @atomicservice 5962 * @since 12 5963 */ 5964 url: string; 5965} 5966 5967/** 5968 * Defines the triggered callback to decision whether resend form data or not. 5969 * 5970 * @typedef OnDataResubmittedEvent 5971 * @syscap SystemCapability.Web.Webview.Core 5972 * @atomicservice 5973 * @since 12 5974 */ 5975declare interface OnDataResubmittedEvent { 5976 /** 5977 * Form data resubmission handle. 5978 * 5979 * @type { DataResubmissionHandler } 5980 * @syscap SystemCapability.Web.Webview.Core 5981 * @atomicservice 5982 * @since 12 5983 */ 5984 handler: DataResubmissionHandler; 5985} 5986 5987/** 5988 * Defines the playing state of audio on web page. 5989 * 5990 * @typedef OnAudioStateChangedEvent 5991 * @syscap SystemCapability.Web.Webview.Core 5992 * @atomicservice 5993 * @since 12 5994 */ 5995declare interface OnAudioStateChangedEvent { 5996 /** 5997 * The audio playback status of the current page, true if playing true otherwise false. 5998 * 5999 * @type { boolean } 6000 * @syscap SystemCapability.Web.Webview.Core 6001 * @atomicservice 6002 * @since 12 6003 */ 6004 playing: boolean; 6005} 6006 6007/** 6008 * Defines triggered when the first content rendering of web page. 6009 * 6010 * @typedef OnFirstContentfulPaintEvent 6011 * @syscap SystemCapability.Web.Webview.Core 6012 * @atomicservice 6013 * @since 12 6014 */ 6015declare interface OnFirstContentfulPaintEvent { 6016 /** 6017 * The time at which navigation begins, expressed in microseconds. 6018 * 6019 * @type { number } 6020 * @syscap SystemCapability.Web.Webview.Core 6021 * @atomicservice 6022 * @since 12 6023 */ 6024 navigationStartTick: number; 6025 /** 6026 * The time it takes to draw content for the first time from navigation, expressed in milliseconds. 6027 * 6028 * @type { number } 6029 * @syscap SystemCapability.Web.Webview.Core 6030 * @atomicservice 6031 * @since 12 6032 */ 6033 firstContentfulPaintMs: number; 6034} 6035 6036/** 6037 * Defines the triggered callback when the resources loading is intercepted. 6038 * 6039 * @typedef OnLoadInterceptEvent 6040 * @syscap SystemCapability.Web.Webview.Core 6041 * @crossplatform 6042 * @atomicservice 6043 * @since 12 6044 */ 6045declare interface OnLoadInterceptEvent { 6046 /** 6047 * The information of request. 6048 * 6049 * @type { WebResourceRequest } 6050 * @syscap SystemCapability.Web.Webview.Core 6051 * @crossplatform 6052 * @atomicservice 6053 * @since 12 6054 */ 6055 data: WebResourceRequest; 6056} 6057 6058/** 6059 * Defines the function Triggered when the over scrolling. 6060 * 6061 * @typedef OnOverScrollEvent 6062 * @syscap SystemCapability.Web.Webview.Core 6063 * @atomicservice 6064 * @since 12 6065 */ 6066declare interface OnOverScrollEvent { 6067 /** 6068 * Based on the leftmost part of the page, the horizontal scroll offset is over. 6069 * 6070 * @type { number } 6071 * @syscap SystemCapability.Web.Webview.Core 6072 * @atomicservice 6073 * @since 12 6074 */ 6075 xOffset: number; 6076 /** 6077 * Based on the top of the page, the vertical scroll offset is over. 6078 * 6079 * @type { number } 6080 * @syscap SystemCapability.Web.Webview.Core 6081 * @atomicservice 6082 * @since 12 6083 */ 6084 yOffset: number; 6085} 6086 6087/** 6088 * Defines the JavaScript object to be injected. 6089 * 6090 * @typedef JavaScriptProxy 6091 * @syscap SystemCapability.Web.Webview.Core 6092 * @atomicservice 6093 * @since 12 6094 */ 6095declare interface JavaScriptProxy { 6096 /** 6097 * Objects participating in registration. 6098 * 6099 * @type { object } 6100 * @syscap SystemCapability.Web.Webview.Core 6101 * @atomicservice 6102 * @since 12 6103 */ 6104 object: object; 6105 /** 6106 * The name of the registered object, which is consistent with the 6107 * object name called in the window. 6108 * 6109 * @type { string } 6110 * @syscap SystemCapability.Web.Webview.Core 6111 * @atomicservice 6112 * @since 12 6113 */ 6114 name: string; 6115 /** 6116 * The method of the application side JavaScript object participating 6117 * in the registration. 6118 * 6119 * @type { Array<string> } 6120 * @syscap SystemCapability.Web.Webview.Core 6121 * @atomicservice 6122 * @since 12 6123 */ 6124 methodList: Array<string>; 6125 /** 6126 * Controller. 6127 * 6128 * @type { WebController | WebviewController } 6129 * @syscap SystemCapability.Web.Webview.Core 6130 * @atomicservice 6131 * @since 12 6132 */ 6133 controller: WebController | WebviewController; 6134 /** 6135 * The async method of the application side JavaScript object participating in the registration. 6136 * 6137 * @type { ?Array<string> } 6138 * @syscap SystemCapability.Web.Webview.Core 6139 * @atomicservice 6140 * @since 12 6141 */ 6142 asyncMethodList?: Array<string>; 6143 /** 6144 * permission configuration defining web page URLs that can access JavaScriptProxy methods. 6145 * The configuration can be defined at two levels, object level and method level. 6146 * 6147 * @type { ?string } 6148 * @syscap SystemCapability.Web.Webview.Core 6149 * @atomicservice 6150 * @since 12 6151 */ 6152 permission?: string; 6153} 6154 6155/** 6156 * Enum type supplied to {@link keyboardAvoidMode} for setting the web keyboard avoid mode. 6157 * 6158 * @enum { number } 6159 * @syscap SystemCapability.Web.Webview.Core 6160 * @atomicservice 6161 * @since 12 6162 */ 6163declare enum WebKeyboardAvoidMode { 6164 /** 6165 * Resize the visual viewport when keyboard avoidance occurs. 6166 * 6167 * @syscap SystemCapability.Web.Webview.Core 6168 * @atomicservice 6169 * @since 12 6170 */ 6171 RESIZE_VISUAL = 0, 6172 6173 /** 6174 * Resize the visual and layout viewport when keyboard avoidance occurs. 6175 * 6176 * @syscap SystemCapability.Web.Webview.Core 6177 * @atomicservice 6178 * @since 12 6179 */ 6180 RESIZE_CONTENT = 1, 6181 6182 /** 6183 * Do not resize any viewport when keyboard avoidance occurs. 6184 * 6185 * @syscap SystemCapability.Web.Webview.Core 6186 * @atomicservice 6187 * @since 12 6188 */ 6189 OVERLAYS_CONTENT = 2, 6190} 6191 6192/** 6193 * Defines Web Elements type. 6194 * 6195 * @enum { number } 6196 * @syscap SystemCapability.Web.Webview.Core 6197 * @since 13 6198 */ 6199declare enum WebElementType { 6200 /** 6201 * Image,corresponding HTML image type. 6202 * 6203 * @syscap SystemCapability.Web.Webview.Core 6204 * @since 13 6205 */ 6206 IMAGE = 1, 6207} 6208 6209/** 6210 * ResponseType for contextMenu 6211 * 6212 * @enum { number } 6213 * @syscap SystemCapability.Web.Webview.Core 6214 * @since 13 6215 */ 6216declare enum WebResponseType { 6217 /** 6218 * Long press. 6219 * 6220 * @syscap SystemCapability.Web.Webview.Core 6221 * @since 13 6222 */ 6223 LONG_PRESS = 1, 6224} 6225 6226/** 6227 * Defines the selection menu options. 6228 * 6229 * @typedef SelectionMenuOptionsExt 6230 * @syscap SystemCapability.Web.Webview.Core 6231 * @since 13 6232 */ 6233declare interface SelectionMenuOptionsExt { 6234 /** 6235 * Callback function when the selection menu appears. 6236 * 6237 * @type { ?Callback<void> } 6238 * @syscap SystemCapability.Web.Webview.Core 6239 * @since 13 6240 */ 6241 onAppear?: Callback<void>; 6242 6243 /** 6244 * Callback function when the selection menu disappears. 6245 * 6246 * @type { ?Callback<void> } 6247 * @syscap SystemCapability.Web.Webview.Core 6248 * @since 13 6249 */ 6250 onDisappear?: Callback<void>; 6251 6252 /** 6253 * The preview content of selection menu. 6254 * 6255 * @type { ?CustomBuilder } 6256 * @syscap SystemCapability.Web.Webview.Core 6257 * @since 13 6258 */ 6259 preview?: CustomBuilder; 6260 6261 /** 6262 * Menu type, default value is MenuType.SELECTION_MENU. 6263 * 6264 * @type { ?MenuType } 6265 * @syscap SystemCapability.Web.Webview.Core 6266 * @since 13 6267 */ 6268 menuType?: MenuType; 6269} 6270 6271/** 6272 * Defines the Web attribute functions. 6273 * 6274 * @extends CommonMethod<WebAttribute> 6275 * @syscap SystemCapability.Web.Webview.Core 6276 * @since 8 6277 */ 6278/** 6279 * Defines the Web attribute functions. 6280 * 6281 * @extends CommonMethod<WebAttribute> 6282 * @syscap SystemCapability.Web.Webview.Core 6283 * @crossplatform 6284 * @since 10 6285 */ 6286/** 6287 * Defines the Web attribute functions. 6288 * 6289 * @extends CommonMethod<WebAttribute> 6290 * @syscap SystemCapability.Web.Webview.Core 6291 * @crossplatform 6292 * @atomicservice 6293 * @since 11 6294 */ 6295declare class WebAttribute extends CommonMethod<WebAttribute> { 6296 /** 6297 * Sets whether the Web allows JavaScript scripts to execute. 6298 * 6299 * @param { boolean } javaScriptAccess - {@code true} means the Web can allows JavaScript scripts to execute; {@code false} otherwise. 6300 * The default value is true. 6301 * @returns { WebAttribute } 6302 * @syscap SystemCapability.Web.Webview.Core 6303 * @since 8 6304 */ 6305 /** 6306 * Sets whether the Web allows JavaScript scripts to execute. 6307 * 6308 * @param { boolean } javaScriptAccess - {@code true} means the Web can allows JavaScript scripts to execute; {@code false} otherwise. 6309 * The default value is true. 6310 * @returns { WebAttribute } 6311 * @syscap SystemCapability.Web.Webview.Core 6312 * @crossplatform 6313 * @since 10 6314 */ 6315 /** 6316 * Sets whether the Web allows JavaScript scripts to execute. 6317 * 6318 * @param { boolean } javaScriptAccess - {@code true} means the Web can allows JavaScript scripts to execute; {@code false} otherwise. 6319 * The default value is true. 6320 * @returns { WebAttribute } 6321 * @syscap SystemCapability.Web.Webview.Core 6322 * @crossplatform 6323 * @atomicservice 6324 * @since 11 6325 */ 6326 javaScriptAccess(javaScriptAccess: boolean): WebAttribute; 6327 6328 /** 6329 * Sets whether enable local file system access in Web. 6330 * 6331 * @param { boolean } fileAccess - {@code true} means enable local file system access in Web; {@code false} otherwise. 6332 * The default value is true. 6333 * @returns { WebAttribute } 6334 * @syscap SystemCapability.Web.Webview.Core 6335 * @since 8 6336 */ 6337 /** 6338 * Sets whether enable local file system access in Web. 6339 * 6340 * @param { boolean } fileAccess - {@code true} means enable local file system access in Web; {@code false} otherwise. 6341 * The default value is true. 6342 * @returns { WebAttribute } 6343 * @syscap SystemCapability.Web.Webview.Core 6344 * @atomicservice 6345 * @since 11 6346 */ 6347 /** 6348 * Sets whether enable local file system access in Web. 6349 * 6350 * @param { boolean } fileAccess - {@code true} means enable local file system access in Web; {@code false} otherwise. 6351 * The default value is false. 6352 * @returns { WebAttribute } 6353 * @syscap SystemCapability.Web.Webview.Core 6354 * @atomicservice 6355 * @since 12 6356 */ 6357 fileAccess(fileAccess: boolean): WebAttribute; 6358 6359 /** 6360 * Sets whether to allow image resources to be loaded from the network. 6361 * 6362 * @param { boolean } onlineImageAccess - {@code true} means the Web can allow image resources to be loaded from the network; 6363 * The default value is true. 6364 * {@code false} otherwise. 6365 * @returns { WebAttribute } 6366 * @syscap SystemCapability.Web.Webview.Core 6367 * @since 8 6368 */ 6369 /** 6370 * Sets whether to allow image resources to be loaded from the network. 6371 * 6372 * @param { boolean } onlineImageAccess - {@code true} means the Web can allow image resources to be loaded from the network; 6373 * The default value is true. 6374 * {@code false} otherwise. 6375 * @returns { WebAttribute } 6376 * @syscap SystemCapability.Web.Webview.Core 6377 * @atomicservice 6378 * @since 11 6379 */ 6380 onlineImageAccess(onlineImageAccess: boolean): WebAttribute; 6381 6382 /** 6383 * Sets whether to enable the DOM Storage API permission. 6384 * 6385 * @param { boolean } domStorageAccess - {@code true} means enable the DOM Storage API permission in Web; {@code false} otherwise. 6386 * The default value is false. 6387 * @returns { WebAttribute } 6388 * @syscap SystemCapability.Web.Webview.Core 6389 * @since 8 6390 */ 6391 /** 6392 * Sets whether to enable the DOM Storage API permission. 6393 * 6394 * @param { boolean } domStorageAccess - {@code true} means enable the DOM Storage API permission in Web; {@code false} otherwise. 6395 * The default value is false. 6396 * @returns { WebAttribute } 6397 * @syscap SystemCapability.Web.Webview.Core 6398 * @atomicservice 6399 * @since 11 6400 */ 6401 domStorageAccess(domStorageAccess: boolean): WebAttribute; 6402 6403 /** 6404 * Sets whether the Web can automatically load image resources. 6405 * 6406 * @param { boolean } imageAccess - {@code true} means the Web can automatically load image resources; {@code false} otherwise. 6407 * The default value is true. 6408 * @returns { WebAttribute } 6409 * @syscap SystemCapability.Web.Webview.Core 6410 * @since 8 6411 */ 6412 /** 6413 * Sets whether the Web can automatically load image resources. 6414 * 6415 * @param { boolean } imageAccess - {@code true} means the Web can automatically load image resources; {@code false} otherwise. 6416 * The default value is true. 6417 * @returns { WebAttribute } 6418 * @syscap SystemCapability.Web.Webview.Core 6419 * @atomicservice 6420 * @since 11 6421 */ 6422 imageAccess(imageAccess: boolean): WebAttribute; 6423 6424 /** 6425 * Sets how to load HTTP and HTTPS content. 6426 * 6427 * @param { MixedMode } mixedMode - The mixed mode, which can be {@link MixedMode}. 6428 * @returns { WebAttribute } 6429 * @syscap SystemCapability.Web.Webview.Core 6430 * @since 8 6431 */ 6432 /** 6433 * Sets how to load HTTP and HTTPS content. 6434 * 6435 * @param { MixedMode } mixedMode - The mixed mode, which can be {@link MixedMode}. 6436 * @returns { WebAttribute } 6437 * @syscap SystemCapability.Web.Webview.Core 6438 * @atomicservice 6439 * @since 11 6440 */ 6441 mixedMode(mixedMode: MixedMode): WebAttribute; 6442 6443 /** 6444 * Sets whether the Web supports zooming using gestures. 6445 * 6446 * @param { boolean } zoomAccess {@code true} means the Web supports zooming using gestures; {@code false} otherwise. 6447 * The default value is true. 6448 * @returns { WebAttribute } 6449 * @syscap SystemCapability.Web.Webview.Core 6450 * @since 8 6451 */ 6452 /** 6453 * Sets whether the Web supports zooming using gestures. 6454 * 6455 * @param { boolean } zoomAccess {@code true} means the Web supports zooming using gestures; {@code false} otherwise. 6456 * The default value is true. 6457 * @returns { WebAttribute } 6458 * @syscap SystemCapability.Web.Webview.Core 6459 * @crossplatform 6460 * @since 10 6461 */ 6462 /** 6463 * Sets whether the Web supports zooming using gestures. 6464 * 6465 * @param { boolean } zoomAccess {@code true} means the Web supports zooming using gestures; {@code false} otherwise. 6466 * The default value is true. 6467 * @returns { WebAttribute } 6468 * @syscap SystemCapability.Web.Webview.Core 6469 * @crossplatform 6470 * @atomicservice 6471 * @since 11 6472 */ 6473 zoomAccess(zoomAccess: boolean): WebAttribute; 6474 6475 /** 6476 * Sets whether to allow access to geographical locations. 6477 * 6478 * @param { boolean } geolocationAccess - {@code true} means the Web allows access to geographical locations; {@code false} otherwise. 6479 * The default value is true. 6480 * @returns { WebAttribute } 6481 * @syscap SystemCapability.Web.Webview.Core 6482 * @since 8 6483 */ 6484 /** 6485 * Sets whether to allow access to geographical locations. 6486 * 6487 * @param { boolean } geolocationAccess - {@code true} means the Web allows access to geographical locations; {@code false} otherwise. 6488 * The default value is true. 6489 * @returns { WebAttribute } 6490 * @syscap SystemCapability.Web.Webview.Core 6491 * @crossplatform 6492 * @atomicservice 6493 * @since 11 6494 */ 6495 geolocationAccess(geolocationAccess: boolean): WebAttribute; 6496 6497 /** 6498 * Injects the JavaScript object into window and invoke the function in window. 6499 * 6500 * @param { object } javaScriptProxy - The JavaScript object to be injected. 6501 * @returns { WebAttribute } 6502 * @syscap SystemCapability.Web.Webview.Core 6503 * @since 8 6504 */ 6505 /** 6506 * Injects the JavaScript object into window and invoke the function in window. 6507 * 6508 * @param { object } javaScriptProxy - The JavaScript object to be injected. 6509 * @returns { WebAttribute } 6510 * @syscap SystemCapability.Web.Webview.Core 6511 * @since 9 6512 */ 6513 /** 6514 * Injects the JavaScript object into window and invoke the function in window. 6515 * 6516 * @param { object } javaScriptProxy - The JavaScript object to be injected. 6517 * @returns { WebAttribute } 6518 * @syscap SystemCapability.Web.Webview.Core 6519 * @atomicservice 6520 * @since 11 6521 */ 6522 /** 6523 * Injects the JavaScript object into window and invoke the function in window. 6524 * 6525 * @param { JavaScriptProxy } javaScriptProxy - The JavaScript object to be injected. 6526 * @returns { WebAttribute } 6527 * @syscap SystemCapability.Web.Webview.Core 6528 * @atomicservice 6529 * @since 12 6530 */ 6531 javaScriptProxy(javaScriptProxy: JavaScriptProxy): WebAttribute; 6532 6533 /** 6534 * Sets whether the Web should save the password. 6535 * 6536 * @param { boolean } password - {@code true} means the Web can save the password; {@code false} otherwise. 6537 * @returns { WebAttribute } 6538 * @syscap SystemCapability.Web.Webview.Core 6539 * @since 8 6540 * @deprecated since 10 6541 */ 6542 password(password: boolean): WebAttribute; 6543 6544 /** 6545 * Sets the mode of cache in Web. 6546 * 6547 * @param { CacheMode } cacheMode - The cache mode, which can be {@link CacheMode}. 6548 * @returns { WebAttribute } 6549 * @syscap SystemCapability.Web.Webview.Core 6550 * @since 8 6551 */ 6552 /** 6553 * Sets the mode of cache in Web. 6554 * 6555 * @param { CacheMode } cacheMode - The cache mode, which can be {@link CacheMode}. 6556 * @returns { WebAttribute } 6557 * @syscap SystemCapability.Web.Webview.Core 6558 * @atomicservice 6559 * @since 11 6560 */ 6561 cacheMode(cacheMode: CacheMode): WebAttribute; 6562 6563 /** 6564 * Sets the dark mode of Web. 6565 * 6566 * @param { WebDarkMode } mode - The dark mode, which can be {@link WebDarkMode}. 6567 * @returns { WebAttribute } 6568 * @syscap SystemCapability.Web.Webview.Core 6569 * @since 9 6570 */ 6571 /** 6572 * Sets the dark mode of Web. 6573 * 6574 * @param { WebDarkMode } mode - The dark mode, which can be {@link WebDarkMode}. 6575 * @returns { WebAttribute } 6576 * @syscap SystemCapability.Web.Webview.Core 6577 * @atomicservice 6578 * @since 11 6579 */ 6580 darkMode(mode: WebDarkMode): WebAttribute; 6581 6582 /** 6583 * Sets whether to enable forced dark algorithm when the web is in dark mode 6584 * 6585 * @param { boolean } access {@code true} means enable the force dark algorithm; {@code false} otherwise. 6586 * @returns { WebAttribute } 6587 * @syscap SystemCapability.Web.Webview.Core 6588 * @since 9 6589 */ 6590 /** 6591 * Sets whether to enable forced dark algorithm when the web is in dark mode 6592 * 6593 * @param { boolean } access {@code true} means enable the force dark algorithm; {@code false} otherwise. 6594 * @returns { WebAttribute } 6595 * @syscap SystemCapability.Web.Webview.Core 6596 * @atomicservice 6597 * @since 11 6598 */ 6599 forceDarkAccess(access: boolean): WebAttribute; 6600 6601 /** 6602 * Sets the media options. 6603 * 6604 * @param { WebMediaOptions } options The media options, which can be {@link WebMediaOptions}. 6605 * @returns { WebAttribute } 6606 * @syscap SystemCapability.Web.Webview.Core 6607 * @since 10 6608 */ 6609 /** 6610 * Sets the media options. 6611 * 6612 * @param { WebMediaOptions } options The media options, which can be {@link WebMediaOptions}. 6613 * @returns { WebAttribute } 6614 * @syscap SystemCapability.Web.Webview.Core 6615 * @atomicservice 6616 * @since 11 6617 */ 6618 mediaOptions(options: WebMediaOptions): WebAttribute; 6619 6620 /** 6621 * Sets whether the Web should save the table data. 6622 * 6623 * @param { boolean } tableData {@code true} means the Web can save the table data; {@code false} otherwise. 6624 * @returns { WebAttribute } 6625 * @syscap SystemCapability.Web.Webview.Core 6626 * @since 8 6627 * @deprecated since 10 6628 */ 6629 tableData(tableData: boolean): WebAttribute; 6630 6631 /** 6632 * Sets whether the Web access meta 'viewport' in HTML. 6633 * 6634 * @param { boolean } wideViewModeAccess {@code true} means the Web access meta 'viewport' in HTML; {@code false} otherwise. 6635 * @returns { WebAttribute } 6636 * @syscap SystemCapability.Web.Webview.Core 6637 * @since 8 6638 * @deprecated since 10 6639 */ 6640 wideViewModeAccess(wideViewModeAccess: boolean): WebAttribute; 6641 6642 /** 6643 * Sets whether the Web access overview mode. 6644 * 6645 * @param { boolean } overviewModeAccess {@code true} means the Web access overview mode; {@code false} otherwise. 6646 * The default value is true. 6647 * @returns { WebAttribute } 6648 * @syscap SystemCapability.Web.Webview.Core 6649 * @since 8 6650 */ 6651 /** 6652 * Sets whether the Web access overview mode. 6653 * 6654 * @param { boolean } overviewModeAccess {@code true} means the Web access overview mode; {@code false} otherwise. 6655 * The default value is true. 6656 * @returns { WebAttribute } 6657 * @syscap SystemCapability.Web.Webview.Core 6658 * @atomicservice 6659 * @since 11 6660 */ 6661 overviewModeAccess(overviewModeAccess: boolean): WebAttribute; 6662 /** 6663 * Sets the over-scroll mode for web 6664 * 6665 * @param { OverScrollMode } mode - The over-scroll mode, which can be {@link OverScrollMode}. 6666 * @returns { WebAttribute } 6667 * @syscap SystemCapability.Web.Webview.Core 6668 * @atomicservice 6669 * @since 11 6670 */ 6671 overScrollMode(mode: OverScrollMode): WebAttribute; 6672 /** 6673 * Sets the blur on for elements on webview when soft keyboard is hidden manually. 6674 * 6675 * @param { BlurOnKeyboardHideMode } mode - Default value is SILENT. Set BLUR to enable the blur on keyboard hide mode, which can be {@link BlurOnKeyboardHideMode}. 6676 * @returns { WebAttribute } 6677 * @syscap SystemCapability.Web.Webview.Core 6678 * @atomicservice 6679 * @since 14 6680 */ 6681 blurOnKeyboardHideMode(mode: BlurOnKeyboardHideMode): WebAttribute; 6682 /** 6683 * Sets the ratio of the text zoom. 6684 * 6685 * @param { number } textZoomAtio The ratio of the text zoom. The default value is 100, ranging from 1 to +∞. 6686 * @returns { WebAttribute } 6687 * @syscap SystemCapability.Web.Webview.Core 6688 * @since 8 6689 * @deprecated since 9 6690 * @useinstead ohos.web.WebAttribute#textZoomRatio 6691 */ 6692 textZoomAtio(textZoomAtio: number): WebAttribute; 6693 6694 /** 6695 * Sets the ratio of the text zoom. 6696 * 6697 * @param { number } textZoomRatio The ratio of the text zoom. The default value is 100, ranging from 1 to +∞. 6698 * @returns { WebAttribute } 6699 * @syscap SystemCapability.Web.Webview.Core 6700 * @since 9 6701 */ 6702 /** 6703 * Sets the ratio of the text zoom. 6704 * 6705 * @param { number } textZoomRatio The ratio of the text zoom. The default value is 100, ranging from 1 to +∞. 6706 * @returns { WebAttribute } 6707 * @syscap SystemCapability.Web.Webview.Core 6708 * @atomicservice 6709 * @since 11 6710 */ 6711 textZoomRatio(textZoomRatio: number): WebAttribute; 6712 6713 /** 6714 * Sets whether the Web access the database. 6715 * 6716 * @param { boolean } databaseAccess {@code true} means the Web access the database; {@code false} otherwise. 6717 * The default value is false. 6718 * @returns { WebAttribute } 6719 * @syscap SystemCapability.Web.Webview.Core 6720 * @since 8 6721 */ 6722 /** 6723 * Sets whether the Web access the database. 6724 * 6725 * @param { boolean } databaseAccess {@code true} means the Web access the database; {@code false} otherwise. 6726 * The default value is false. 6727 * @returns { WebAttribute } 6728 * @syscap SystemCapability.Web.Webview.Core 6729 * @atomicservice 6730 * @since 11 6731 */ 6732 databaseAccess(databaseAccess: boolean): WebAttribute; 6733 6734 /** 6735 * Sets the initial scale for the Web. 6736 * 6737 * @param { number } percent the initial scale for the Web. 6738 * @returns { WebAttribute } 6739 * @syscap SystemCapability.Web.Webview.Core 6740 * @since 9 6741 */ 6742 /** 6743 * Sets the initial scale for the Web. 6744 * 6745 * @param { number } percent the initial scale for the Web. 6746 * @returns { WebAttribute } 6747 * @syscap SystemCapability.Web.Webview.Core 6748 * @atomicservice 6749 * @since 11 6750 */ 6751 initialScale(percent: number): WebAttribute; 6752 6753 /** 6754 * Sets the Web's user agent. 6755 * 6756 * @param { string } userAgent The Web's user agent. 6757 * @returns { WebAttribute } 6758 * @syscap SystemCapability.Web.Webview.Core 6759 * @since 8 6760 * @deprecated since 10 6761 * @useinstead ohos.web.webview.webview.WebviewController#setCustomUserAgent 6762 */ 6763 userAgent(userAgent: string): WebAttribute; 6764 6765 /** 6766 * Set whether to support the viewport attribute of the meta tag in the frontend page. 6767 * 6768 * @param { boolean } enabled {@code true} means support the viewport attribute of the meta tag; {@code false} otherwise. 6769 * @returns { WebAttribute } 6770 * @syscap SystemCapability.Web.Webview.Core 6771 * @atomicservice 6772 * @since 12 6773 */ 6774 metaViewport(enabled: boolean): WebAttribute; 6775 6776 /** 6777 * Triggered at the end of web page loading. 6778 * 6779 * @param { function } callback The triggered function at the end of web page loading. 6780 * @returns { WebAttribute } 6781 * @syscap SystemCapability.Web.Webview.Core 6782 * @since 8 6783 */ 6784 /** 6785 * Triggered at the end of web page loading. 6786 * 6787 * @param { function } callback The triggered function at the end of web page loading. 6788 * @returns { WebAttribute } 6789 * @syscap SystemCapability.Web.Webview.Core 6790 * @crossplatform 6791 * @since 10 6792 */ 6793 /** 6794 * Triggered at the end of web page loading. 6795 * 6796 * @param { function } callback The triggered function at the end of web page loading. 6797 * @returns { WebAttribute } 6798 * @syscap SystemCapability.Web.Webview.Core 6799 * @crossplatform 6800 * @atomicservice 6801 * @since 11 6802 */ 6803 /** 6804 * Triggered at the end of web page loading. 6805 * 6806 * @param { Callback<OnPageEndEvent> } callback The triggered function at the end of web page loading. 6807 * @returns { WebAttribute } 6808 * @syscap SystemCapability.Web.Webview.Core 6809 * @crossplatform 6810 * @atomicservice 6811 * @since 12 6812 */ 6813 onPageEnd(callback: Callback<OnPageEndEvent>): WebAttribute; 6814 6815 /** 6816 * Triggered at the begin of web page loading. 6817 * 6818 * @param { function } callback The triggered function at the begin of web page loading. 6819 * @returns { WebAttribute } 6820 * @syscap SystemCapability.Web.Webview.Core 6821 * @since 8 6822 */ 6823 /** 6824 * Triggered at the begin of web page loading. 6825 * 6826 * @param { function } callback The triggered function at the begin of web page loading. 6827 * @returns { WebAttribute } 6828 * @syscap SystemCapability.Web.Webview.Core 6829 * @crossplatform 6830 * @since 10 6831 */ 6832 /** 6833 * Triggered at the begin of web page loading. 6834 * 6835 * @param { function } callback The triggered function at the begin of web page loading. 6836 * @returns { WebAttribute } 6837 * @syscap SystemCapability.Web.Webview.Core 6838 * @crossplatform 6839 * @atomicservice 6840 * @since 11 6841 */ 6842 /** 6843 * Triggered at the begin of web page loading. 6844 * 6845 * @param { Callback<OnPageBeginEvent> } callback The triggered function at the begin of web page loading. 6846 * @returns { WebAttribute } 6847 * @syscap SystemCapability.Web.Webview.Core 6848 * @crossplatform 6849 * @atomicservice 6850 * @since 12 6851 */ 6852 onPageBegin(callback: Callback<OnPageBeginEvent>): WebAttribute; 6853 6854 /** 6855 * Triggered when the page loading progress changes. 6856 * 6857 * @param { function } callback The triggered function when the page loading progress changes. 6858 * @returns { WebAttribute } 6859 * @syscap SystemCapability.Web.Webview.Core 6860 * @since 8 6861 */ 6862 /** 6863 * Triggered when the page loading progress changes. 6864 * 6865 * @param { function } callback The triggered function when the page loading progress changes. 6866 * @returns { WebAttribute } 6867 * @syscap SystemCapability.Web.Webview.Core 6868 * @crossplatform 6869 * @atomicservice 6870 * @since 11 6871 */ 6872 /** 6873 * Triggered when the page loading progress changes. 6874 * 6875 * @param { Callback<OnProgressChangeEvent> } callback The triggered function when the page loading progress changes. 6876 * @returns { WebAttribute } 6877 * @syscap SystemCapability.Web.Webview.Core 6878 * @crossplatform 6879 * @atomicservice 6880 * @since 12 6881 */ 6882 onProgressChange(callback: Callback<OnProgressChangeEvent>): WebAttribute; 6883 6884 /** 6885 * Triggered when the title of the main application document changes. 6886 * 6887 * @param { function } callback The triggered function when the title of the main application document changes. 6888 * @returns { WebAttribute } 6889 * @syscap SystemCapability.Web.Webview.Core 6890 * @since 8 6891 */ 6892 /** 6893 * Triggered when the title of the main application document changes. 6894 * 6895 * @param { function } callback The triggered function when the title of the main application document changes. 6896 * @returns { WebAttribute } 6897 * @syscap SystemCapability.Web.Webview.Core 6898 * @crossplatform 6899 * @atomicservice 6900 * @since 11 6901 */ 6902 /** 6903 * Triggered when the title of the main application document changes. 6904 * 6905 * @param { Callback<OnTitleReceiveEvent> } callback The triggered function when the title of the main application document changes. 6906 * @returns { WebAttribute } 6907 * @syscap SystemCapability.Web.Webview.Core 6908 * @crossplatform 6909 * @atomicservice 6910 * @since 12 6911 */ 6912 onTitleReceive(callback: Callback<OnTitleReceiveEvent>): WebAttribute; 6913 6914 /** 6915 * Triggered when requesting to hide the geolocation. 6916 * 6917 * @param { function } callback The triggered function when requesting to hide the geolocation permission. 6918 * @returns { WebAttribute } 6919 * @syscap SystemCapability.Web.Webview.Core 6920 * @since 8 6921 */ 6922 /** 6923 * Triggered when requesting to hide the geolocation. 6924 * 6925 * @param { function } callback The triggered function when requesting to hide the geolocation permission. 6926 * @returns { WebAttribute } 6927 * @syscap SystemCapability.Web.Webview.Core 6928 * @crossplatform 6929 * @atomicservice 6930 * @since 11 6931 */ 6932 onGeolocationHide(callback: () => void): WebAttribute; 6933 6934 /** 6935 * Triggered when requesting to show the geolocation permission. 6936 * 6937 * @param { function } callback The triggered function when requesting to show the geolocation permission. 6938 * @returns { WebAttribute } 6939 * @syscap SystemCapability.Web.Webview.Core 6940 * @since 8 6941 */ 6942 /** 6943 * Triggered when requesting to show the geolocation permission. 6944 * 6945 * @param { function } callback The triggered function when requesting to show the geolocation permission. 6946 * @returns { WebAttribute } 6947 * @syscap SystemCapability.Web.Webview.Core 6948 * @crossplatform 6949 * @atomicservice 6950 * @since 11 6951 */ 6952 /** 6953 * Triggered when requesting to show the geolocation permission. 6954 * 6955 * @param { Callback<OnGeolocationShowEvent> } callback The triggered function when requesting to show the geolocation permission. 6956 * @returns { WebAttribute } 6957 * @syscap SystemCapability.Web.Webview.Core 6958 * @crossplatform 6959 * @atomicservice 6960 * @since 12 6961 */ 6962 onGeolocationShow(callback: Callback<OnGeolocationShowEvent>): WebAttribute; 6963 6964 /** 6965 * Triggered when the Web gets the focus. 6966 * 6967 * @param { function } callback The triggered function when the Web gets the focus. 6968 * @returns { WebAttribute } 6969 * @syscap SystemCapability.Web.Webview.Core 6970 * @since 8 6971 */ 6972 /** 6973 * Triggered when the Web gets the focus. 6974 * 6975 * @param { function } callback The triggered function when the Web gets the focus. 6976 * @returns { WebAttribute } 6977 * @syscap SystemCapability.Web.Webview.Core 6978 * @atomicservice 6979 * @since 11 6980 */ 6981 onRequestSelected(callback: () => void): WebAttribute; 6982 6983 /** 6984 * Triggered when the Web wants to display a JavaScript alert() dialog. 6985 * 6986 * @param { function } callback The triggered function when the web page wants to display a JavaScript alert() dialog. 6987 * @returns { WebAttribute } 6988 * @syscap SystemCapability.Web.Webview.Core 6989 * @since 8 6990 */ 6991 /** 6992 * Triggered when the Web wants to display a JavaScript alert() dialog. 6993 * 6994 * @param { function } callback The triggered function when the web page wants to display a JavaScript alert() dialog. 6995 * @returns { WebAttribute } 6996 * @syscap SystemCapability.Web.Webview.Core 6997 * @crossplatform 6998 * @atomicservice 6999 * @since 11 7000 */ 7001 /** 7002 * Triggered when the Web wants to display a JavaScript alert() dialog. 7003 * 7004 * @param { Callback<OnAlertEvent, boolean> } callback The triggered function when the web page wants to display a JavaScript alert() dialog. 7005 * @returns { WebAttribute } 7006 * @syscap SystemCapability.Web.Webview.Core 7007 * @crossplatform 7008 * @atomicservice 7009 * @since 12 7010 */ 7011 onAlert(callback: Callback<OnAlertEvent, boolean>): WebAttribute; 7012 7013 /** 7014 * Triggered when the Web wants to confirm navigation from JavaScript onbeforeunload. 7015 * 7016 * @param { function } callback The triggered function when the web page wants to confirm navigation from JavaScript onbeforeunload. 7017 * @returns { WebAttribute } 7018 * @syscap SystemCapability.Web.Webview.Core 7019 * @since 8 7020 */ 7021 /** 7022 * Triggered when the Web wants to confirm navigation from JavaScript onbeforeunload. 7023 * 7024 * @param { function } callback The triggered function when the web page wants to confirm navigation from JavaScript onbeforeunload. 7025 * @returns { WebAttribute } 7026 * @syscap SystemCapability.Web.Webview.Core 7027 * @atomicservice 7028 * @since 11 7029 */ 7030 /** 7031 * Triggered when the Web wants to confirm navigation from JavaScript onbeforeunload. 7032 * 7033 * @param { Callback<OnBeforeUnloadEvent, boolean> } callback The triggered function when the web page wants to confirm navigation from JavaScript onbeforeunload. 7034 * @returns { WebAttribute } 7035 * @syscap SystemCapability.Web.Webview.Core 7036 * @atomicservice 7037 * @since 12 7038 */ 7039 onBeforeUnload(callback: Callback<OnBeforeUnloadEvent, boolean>): WebAttribute; 7040 7041 /** 7042 * Triggered when the web page wants to display a JavaScript confirm() dialog. 7043 * 7044 * @param { function } callback The Triggered function when the web page wants to display a JavaScript confirm() dialog. 7045 * @returns { WebAttribute } 7046 * @syscap SystemCapability.Web.Webview.Core 7047 * @since 8 7048 */ 7049 /** 7050 * Triggered when the web page wants to display a JavaScript confirm() dialog. 7051 * 7052 * @param { function } callback The Triggered function when the web page wants to display a JavaScript confirm() dialog. 7053 * @returns { WebAttribute } 7054 * @syscap SystemCapability.Web.Webview.Core 7055 * @crossplatform 7056 * @atomicservice 7057 * @since 11 7058 */ 7059 /** 7060 * Triggered when the web page wants to display a JavaScript confirm() dialog. 7061 * 7062 * @param { Callback<OnConfirmEvent, boolean> } callback The triggered function when the web page wants to display a JavaScript confirm() dialog. 7063 * @returns { WebAttribute } 7064 * @syscap SystemCapability.Web.Webview.Core 7065 * @crossplatform 7066 * @atomicservice 7067 * @since 12 7068 */ 7069 onConfirm(callback: Callback<OnConfirmEvent, boolean>): WebAttribute; 7070 7071 /** 7072 * Triggered when the web page wants to display a JavaScript prompt() dialog. 7073 * 7074 * @param { function } callback The Triggered function when the web page wants to display a JavaScript prompt() dialog. 7075 * @returns { WebAttribute } 7076 * @syscap SystemCapability.Web.Webview.Core 7077 * @since 9 7078 */ 7079 /** 7080 * Triggered when the web page wants to display a JavaScript prompt() dialog. 7081 * 7082 * @param { function } callback The Triggered function when the web page wants to display a JavaScript prompt() dialog. 7083 * @returns { WebAttribute } 7084 * @syscap SystemCapability.Web.Webview.Core 7085 * @crossplatform 7086 * @atomicservice 7087 * @since 11 7088 */ 7089 /** 7090 * Triggered when the web page wants to display a JavaScript prompt() dialog. 7091 * 7092 * @param { Callback<OnPromptEvent, boolean> } callback The triggered function when the web page wants to display a JavaScript prompt() dialog. 7093 * @returns { WebAttribute } 7094 * @syscap SystemCapability.Web.Webview.Core 7095 * @crossplatform 7096 * @atomicservice 7097 * @since 12 7098 */ 7099 onPrompt(callback: Callback<OnPromptEvent, boolean>): WebAttribute; 7100 7101 /** 7102 * Triggered when the web page receives a JavaScript console message. 7103 * 7104 * @param { function } callback The triggered function when the web page receives a JavaScript console message. 7105 * @returns { WebAttribute } 7106 * @syscap SystemCapability.Web.Webview.Core 7107 * @since 8 7108 */ 7109 /** 7110 * Triggered when the web page receives a JavaScript console message. 7111 * 7112 * @param { function } callback The triggered function when the web page receives a JavaScript console message. 7113 * @returns { WebAttribute } 7114 * @syscap SystemCapability.Web.Webview.Core 7115 * @crossplatform 7116 * @atomicservice 7117 * @since 11 7118 */ 7119 /** 7120 * Triggered when the web page receives a JavaScript console message. 7121 * 7122 * @param { Callback<OnConsoleEvent, boolean> } callback The triggered function when the web page receives a JavaScript console message. 7123 * @returns { WebAttribute } 7124 * @syscap SystemCapability.Web.Webview.Core 7125 * @crossplatform 7126 * @atomicservice 7127 * @since 12 7128 */ 7129 onConsole(callback: Callback<OnConsoleEvent, boolean>): WebAttribute; 7130 7131 /** 7132 * Triggered when the web page receives a web resource loading error. 7133 * 7134 * @param { function } callback The triggered function when the web page receives a web resource loading error. 7135 * @returns { WebAttribute } 7136 * @syscap SystemCapability.Web.Webview.Core 7137 * @since 8 7138 */ 7139 /** 7140 * Triggered when the web page receives a web resource loading error. 7141 * 7142 * @param { function } callback The triggered function when the web page receives a web resource loading error. 7143 * @returns { WebAttribute } 7144 * @syscap SystemCapability.Web.Webview.Core 7145 * @crossplatform 7146 * @since 10 7147 */ 7148 /** 7149 * Triggered when the web page receives a web resource loading error. 7150 * 7151 * @param { function } callback The triggered function when the web page receives a web resource loading error. 7152 * @returns { WebAttribute } 7153 * @syscap SystemCapability.Web.Webview.Core 7154 * @crossplatform 7155 * @atomicservice 7156 * @since 11 7157 */ 7158 /** 7159 * Triggered when the web page receives a web resource loading error. 7160 * 7161 * @param { Callback<OnErrorReceiveEvent> } callback The triggered function when the web page receives a web resource loading error. 7162 * @returns { WebAttribute } 7163 * @syscap SystemCapability.Web.Webview.Core 7164 * @crossplatform 7165 * @atomicservice 7166 * @since 12 7167 */ 7168 onErrorReceive(callback: Callback<OnErrorReceiveEvent>): WebAttribute; 7169 7170 /** 7171 * Triggered when the web page receives a web resource loading HTTP error. 7172 * 7173 * @param { function } callback The triggered function when the web page receives a web resource loading HTTP error. 7174 * @returns { WebAttribute } 7175 * @syscap SystemCapability.Web.Webview.Core 7176 * @since 8 7177 */ 7178 /** 7179 * Triggered when the web page receives a web resource loading HTTP error. 7180 * 7181 * @param { function } callback The triggered function when the web page receives a web resource loading HTTP error. 7182 * @returns { WebAttribute } 7183 * @syscap SystemCapability.Web.Webview.Core 7184 * @crossplatform 7185 * @atomicservice 7186 * @since 11 7187 */ 7188 /** 7189 * Triggered when the web page receives a web resource loading HTTP error. 7190 * 7191 * @param { Callback<OnHttpErrorReceiveEvent> } callback The triggered function when the web page receives a web resource loading HTTP error. 7192 * @returns { WebAttribute } 7193 * @syscap SystemCapability.Web.Webview.Core 7194 * @crossplatform 7195 * @atomicservice 7196 * @since 12 7197 */ 7198 onHttpErrorReceive(callback: Callback<OnHttpErrorReceiveEvent>): WebAttribute; 7199 7200 /** 7201 * Triggered when starting to download. 7202 * 7203 * @param { function } callback The triggered function when starting to download. 7204 * @returns { WebAttribute } 7205 * @syscap SystemCapability.Web.Webview.Core 7206 * @since 8 7207 */ 7208 /** 7209 * Triggered when starting to download. 7210 * 7211 * @param { function } callback The triggered function when starting to download. 7212 * @returns { WebAttribute } 7213 * @syscap SystemCapability.Web.Webview.Core 7214 * @crossplatform 7215 * @atomicservice 7216 * @since 11 7217 */ 7218 /** 7219 * Triggered when starting to download. 7220 * 7221 * @param { Callback<OnDownloadStartEvent> } callback The triggered function when starting to download. 7222 * @returns { WebAttribute } 7223 * @syscap SystemCapability.Web.Webview.Core 7224 * @crossplatform 7225 * @atomicservice 7226 * @since 12 7227 */ 7228 onDownloadStart(callback: Callback<OnDownloadStartEvent>): WebAttribute; 7229 7230 /** 7231 * Triggered when the Web page refreshes accessed history. 7232 * 7233 * @param { function } callback The triggered callback when the Web page refreshes accessed history. 7234 * @returns { WebAttribute } 7235 * @syscap SystemCapability.Web.Webview.Core 7236 * @since 8 7237 */ 7238 /** 7239 * Triggered when the Web page refreshes accessed history. 7240 * 7241 * @param { function } callback The triggered callback when the Web page refreshes accessed history. 7242 * @returns { WebAttribute } 7243 * @syscap SystemCapability.Web.Webview.Core 7244 * @atomicservice 7245 * @since 11 7246 */ 7247 /** 7248 * Triggered when the Web page refreshes accessed history. 7249 * 7250 * @param { Callback<OnRefreshAccessedHistoryEvent> } callback The triggered callback when the Web page refreshes accessed history. 7251 * @returns { WebAttribute } 7252 * @syscap SystemCapability.Web.Webview.Core 7253 * @atomicservice 7254 * @since 12 7255 */ 7256 onRefreshAccessedHistory(callback: Callback<OnRefreshAccessedHistoryEvent>): WebAttribute; 7257 7258 /** 7259 * Triggered when the URL loading is intercepted. 7260 * 7261 * @param { function } callback The triggered callback when the URL loading is intercepted. 7262 * @returns { WebAttribute } 7263 * @syscap SystemCapability.Web.Webview.Core 7264 * @since 8 7265 * @deprecated since 10 7266 * @useinstead ohos.web.WebAttribute#onLoadIntercept 7267 */ 7268 onUrlLoadIntercept(callback: (event?: { data: string | WebResourceRequest }) => boolean): WebAttribute; 7269 7270 /** 7271 * Triggered when the Web page receives an ssl Error. 7272 * 7273 * @param { function } callback The triggered callback when the Web page receives an ssl Error. 7274 * @returns { WebAttribute } 7275 * @syscap SystemCapability.Web.Webview.Core 7276 * @since 8 7277 * @deprecated since 9 7278 * @useinstead ohos.web.WebAttribute#onSslErrorEventReceive 7279 */ 7280 onSslErrorReceive(callback: (event?: { handler: Function, error: object }) => void): WebAttribute; 7281 7282 /** 7283 * Triggered when the render process exits. 7284 * 7285 * @param { function } callback The triggered when the render process exits. 7286 * @returns { WebAttribute } 7287 * @syscap SystemCapability.Web.Webview.Core 7288 * @since 9 7289 */ 7290 /** 7291 * Triggered when the render process exits. 7292 * 7293 * @param { function } callback The triggered when the render process exits. 7294 * @returns { WebAttribute } 7295 * @syscap SystemCapability.Web.Webview.Core 7296 * @atomicservice 7297 * @since 11 7298 */ 7299 /** 7300 * Triggered when the render process exits. 7301 * 7302 * @param { Callback<OnRenderExitedEvent> } callback The triggered when the render process exits. 7303 * @returns { WebAttribute } 7304 * @syscap SystemCapability.Web.Webview.Core 7305 * @atomicservice 7306 * @since 12 7307 */ 7308 onRenderExited(callback: Callback<OnRenderExitedEvent>): WebAttribute; 7309 7310 /** 7311 * Triggered when the file selector shows. 7312 * 7313 * @param { function } callback The triggered when the file selector shows. 7314 * @returns { WebAttribute } 7315 * @syscap SystemCapability.Web.Webview.Core 7316 * @since 9 7317 */ 7318 /** 7319 * Triggered when the file selector shows. 7320 * 7321 * @param { function } callback The triggered when the file selector shows. 7322 * @returns { WebAttribute } 7323 * @syscap SystemCapability.Web.Webview.Core 7324 * @crossplatform 7325 * @atomicservice 7326 * @since 11 7327 */ 7328 /** 7329 * Triggered when the file selector shows. 7330 * 7331 * @param { Callback<OnShowFileSelectorEvent, boolean> } callback The triggered when the file selector shows. 7332 * @returns { WebAttribute } 7333 * @syscap SystemCapability.Web.Webview.Core 7334 * @crossplatform 7335 * @atomicservice 7336 * @since 12 7337 */ 7338 onShowFileSelector(callback: Callback<OnShowFileSelectorEvent, boolean>): WebAttribute; 7339 7340 /** 7341 * Triggered when the render process exits. 7342 * 7343 * @param { function } callback The triggered when the render process exits. 7344 * @returns { WebAttribute } 7345 * @syscap SystemCapability.Web.Webview.Core 7346 * @since 8 7347 * @deprecated since 9 7348 * @useinstead ohos.web.WebAttribute#onRenderExited 7349 */ 7350 onRenderExited(callback: (event?: { detail: object }) => boolean): WebAttribute; 7351 7352 /** 7353 * Triggered when the file selector shows. 7354 * 7355 * @param { function } callback The triggered when the file selector shows. 7356 * @returns { WebAttribute } 7357 * @syscap SystemCapability.Web.Webview.Core 7358 * @since 8 7359 * @deprecated since 9 7360 * @useinstead ohos.web.WebAttribute#onShowFileSelector 7361 */ 7362 onFileSelectorShow(callback: (event?: { callback: Function, fileSelector: object }) => void): WebAttribute; 7363 7364 /** 7365 * Triggered when the url loading. 7366 * 7367 * @param { function } callback The triggered when the url loading. 7368 * @returns { WebAttribute } 7369 * @syscap SystemCapability.Web.Webview.Core 7370 * @since 9 7371 */ 7372 /** 7373 * Triggered when the url loading. 7374 * 7375 * @param { function } callback The triggered when the url loading. 7376 * @returns { WebAttribute } 7377 * @syscap SystemCapability.Web.Webview.Core 7378 * @atomicservice 7379 * @since 11 7380 */ 7381 /** 7382 * Triggered when the url loading. 7383 * 7384 * @param { Callback<OnResourceLoadEvent> } callback The triggered when the url loading. 7385 * @returns { WebAttribute } 7386 * @syscap SystemCapability.Web.Webview.Core 7387 * @atomicservice 7388 * @since 12 7389 */ 7390 onResourceLoad(callback: Callback<OnResourceLoadEvent>): WebAttribute; 7391 7392 /** 7393 * Triggered when the web component exit the full screen mode. 7394 * 7395 * @param { function } callback The triggered function when the web component exit the full screen mode. 7396 * @returns { WebAttribute } 7397 * @syscap SystemCapability.Web.Webview.Core 7398 * @since 9 7399 */ 7400 /** 7401 * Triggered when the web component exit the full screen mode. 7402 * 7403 * @param { function } callback The triggered function when the web component exit the full screen mode. 7404 * @returns { WebAttribute } 7405 * @syscap SystemCapability.Web.Webview.Core 7406 * @atomicservice 7407 * @since 11 7408 */ 7409 onFullScreenExit(callback: () => void): WebAttribute; 7410 7411 /** 7412 * Triggered when the web component enter the full screen mode. 7413 * 7414 * @param { function } callback The triggered function when the web component enter the full screen mode. 7415 * @returns { WebAttribute } 7416 * @syscap SystemCapability.Web.Webview.Core 7417 * @since 9 7418 */ 7419 /** 7420 * Triggered when the web component enter the full screen mode. 7421 * 7422 * @param { function } callback The triggered function when the web component enter the full screen mode. 7423 * @returns { WebAttribute } 7424 * @syscap SystemCapability.Web.Webview.Core 7425 * @atomicservice 7426 * @since 11 7427 */ 7428 /** 7429 * Triggered when the web component enter the full screen mode. 7430 * 7431 * @param { OnFullScreenEnterCallback } callback - The triggered function when the web component enter the full screen mode. 7432 * @returns { WebAttribute } 7433 * @syscap SystemCapability.Web.Webview.Core 7434 * @atomicservice 7435 * @since 12 7436 */ 7437 onFullScreenEnter(callback: OnFullScreenEnterCallback): WebAttribute; 7438 7439 /** 7440 * Triggered when the scale of WebView changed. 7441 * 7442 * @param { function } callback The triggered when the scale of WebView changed. 7443 * @returns { WebAttribute } 7444 * @syscap SystemCapability.Web.Webview.Core 7445 * @since 9 7446 */ 7447 /** 7448 * Triggered when the scale of WebView changed. 7449 * 7450 * @param { function } callback The triggered when the scale of WebView changed. 7451 * @returns { WebAttribute } 7452 * @syscap SystemCapability.Web.Webview.Core 7453 * @crossplatform 7454 * @atomicservice 7455 * @since 11 7456 */ 7457 /** 7458 * Triggered when the scale of WebView changed. 7459 * 7460 * @param { Callback<OnScaleChangeEvent> } callback The triggered when the scale of WebView changed. 7461 * @returns { WebAttribute } 7462 * @syscap SystemCapability.Web.Webview.Core 7463 * @crossplatform 7464 * @atomicservice 7465 * @since 12 7466 */ 7467 onScaleChange(callback: Callback<OnScaleChangeEvent>): WebAttribute; 7468 7469 /** 7470 * Triggered when the browser needs credentials from the user. 7471 * 7472 * @param { function } callback The triggered when the browser needs credentials from the user. 7473 * @returns { WebAttribute } 7474 * @syscap SystemCapability.Web.Webview.Core 7475 * @since 9 7476 */ 7477 /** 7478 * Triggered when the browser needs credentials from the user. 7479 * 7480 * @param { function } callback The triggered when the browser needs credentials from the user. 7481 * @returns { WebAttribute } 7482 * @syscap SystemCapability.Web.Webview.Core 7483 * @crossplatform 7484 * @atomicservice 7485 * @since 11 7486 */ 7487 /** 7488 * Triggered when the browser needs credentials from the user. 7489 * 7490 * @param { Callback<OnHttpAuthRequestEvent, boolean> } callback The triggered when the browser needs credentials from the user. 7491 * @returns { WebAttribute } 7492 * @syscap SystemCapability.Web.Webview.Core 7493 * @crossplatform 7494 * @atomicservice 7495 * @since 12 7496 */ 7497 onHttpAuthRequest(callback: Callback<OnHttpAuthRequestEvent, boolean>): WebAttribute; 7498 7499 /** 7500 * Triggered when the resources loading is intercepted. 7501 * 7502 * @param { function } callback The triggered callback when the resources loading is intercepted. 7503 * @returns { WebAttribute } If the response value is null, the Web will continue to load the resources. Otherwise, the response value will be used 7504 * @syscap SystemCapability.Web.Webview.Core 7505 * @since 9 7506 */ 7507 /** 7508 * Triggered when the resources loading is intercepted. 7509 * 7510 * @param { function } callback The triggered callback when the resources loading is intercepted. 7511 * @returns { WebAttribute } If the response value is null, the Web will continue to load the resources. Otherwise, the response value will be used 7512 * @syscap SystemCapability.Web.Webview.Core 7513 * @atomicservice 7514 * @since 11 7515 */ 7516 /** 7517 * Triggered when the resources loading is intercepted. 7518 * 7519 * @param { Callback<OnInterceptRequestEvent, WebResourceResponse> } callback The triggered callback when the resources loading is intercepted. 7520 * @returns { WebAttribute } If the response value is null, the Web will continue to load the resources. Otherwise, the response value will be used 7521 * @syscap SystemCapability.Web.Webview.Core 7522 * @atomicservice 7523 * @since 12 7524 */ 7525 onInterceptRequest(callback: Callback<OnInterceptRequestEvent, WebResourceResponse>): WebAttribute; 7526 7527 /** 7528 * Triggered when the host application that web content from the specified origin is attempting to access the resources. 7529 * 7530 * @param { function } callback The triggered callback when the host application that web content from the specified origin is 7531 * attempting to access the resources. 7532 * @returns { WebAttribute } 7533 * @syscap SystemCapability.Web.Webview.Core 7534 * @since 9 7535 */ 7536 /** 7537 * Triggered when the host application that web content from the specified origin is attempting to access the resources. 7538 * 7539 * @param { function } callback The triggered callback when the host application that web content from the specified origin is 7540 * attempting to access the resources. 7541 * @returns { WebAttribute } 7542 * @syscap SystemCapability.Web.Webview.Core 7543 * @crossplatform 7544 * @atomicservice 7545 * @since 11 7546 */ 7547 /** 7548 * Triggered when the host application that web content from the specified origin is attempting to access the resources. 7549 * 7550 * @param { Callback<OnPermissionRequestEvent> } callback The triggered callback when the host application that web content from the specified origin is 7551 * attempting to access the resources. 7552 * @returns { WebAttribute } 7553 * @syscap SystemCapability.Web.Webview.Core 7554 * @crossplatform 7555 * @atomicservice 7556 * @since 12 7557 */ 7558 onPermissionRequest(callback: Callback<OnPermissionRequestEvent>): WebAttribute; 7559 7560 /** 7561 * Triggered when the host application that web content from the specified origin is requesting to capture screen. 7562 * @param { function } callback The triggered callback when the host application that web content from the specified origin is 7563 * requesting to capture screen. 7564 * @returns { WebAttribute } 7565 * @syscap SystemCapability.Web.Webview.Core 7566 * @since 10 7567 */ 7568 /** 7569 * Triggered when the host application that web content from the specified origin is requesting to capture screen. 7570 * @param { function } callback The triggered callback when the host application that web content from the specified origin is 7571 * requesting to capture screen. 7572 * @returns { WebAttribute } 7573 * @syscap SystemCapability.Web.Webview.Core 7574 * @atomicservice 7575 * @since 11 7576 */ 7577 /** 7578 * Triggered when the host application that web content from the specified origin is requesting to capture screen. 7579 * @param { Callback<OnScreenCaptureRequestEvent> } callback The triggered callback when the host application that web content from the specified origin is 7580 * requesting to capture screen. 7581 * @returns { WebAttribute } 7582 * @syscap SystemCapability.Web.Webview.Core 7583 * @atomicservice 7584 * @since 12 7585 */ 7586 onScreenCaptureRequest(callback: Callback<OnScreenCaptureRequestEvent>): WebAttribute; 7587 7588 /** 7589 * Triggered when called to allow custom display of the context menu. 7590 * 7591 * @param { function } callback The triggered callback when called to allow custom display of the context menu. 7592 * @returns { WebAttribute } If custom display return true.Otherwise, default display return false. 7593 * @syscap SystemCapability.Web.Webview.Core 7594 * @since 9 7595 */ 7596 /** 7597 * Triggered when called to allow custom display of the context menu. 7598 * 7599 * @param { function } callback The triggered callback when called to allow custom display of the context menu. 7600 * @returns { WebAttribute } If custom display return true.Otherwise, default display return false. 7601 * @syscap SystemCapability.Web.Webview.Core 7602 * @atomicservice 7603 * @since 11 7604 */ 7605 /** 7606 * Triggered when called to allow custom display of the context menu. 7607 * 7608 * @param { Callback<OnContextMenuShowEvent, boolean> } callback The triggered callback when called to allow custom display of the context menu. 7609 * @returns { WebAttribute } If custom display return true.Otherwise, default display return false. 7610 * @syscap SystemCapability.Web.Webview.Core 7611 * @atomicservice 7612 * @since 12 7613 */ 7614 onContextMenuShow(callback: Callback<OnContextMenuShowEvent, boolean>): WebAttribute; 7615 7616 /** 7617 * Triggered when called to allow custom hide of the context menu. 7618 * 7619 * @param { OnContextMenuHideCallback } callback The triggered function when called to allow custom hide of the context menu. 7620 * @returns { WebAttribute } 7621 * @syscap SystemCapability.Web.Webview.Core 7622 * @atomicservice 7623 * @since 11 7624 */ 7625 onContextMenuHide(callback: OnContextMenuHideCallback): WebAttribute; 7626 7627 /** 7628 * Set whether media playback needs to be triggered by user gestures. 7629 * 7630 * @param { boolean } access True if it needs to be triggered manually by the user else false. 7631 * The default value is true. 7632 * @returns { WebAttribute } 7633 * @syscap SystemCapability.Web.Webview.Core 7634 * @since 9 7635 */ 7636 /** 7637 * Set whether media playback needs to be triggered by user gestures. 7638 * 7639 * @param { boolean } access True if it needs to be triggered manually by the user else false. 7640 * The default value is true. 7641 * @returns { WebAttribute } 7642 * @syscap SystemCapability.Web.Webview.Core 7643 * @crossplatform 7644 * @atomicservice 7645 * @since 11 7646 */ 7647 mediaPlayGestureAccess(access: boolean): WebAttribute; 7648 7649 /** 7650 * Notify search result to host application through onSearchResultReceive. 7651 * 7652 * @param { function } callback Function Triggered when the host application call searchAllAsync. 7653 * or searchNext api on WebController and the request is valid. 7654 * @returns { WebAttribute } 7655 * @syscap SystemCapability.Web.Webview.Core 7656 * @since 9 7657 */ 7658 /** 7659 * Notify search result to host application through onSearchResultReceive. 7660 * 7661 * @param { function } callback Function Triggered when the host application call searchAllAsync. 7662 * or searchNext api on WebController and the request is valid. 7663 * @returns { WebAttribute } 7664 * @syscap SystemCapability.Web.Webview.Core 7665 * @atomicservice 7666 * @since 11 7667 */ 7668 /** 7669 * Notify search result to host application through onSearchResultReceive. 7670 * 7671 * @param { Callback<OnSearchResultReceiveEvent> } callback Function Triggered when the host application call searchAllAsync. 7672 * or searchNext api on WebController and the request is valid. 7673 * @returns { WebAttribute } 7674 * @syscap SystemCapability.Web.Webview.Core 7675 * @atomicservice 7676 * @since 12 7677 */ 7678 onSearchResultReceive(callback: Callback<OnSearchResultReceiveEvent>): WebAttribute; 7679 7680 /** 7681 * Triggered when the scroll bar slides to the specified position. 7682 * 7683 * @param { function } callback Function Triggered when the scroll bar slides to the specified position. 7684 * @returns { WebAttribute } 7685 * @syscap SystemCapability.Web.Webview.Core 7686 * @since 9 7687 */ 7688 /** 7689 * Triggered when the scroll bar slides to the specified position. 7690 * 7691 * @param { function } callback Function Triggered when the scroll bar slides to the specified position. 7692 * @returns { WebAttribute } 7693 * @syscap SystemCapability.Web.Webview.Core 7694 * @crossplatform 7695 * @atomicservice 7696 * @since 11 7697 */ 7698 /** 7699 * Triggered when the scroll bar slides to the specified position. 7700 * 7701 * @param { Callback<OnScrollEvent> } callback Function Triggered when the scroll bar slides to the specified position. 7702 * @returns { WebAttribute } 7703 * @syscap SystemCapability.Web.Webview.Core 7704 * @crossplatform 7705 * @atomicservice 7706 * @since 12 7707 */ 7708 onScroll(callback: Callback<OnScrollEvent>): WebAttribute; 7709 7710 /** 7711 * Triggered when the Web page receives an ssl Error. 7712 * 7713 * @param { function } callback The triggered callback when the Web page receives an ssl Error. 7714 * @returns { WebAttribute } 7715 * @syscap SystemCapability.Web.Webview.Core 7716 * @since 9 7717 */ 7718 /** 7719 * Triggered when the Web page receives an ssl Error. 7720 * 7721 * @param { function } callback The triggered callback when the Web page receives an ssl Error. 7722 * @returns { WebAttribute } 7723 * @syscap SystemCapability.Web.Webview.Core 7724 * @atomicservice 7725 * @since 11 7726 */ 7727 /** 7728 * Triggered when the Web page receives an ssl Error. 7729 * 7730 * @param { Callback<OnSslErrorEventReceiveEvent> } callback The triggered callback when the Web page receives an ssl Error. 7731 * @returns { WebAttribute } 7732 * @syscap SystemCapability.Web.Webview.Core 7733 * @atomicservice 7734 * @since 12 7735 */ 7736 onSslErrorEventReceive(callback: Callback<OnSslErrorEventReceiveEvent>): WebAttribute; 7737 7738 /** 7739 * Triggered when the Web page receives an ssl Error. 7740 * 7741 * @param { OnSslErrorEventCallback } callback The triggered callback when the Web page receives an ssl Error. 7742 * @returns { WebAttribute } 7743 * @syscap SystemCapability.Web.Webview.Core 7744 * @atomicservice 7745 * @since 12 7746 */ 7747 onSslErrorEvent(callback: OnSslErrorEventCallback): WebAttribute; 7748 7749 /** 7750 * Triggered when the Web page needs ssl client certificate from the user. 7751 * 7752 * @param { function } callback The triggered callback when needs ssl client certificate from the user. 7753 * @returns { WebAttribute } 7754 * @syscap SystemCapability.Web.Webview.Core 7755 * @since 9 7756 */ 7757 /** 7758 * Triggered when the Web page needs ssl client certificate from the user. 7759 * 7760 * @param { function } callback The triggered callback when needs ssl client certificate from the user. 7761 * @returns { WebAttribute } 7762 * @syscap SystemCapability.Web.Webview.Core 7763 * @atomicservice 7764 * @since 11 7765 */ 7766 /** 7767 * Triggered when the Web page needs ssl client certificate from the user. 7768 * 7769 * @param { Callback<OnClientAuthenticationEvent> } callback The triggered callback when needs ssl client certificate from the user. 7770 * @returns { WebAttribute } 7771 * @syscap SystemCapability.Web.Webview.Core 7772 * @atomicservice 7773 * @since 12 7774 */ 7775 onClientAuthenticationRequest(callback: Callback<OnClientAuthenticationEvent>): WebAttribute; 7776 7777 /** 7778 * Triggered when web page requires the user to create a window. 7779 * 7780 * @param { function } callback The triggered callback when web page requires the user to create a window. 7781 * @returns { WebAttribute } 7782 * @syscap SystemCapability.Web.Webview.Core 7783 * @since 9 7784 */ 7785 /** 7786 * Triggered when web page requires the user to create a window. 7787 * 7788 * @param { function } callback The triggered callback when web page requires the user to create a window. 7789 * @returns { WebAttribute } 7790 * @syscap SystemCapability.Web.Webview.Core 7791 * @atomicservice 7792 * @since 11 7793 */ 7794 /** 7795 * Triggered when web page requires the user to create a window. 7796 * 7797 * @param { Callback<OnWindowNewEvent> } callback The triggered callback when web page requires the user to create a window. 7798 * @returns { WebAttribute } 7799 * @syscap SystemCapability.Web.Webview.Core 7800 * @atomicservice 7801 * @since 12 7802 */ 7803 onWindowNew(callback: Callback<OnWindowNewEvent>): WebAttribute; 7804 7805 /** 7806 * Triggered when web page requires the user to close a window. 7807 * 7808 * @param { function } callback The triggered callback when web page requires the user to close a window. 7809 * @returns { WebAttribute } 7810 * @syscap SystemCapability.Web.Webview.Core 7811 * @since 9 7812 */ 7813 /** 7814 * Triggered when web page requires the user to close a window. 7815 * 7816 * @param { function } callback The triggered callback when web page requires the user to close a window. 7817 * @returns { WebAttribute } 7818 * @syscap SystemCapability.Web.Webview.Core 7819 * @atomicservice 7820 * @since 11 7821 */ 7822 onWindowExit(callback: () => void): WebAttribute; 7823 7824 /** 7825 * Set whether multiple windows are supported. 7826 * 7827 * @param { boolean } multiWindow True if it needs to be triggered manually by the user else false. 7828 * The default value is false. 7829 * @returns { WebAttribute } 7830 * @syscap SystemCapability.Web.Webview.Core 7831 * @since 9 7832 */ 7833 /** 7834 * Set whether multiple windows are supported. 7835 * 7836 * @param { boolean } multiWindow True if it needs to be triggered manually by the user else false. 7837 * The default value is false. 7838 * @returns { WebAttribute } 7839 * @syscap SystemCapability.Web.Webview.Core 7840 * @atomicservice 7841 * @since 11 7842 */ 7843 multiWindowAccess(multiWindow: boolean): WebAttribute; 7844 7845 /** 7846 * Key events notify the application before the WebView consumes them. 7847 * 7848 * @param { function } callback Key event info. 7849 * @returns { WebAttribute } True if the application consumes key events else false. 7850 * @syscap SystemCapability.Web.Webview.Core 7851 * @since 9 7852 */ 7853 /** 7854 * Key events notify the application before the WebView consumes them. 7855 * 7856 * @param { function } callback Key event info. 7857 * @returns { WebAttribute } True if the application consumes key events else false. 7858 * @syscap SystemCapability.Web.Webview.Core 7859 * @atomicservice 7860 * @since 11 7861 */ 7862 onInterceptKeyEvent(callback: (event: KeyEvent) => boolean): WebAttribute; 7863 7864 /** 7865 * Set the font of webview standard font library. The default font is "sans serif". 7866 * 7867 * @param { string } family Standard font set series. 7868 * @returns { WebAttribute } 7869 * @syscap SystemCapability.Web.Webview.Core 7870 * @since 9 7871 */ 7872 /** 7873 * Set the font of webview standard font library. The default font is "sans serif". 7874 * 7875 * @param { string } family Standard font set series. 7876 * @returns { WebAttribute } 7877 * @syscap SystemCapability.Web.Webview.Core 7878 * @atomicservice 7879 * @since 11 7880 */ 7881 webStandardFont(family: string): WebAttribute; 7882 7883 /** 7884 * Set the font of webview serif font library. The default font is "serif". 7885 * 7886 * @param { string } family Serif font set series. 7887 * @returns { WebAttribute } 7888 * @syscap SystemCapability.Web.Webview.Core 7889 * @since 9 7890 */ 7891 /** 7892 * Set the font of webview serif font library. The default font is "serif". 7893 * 7894 * @param { string } family Serif font set series. 7895 * @returns { WebAttribute } 7896 * @syscap SystemCapability.Web.Webview.Core 7897 * @atomicservice 7898 * @since 11 7899 */ 7900 webSerifFont(family: string): WebAttribute; 7901 7902 /** 7903 * Set the font of webview sans serif font library. The default font is "sans-serif". 7904 * 7905 * @param { string } family Sans serif font set series. 7906 * @returns { WebAttribute } 7907 * @syscap SystemCapability.Web.Webview.Core 7908 * @since 9 7909 */ 7910 /** 7911 * Set the font of webview sans serif font library. The default font is "sans-serif". 7912 * 7913 * @param { string } family Sans serif font set series. 7914 * @returns { WebAttribute } 7915 * @syscap SystemCapability.Web.Webview.Core 7916 * @atomicservice 7917 * @since 11 7918 */ 7919 webSansSerifFont(family: string): WebAttribute; 7920 7921 /** 7922 * Set the font of webview fixed font library. The default font is "monospace". 7923 * 7924 * @param { string } family Fixed font set series. 7925 * @returns { WebAttribute } 7926 * @syscap SystemCapability.Web.Webview.Core 7927 * @since 9 7928 */ 7929 /** 7930 * Set the font of webview fixed font library. The default font is "monospace". 7931 * 7932 * @param { string } family Fixed font set series. 7933 * @returns { WebAttribute } 7934 * @syscap SystemCapability.Web.Webview.Core 7935 * @atomicservice 7936 * @since 11 7937 */ 7938 webFixedFont(family: string): WebAttribute; 7939 7940 /** 7941 * Set the font of webview fantasy font library. The default font is "fantasy". 7942 * 7943 * @param { string } family fantasy font set series. 7944 * @returns { WebAttribute } 7945 * @syscap SystemCapability.Web.Webview.Core 7946 * @since 9 7947 */ 7948 /** 7949 * Set the font of webview fantasy font library. The default font is "fantasy". 7950 * 7951 * @param { string } family fantasy font set series. 7952 * @returns { WebAttribute } 7953 * @syscap SystemCapability.Web.Webview.Core 7954 * @atomicservice 7955 * @since 11 7956 */ 7957 webFantasyFont(family: string): WebAttribute; 7958 7959 /** 7960 * Set the font of webview cursive font library. The default font is "cursive". 7961 * 7962 * @param { string } family Cursive font set series. 7963 * @returns { WebAttribute } 7964 * @syscap SystemCapability.Web.Webview.Core 7965 * @since 9 7966 */ 7967 /** 7968 * Set the font of webview cursive font library. The default font is "cursive". 7969 * 7970 * @param { string } family Cursive font set series. 7971 * @returns { WebAttribute } 7972 * @syscap SystemCapability.Web.Webview.Core 7973 * @atomicservice 7974 * @since 11 7975 */ 7976 webCursiveFont(family: string): WebAttribute; 7977 7978 /** 7979 * Set the default fixed font value of webview. The default value is 13, ranging from 1 to 72. 7980 * 7981 * @param { number } size Font size. 7982 * @returns { WebAttribute } 7983 * @syscap SystemCapability.Web.Webview.Core 7984 * @since 9 7985 */ 7986 /** 7987 * Set the default fixed font value of webview. The default value is 13, ranging from 1 to 72. 7988 * 7989 * @param { number } size Font size. 7990 * @returns { WebAttribute } 7991 * @syscap SystemCapability.Web.Webview.Core 7992 * @atomicservice 7993 * @since 11 7994 */ 7995 defaultFixedFontSize(size: number): WebAttribute; 7996 7997 /** 7998 * Set the default font value of webview. The default value is 16, ranging from 1 to 72. 7999 * 8000 * @param { number } size Font size. 8001 * @returns { WebAttribute } 8002 * @syscap SystemCapability.Web.Webview.Core 8003 * @since 9 8004 */ 8005 /** 8006 * Set the default font value of webview. The default value is 16, ranging from 1 to 72. 8007 * 8008 * @param { number } size Font size. 8009 * @returns { WebAttribute } 8010 * @syscap SystemCapability.Web.Webview.Core 8011 * @atomicservice 8012 * @since 11 8013 */ 8014 defaultFontSize(size: number): WebAttribute; 8015 8016 /** 8017 * Set the minimum value of webview font. The default value is 8, ranging from 1 to 72. 8018 * 8019 * @param { number } size Font size. 8020 * @returns { WebAttribute } 8021 * @syscap SystemCapability.Web.Webview.Core 8022 * @since 9 8023 */ 8024 /** 8025 * Set the minimum value of webview font. The default value is 8, ranging from 1 to 72. 8026 * 8027 * @param { number } size Font size. 8028 * @returns { WebAttribute } 8029 * @syscap SystemCapability.Web.Webview.Core 8030 * @crossplatform 8031 * @atomicservice 8032 * @since 11 8033 */ 8034 minFontSize(size: number): WebAttribute; 8035 8036 /** 8037 * Set the logical minimum value of webview font. The default value is 8, ranging from 1 to 72. 8038 * 8039 * @param { number } size Font size. 8040 * @returns { WebAttribute } 8041 * @syscap SystemCapability.Web.Webview.Core 8042 * @since 9 8043 */ 8044 /** 8045 * Set the logical minimum value of webview font. The default value is 8, ranging from 1 to 72. 8046 * 8047 * @param { number } size Font size. 8048 * @returns { WebAttribute } 8049 * @syscap SystemCapability.Web.Webview.Core 8050 * @atomicservice 8051 * @since 11 8052 */ 8053 minLogicalFontSize(size: number): WebAttribute; 8054 8055 /** 8056 * Set the default text encodingFormat value of webview. The default value is UTF-8. 8057 * 8058 * @param { string } textEncodingFormat text encodingFormat. 8059 * @returns { WebAttribute } 8060 * @syscap SystemCapability.Web.Webview.Core 8061 * @atomicservice 8062 * @since 12 8063 */ 8064 defaultTextEncodingFormat(textEncodingFormat: string): WebAttribute; 8065 8066 /** 8067 * Whether force display the scroll bar. 8068 * 8069 * @param { boolean } enabled {@code true} means show; {@code false} otherwise. 8070 * @returns { WebAttribute } 8071 * @syscap SystemCapability.Web.Webview.Core 8072 * @atomicservice 8073 * @since 14 8074 */ 8075 forceDisplayScrollBar(enabled: boolean): WebAttribute; 8076 8077 /** 8078 * Whether web component can load resource from network. 8079 * 8080 * @param { boolean } block {@code true} means it can't load resource from network; {@code false} otherwise. 8081 * @returns { WebAttribute } 8082 * @syscap SystemCapability.Web.Webview.Core 8083 * @since 9 8084 */ 8085 /** 8086 * Whether web component can load resource from network. 8087 * 8088 * @param { boolean } block {@code true} means it can't load resource from network; {@code false} otherwise. 8089 * @returns { WebAttribute } 8090 * @syscap SystemCapability.Web.Webview.Core 8091 * @atomicservice 8092 * @since 11 8093 */ 8094 blockNetwork(block: boolean): WebAttribute; 8095 8096 /** 8097 * Set whether paint horizontal scroll bar. 8098 * 8099 * @param { boolean } horizontalScrollBar True if it needs to paint horizontal scroll bar. 8100 * The default value is true. 8101 * @returns { WebAttribute } 8102 * @syscap SystemCapability.Web.Webview.Core 8103 * @since 9 8104 */ 8105 /** 8106 * Set whether paint horizontal scroll bar. 8107 * 8108 * @param { boolean } horizontalScrollBar True if it needs to paint horizontal scroll bar. 8109 * The default value is true. 8110 * @returns { WebAttribute } 8111 * @syscap SystemCapability.Web.Webview.Core 8112 * @crossplatform 8113 * @atomicservice 8114 * @since 11 8115 */ 8116 horizontalScrollBarAccess(horizontalScrollBar: boolean): WebAttribute; 8117 8118 /** 8119 * Set whether paint vertical scroll bar. 8120 * 8121 * @param { boolean } verticalScrollBar True if it needs to paint vertical scroll bar. 8122 * The default value is true. 8123 * @returns { WebAttribute } 8124 * @syscap SystemCapability.Web.Webview.Core 8125 * @since 9 8126 */ 8127 /** 8128 * Set whether paint vertical scroll bar. 8129 * 8130 * @param { boolean } verticalScrollBar True if it needs to paint vertical scroll bar. 8131 * The default value is true. 8132 * @returns { WebAttribute } 8133 * @syscap SystemCapability.Web.Webview.Core 8134 * @crossplatform 8135 * @atomicservice 8136 * @since 11 8137 */ 8138 verticalScrollBarAccess(verticalScrollBar: boolean): WebAttribute; 8139 8140 /** 8141 * Triggered when the application receive the url of an apple-touch-icon. 8142 * 8143 * @param { function } callback The triggered callback when the application receive an new url of an 8144 * apple-touch-icon. 8145 * @returns { WebAttribute } 8146 * @syscap SystemCapability.Web.Webview.Core 8147 * @since 9 8148 */ 8149 /** 8150 * Triggered when the application receive the url of an apple-touch-icon. 8151 * 8152 * @param { function } callback The triggered callback when the application receive an new url of an 8153 * apple-touch-icon. 8154 * @returns { WebAttribute } 8155 * @syscap SystemCapability.Web.Webview.Core 8156 * @atomicservice 8157 * @since 11 8158 */ 8159 /** 8160 * Triggered when the application receive the url of an apple-touch-icon. 8161 * 8162 * @param { Callback<OnTouchIconUrlReceivedEvent> } callback The triggered callback when the application receive an new url of an 8163 * apple-touch-icon. 8164 * @returns { WebAttribute } 8165 * @syscap SystemCapability.Web.Webview.Core 8166 * @atomicservice 8167 * @since 12 8168 */ 8169 onTouchIconUrlReceived(callback: Callback<OnTouchIconUrlReceivedEvent>): WebAttribute; 8170 8171 /** 8172 * Triggered when the application receive a new favicon for the current web page. 8173 * 8174 * @param { function } callback The triggered callback when the application receive a new favicon for the 8175 * current web page. 8176 * @returns { WebAttribute } 8177 * @syscap SystemCapability.Web.Webview.Core 8178 * @since 9 8179 */ 8180 /** 8181 * Triggered when the application receive a new favicon for the current web page. 8182 * 8183 * @param { function } callback The triggered callback when the application receive a new favicon for the 8184 * current web page. 8185 * @returns { WebAttribute } 8186 * @syscap SystemCapability.Web.Webview.Core 8187 * @atomicservice 8188 * @since 11 8189 */ 8190 /** 8191 * Triggered when the application receive a new favicon for the current web page. 8192 * 8193 * @param { Callback<OnFaviconReceivedEvent> } callback The triggered callback when the application receive a new favicon for the 8194 * current web page. 8195 * @returns { WebAttribute } 8196 * @syscap SystemCapability.Web.Webview.Core 8197 * @atomicservice 8198 * @since 12 8199 */ 8200 onFaviconReceived(callback: Callback<OnFaviconReceivedEvent>): WebAttribute; 8201 8202 /** 8203 * Triggered when previous page will no longer be drawn and next page begin to draw. 8204 * 8205 * @param { function } callback The triggered callback when previous page will no longer be drawn and next 8206 * page begin to draw. 8207 * @returns { WebAttribute } 8208 * @syscap SystemCapability.Web.Webview.Core 8209 * @since 9 8210 */ 8211 /** 8212 * Triggered when previous page will no longer be drawn and next page begin to draw. 8213 * 8214 * @param { function } callback The triggered callback when previous page will no longer be drawn and next 8215 * page begin to draw. 8216 * @returns { WebAttribute } 8217 * @syscap SystemCapability.Web.Webview.Core 8218 * @crossplatform 8219 * @atomicservice 8220 * @since 11 8221 */ 8222 /** 8223 * Triggered when previous page will no longer be drawn and next page begin to draw. 8224 * 8225 * @param { Callback<OnPageVisibleEvent> } callback The triggered callback when previous page will no longer be drawn and next 8226 * page begin to draw. 8227 * @returns { WebAttribute } 8228 * @syscap SystemCapability.Web.Webview.Core 8229 * @crossplatform 8230 * @atomicservice 8231 * @since 12 8232 */ 8233 onPageVisible(callback: Callback<OnPageVisibleEvent>): WebAttribute; 8234 8235 /** 8236 * Triggered when the form could be resubmitted. 8237 * 8238 * @param { function } callback The triggered callback to decision whether resend form data or not. 8239 * @returns { WebAttribute } 8240 * @syscap SystemCapability.Web.Webview.Core 8241 * @since 9 8242 */ 8243 /** 8244 * Triggered when the form could be resubmitted. 8245 * 8246 * @param { function } callback The triggered callback to decision whether resend form data or not. 8247 * @returns { WebAttribute } 8248 * @syscap SystemCapability.Web.Webview.Core 8249 * @atomicservice 8250 * @since 11 8251 */ 8252 /** 8253 * Triggered when the form could be resubmitted. 8254 * 8255 * @param { Callback<OnDataResubmittedEvent> } callback The triggered callback to decision whether resend form data or not. 8256 * @returns { WebAttribute } 8257 * @syscap SystemCapability.Web.Webview.Core 8258 * @atomicservice 8259 * @since 12 8260 */ 8261 onDataResubmitted(callback: Callback<OnDataResubmittedEvent>): WebAttribute; 8262 8263 /** 8264 * Set whether enable pinch smooth mode. 8265 * 8266 * @param { boolean } isEnabled True if it needs to enable smooth mode. 8267 * @returns { WebAttribute } 8268 * @syscap SystemCapability.Web.Webview.Core 8269 * @since 9 8270 */ 8271 /** 8272 * Set whether enable pinch smooth mode. 8273 * 8274 * @param { boolean } isEnabled True if it needs to enable smooth mode. 8275 * @returns { WebAttribute } 8276 * @syscap SystemCapability.Web.Webview.Core 8277 * @atomicservice 8278 * @since 11 8279 */ 8280 pinchSmooth(isEnabled: boolean): WebAttribute; 8281 8282 /** 8283 * Whether the window can be open automatically through JavaScript. 8284 * 8285 * @param { boolean } flag If it is true, the window can be opened automatically through JavaScript. 8286 * If it is false and user behavior, the window can be opened automatically through JavaScript. 8287 * Otherwise, the window cannot be opened. 8288 * @returns { WebAttribute } 8289 * @syscap SystemCapability.Web.Webview.Core 8290 * @since 10 8291 */ 8292 /** 8293 * Whether the window can be open automatically through JavaScript. 8294 * 8295 * @param { boolean } flag If it is true, the window can be opened automatically through JavaScript. 8296 * If it is false and user behavior, the window can be opened automatically through JavaScript. 8297 * Otherwise, the window cannot be opened. 8298 * @returns { WebAttribute } 8299 * @syscap SystemCapability.Web.Webview.Core 8300 * @atomicservice 8301 * @since 11 8302 */ 8303 allowWindowOpenMethod(flag: boolean): WebAttribute; 8304 8305 /** 8306 * Triggered when the playing state of audio on web page changed. 8307 * 8308 * @param { function } callback The playing state of audio on web page. 8309 * @returns { WebAttribute } 8310 * @syscap SystemCapability.Web.Webview.Core 8311 * @since 10 8312 */ 8313 /** 8314 * Triggered when the playing state of audio on web page changed. 8315 * 8316 * @param { function } callback The playing state of audio on web page. 8317 * @returns { WebAttribute } 8318 * @syscap SystemCapability.Web.Webview.Core 8319 * @atomicservice 8320 * @since 11 8321 */ 8322 /** 8323 * Triggered when the playing state of audio on web page changed. 8324 * 8325 * @param { Callback<OnAudioStateChangedEvent> } callback The playing state of audio on web page. 8326 * @returns { WebAttribute } 8327 * @syscap SystemCapability.Web.Webview.Core 8328 * @atomicservice 8329 * @since 12 8330 */ 8331 onAudioStateChanged(callback: Callback<OnAudioStateChangedEvent>): WebAttribute; 8332 8333 /** 8334 * Triggered when the first content rendering of web page. 8335 * 8336 * @param { function } callback 8337 * @returns { WebAttribute } 8338 * @syscap SystemCapability.Web.Webview.Core 8339 * @since 10 8340 */ 8341 /** 8342 * Triggered when the first content rendering of web page. 8343 * 8344 * @param { function } callback 8345 * @returns { WebAttribute } 8346 * @syscap SystemCapability.Web.Webview.Core 8347 * @atomicservice 8348 * @since 11 8349 */ 8350 /** 8351 * Triggered when the first content rendering of web page. 8352 * 8353 * @param { Callback<OnFirstContentfulPaintEvent> } callback 8354 * @returns { WebAttribute } 8355 * @syscap SystemCapability.Web.Webview.Core 8356 * @atomicservice 8357 * @since 12 8358 */ 8359 onFirstContentfulPaint(callback: Callback<OnFirstContentfulPaintEvent>): WebAttribute; 8360 8361 /** 8362 * Called when the First rendering of meaningful content time(FMP) 8363 * 8364 * @param { OnFirstMeaningfulPaintCallback } callback Function Triggered when the firstMeaningfulPaint. 8365 * @returns { WebAttribute } 8366 * @syscap SystemCapability.Web.Webview.Core 8367 * @atomicservice 8368 * @since 12 8369 */ 8370 onFirstMeaningfulPaint(callback: OnFirstMeaningfulPaintCallback): WebAttribute; 8371 8372 /** 8373 * Called when the Maximum content rendering time(LCP). 8374 * 8375 * @param { OnLargestContentfulPaintCallback } callback Function Triggered when the largestContentfulPaint. 8376 * @returns { WebAttribute } 8377 * @syscap SystemCapability.Web.Webview.Core 8378 * @atomicservice 8379 * @since 12 8380 */ 8381 onLargestContentfulPaint(callback: OnLargestContentfulPaintCallback): WebAttribute; 8382 8383 /** 8384 * Triggered when the resources loading is intercepted. 8385 * 8386 * @param { function } callback The triggered callback when the resources loading is intercepted. 8387 * @returns { WebAttribute } 8388 * @syscap SystemCapability.Web.Webview.Core 8389 * @since 10 8390 */ 8391 /** 8392 * Triggered when the resources loading is intercepted. 8393 * 8394 * @param { function } callback The triggered callback when the resources loading is intercepted. 8395 * @returns { WebAttribute } 8396 * @syscap SystemCapability.Web.Webview.Core 8397 * @crossplatform 8398 * @atomicservice 8399 * @since 11 8400 */ 8401 /** 8402 * Triggered when the resources loading is intercepted. 8403 * 8404 * @param { Callback<OnLoadInterceptEvent, boolean> } callback The triggered callback when the resources loading is intercepted. 8405 * @returns { WebAttribute } 8406 * @syscap SystemCapability.Web.Webview.Core 8407 * @crossplatform 8408 * @atomicservice 8409 * @since 12 8410 */ 8411 onLoadIntercept(callback: Callback<OnLoadInterceptEvent, boolean>): WebAttribute; 8412 8413 /** 8414 * Triggered when The controller is bound to the web component, this controller must be a WebviewController. 8415 * This callback can not use the interface about manipulating web pages. 8416 * @param { function } callback The triggered callback when web controller initialization success. 8417 * @returns { WebAttribute } 8418 * @syscap SystemCapability.Web.Webview.Core 8419 * @since 10 8420 */ 8421 /** 8422 * Triggered when The controller is bound to the web component, this controller must be a WebviewController. 8423 * This callback can not use the interface about manipulating web pages. 8424 * @param { function } callback The triggered callback when web controller initialization success. 8425 * @returns { WebAttribute } 8426 * @syscap SystemCapability.Web.Webview.Core 8427 * @crossplatform 8428 * @atomicservice 8429 * @since 11 8430 */ 8431 onControllerAttached(callback: () => void): WebAttribute; 8432 8433 /** 8434 * Triggered when the over scrolling. 8435 * @param { function } callback Function Triggered when the over scrolling. 8436 * @returns { WebAttribute } 8437 * @syscap SystemCapability.Web.Webview.Core 8438 * @since 10 8439 */ 8440 /** 8441 * Triggered when the over scrolling. 8442 * @param { function } callback Function Triggered when the over scrolling. 8443 * @returns { WebAttribute } 8444 * @syscap SystemCapability.Web.Webview.Core 8445 * @atomicservice 8446 * @since 11 8447 */ 8448 /** 8449 * Triggered when the over scrolling. 8450 * @param { Callback<OnOverScrollEvent> } callback Function Triggered when the over scrolling. 8451 * @returns { WebAttribute } 8452 * @syscap SystemCapability.Web.Webview.Core 8453 * @atomicservice 8454 * @since 12 8455 */ 8456 onOverScroll(callback: Callback<OnOverScrollEvent>): WebAttribute; 8457 8458 /** 8459 * Called when received website security risk check result. 8460 * 8461 * @param { OnSafeBrowsingCheckResultCallback } callback - Function triggered when received website security risk check result. 8462 * @returns { WebAttribute } 8463 * @syscap SystemCapability.Web.Webview.Core 8464 * @atomicservice 8465 * @since 11 8466 */ 8467 onSafeBrowsingCheckResult(callback: OnSafeBrowsingCheckResultCallback): WebAttribute; 8468 8469 /** 8470 * Called when the load committed. 8471 * 8472 * @param { OnNavigationEntryCommittedCallback } callback Function Triggered when a load committed. 8473 * @returns { WebAttribute } 8474 * @syscap SystemCapability.Web.Webview.Core 8475 * @atomicservice 8476 * @since 11 8477 */ 8478 onNavigationEntryCommitted(callback: OnNavigationEntryCommittedCallback): WebAttribute; 8479 8480 /** 8481 * Called when tracker's cookie is prevented. 8482 * 8483 * @param { OnIntelligentTrackingPreventionCallback } callback - Callback triggered when tracker's cookie is prevented. 8484 * @returns { WebAttribute } 8485 * @syscap SystemCapability.Web.Webview.Core 8486 * @atomicservice 8487 * @since 12 8488 */ 8489 onIntelligentTrackingPreventionResult(callback: OnIntelligentTrackingPreventionCallback): WebAttribute; 8490 8491 /** 8492 * Injects the JavaScripts before Webview creates the DOM tree, and then the JavaScript snippet will run after the document has been created. 8493 * @param { Array<ScriptItem> } scripts - The array of the JavaScripts to be injected. 8494 * @returns { WebAttribute } 8495 * @syscap SystemCapability.Web.Webview.Core 8496 * @atomicservice 8497 * @since 11 8498 */ 8499 javaScriptOnDocumentStart(scripts: Array<ScriptItem>): WebAttribute; 8500 8501 /** 8502 * Injects the JavaScripts before Webview creates the DOM tree, and then the JavaScript snippet will run after the document has been created. 8503 * @param { Array<ScriptItem> } scripts - The array of the JavaScripts to be injected. 8504 * @returns { WebAttribute } 8505 * @syscap SystemCapability.Web.Webview.Core 8506 * @atomicservice 8507 * @since 11 8508 */ 8509 javaScriptOnDocumentEnd(scripts: Array<ScriptItem>): WebAttribute; 8510 8511 /** 8512 * Set web layout Mode. 8513 * @param { WebLayoutMode } mode - The web layout mode, which can be {@link WebLayoutMode}. 8514 * @returns { WebAttribute } 8515 * @syscap SystemCapability.Web.Webview.Core 8516 * @atomicservice 8517 * @since 11 8518 */ 8519 layoutMode(mode: WebLayoutMode): WebAttribute; 8520 8521 /** 8522 * Called to setting the nested scroll options. 8523 * 8524 * @param { NestedScrollOptions } value - options for nested scrolling. 8525 * @returns { WebAttribute } the attribute of the scroll. 8526 * @syscap SystemCapability.Web.Webview.Core 8527 * @atomicservice 8528 * @since 11 8529 */ 8530 /** 8531 * Called to setting the nested scroll options. 8532 * 8533 * @param { NestedScrollOptions | NestedScrollOptionsExt } value - options for 8534 * nested scrolling. 8535 * @returns { WebAttribute } the attribute of the scroll. 8536 * @syscap SystemCapability.Web.Webview.Core 8537 * @atomicservice 8538 * @since 14 8539 */ 8540 nestedScroll(value: NestedScrollOptions | NestedScrollOptionsExt): WebAttribute; 8541 8542 /** 8543 * Sets the enable native embed mode for web. 8544 * 8545 * @param { boolean } mode - True if it needs to enable native embed mode. 8546 * @returns { WebAttribute } 8547 * @syscap SystemCapability.Web.Webview.Core 8548 * @atomicservice 8549 * @since 11 8550 */ 8551 enableNativeEmbedMode(mode: boolean): WebAttribute; 8552 8553 /** 8554 * Register native pattern with specific tag and type. 8555 * 8556 * @param { string } tag - Tag name used by html webpage. 8557 * @param { string } type - Type of the tag. 8558 * @returns { WebAttribute } 8559 * @syscap SystemCapability.Web.Webview.Core 8560 * @atomicservice 8561 * @since 12 8562 */ 8563 registerNativeEmbedRule(tag: string, type:string): WebAttribute; 8564 8565 /** 8566 * Triggered when embed lifecycle changes. 8567 * 8568 * @param { function } callback - Function Triggered when embed lifecycle changes. 8569 * @returns { WebAttribute } 8570 * @syscap SystemCapability.Web.Webview.Core 8571 * @atomicservice 8572 * @since 11 8573 */ 8574 onNativeEmbedLifecycleChange(callback: (event: NativeEmbedDataInfo) => void): WebAttribute; 8575 8576 /** 8577 * Triggered when embed visibility changes. 8578 * 8579 * @param { OnNativeEmbedVisibilityChangeCallback } callback - Callback triggered when embed visibility changes. 8580 * @returns { WebAttribute } 8581 * @syscap SystemCapability.Web.Webview.Core 8582 * @since 12 8583 */ 8584 onNativeEmbedVisibilityChange(callback: OnNativeEmbedVisibilityChangeCallback): WebAttribute; 8585 8586 /** 8587 * Triggered when gesture effect on embed tag. 8588 * 8589 * @param { function } callback - Function Triggered when gesture effect on embed tag. 8590 * @returns { WebAttribute } 8591 * @syscap SystemCapability.Web.Webview.Core 8592 * @atomicservice 8593 * @since 11 8594 */ 8595 onNativeEmbedGestureEvent(callback: (event: NativeEmbedTouchInfo) => void): WebAttribute; 8596 8597 /** 8598 * Called to set copy option 8599 * 8600 * @param { CopyOptions } value - copy option. 8601 * @returns { WebAttribute } the attribute of the scroll. 8602 * @syscap SystemCapability.Web.Webview.Core 8603 * @atomicservice 8604 * @since 11 8605 */ 8606 copyOptions(value: CopyOptions): WebAttribute; 8607 8608 /** 8609 * When the URL is about to be loaded into the current Web, it gives the application the opportunity to take control. 8610 * This will not called for POST requests, may be called for subframes and with non-HTTP(S) schemes. 8611 * 8612 * @param { OnOverrideUrlLoadingCallback } callback - The callback for onOverrideUrlLoading. 8613 * @returns { WebAttribute } 8614 * @syscap SystemCapability.Web.Webview.Core 8615 * @atomicservice 8616 * @since 12 8617 */ 8618 onOverrideUrlLoading(callback: OnOverrideUrlLoadingCallback): WebAttribute; 8619 8620 /** 8621 * Enable whether to automatically resize text. The default value is true. 8622 * 8623 * @param { boolean } textAutosizing - Whether to enable text autosizing. 8624 * @returns { WebAttribute } 8625 * @syscap SystemCapability.Web.Webview.Core 8626 * @atomicservice 8627 * @since 12 8628 */ 8629 textAutosizing(textAutosizing: boolean): WebAttribute; 8630 8631 /** 8632 * Enable app creates native media player to play web page media source. 8633 * 8634 * @param { NativeMediaPlayerConfig } config - The configuration of native media player. 8635 * @returns { WebAttribute } 8636 * @syscap SystemCapability.Web.Webview.Core 8637 * @atomicservice 8638 * @since 12 8639 */ 8640 enableNativeMediaPlayer(config: NativeMediaPlayerConfig): WebAttribute; 8641 8642 /** 8643 * Triggered when render process not responding. 8644 * 8645 * @param { OnRenderProcessNotRespondingCallback } callback The triggered function when render process not responding. 8646 * @returns { WebAttribute } 8647 * @syscap SystemCapability.Web.Webview.Core 8648 * @since 12 8649 */ 8650 onRenderProcessNotResponding(callback: OnRenderProcessNotRespondingCallback): WebAttribute; 8651 8652 /** 8653 * Triggered when the unresponsive render process becomes responsive. 8654 * 8655 * @param { OnRenderProcessRespondingCallback } callback The triggered function when the unresponsive render process becomes responsive. 8656 * @returns { WebAttribute } 8657 * @syscap SystemCapability.Web.Webview.Core 8658 * @since 12 8659 */ 8660 onRenderProcessResponding(callback: OnRenderProcessRespondingCallback): WebAttribute; 8661 8662 /** 8663 * Set the custom text menu. 8664 * 8665 * @param { Array<ExpandedMenuItemOptions> } expandedMenuOptions - Customize text menu options. 8666 * @returns { WebAttribute } 8667 * @syscap SystemCapability.Web.Webview.Core 8668 * @since 12 8669 */ 8670 selectionMenuOptions(expandedMenuOptions: Array<ExpandedMenuItemOptions>): WebAttribute; 8671 8672 /** 8673 * Triggered when the viewport-fit meta is detected for web page. 8674 * 8675 * @param { OnViewportFitChangedCallback } callback - The callback for onViewportFitChanged. 8676 * @returns { WebAttribute } 8677 * @syscap SystemCapability.Web.Webview.Core 8678 * @atomicservice 8679 * @since 12 8680 */ 8681 onViewportFitChanged(callback: OnViewportFitChangedCallback): WebAttribute; 8682 8683 /** 8684 * When the soft keyboard is about to be displayed on the current Web, 8685 * it gives the application the opportunity to intercept the system keyboard attachment. 8686 * The application can return the keyboard options to control the web to 8687 * pull up the soft keyboard of the different type. 8688 * 8689 * @param { WebKeyboardCallback } callback - The callback for onInterceptKeyboardAttach. 8690 * @returns { WebAttribute } 8691 * @syscap SystemCapability.Web.Webview.Core 8692 * @atomicservice 8693 * @since 12 8694 */ 8695 onInterceptKeyboardAttach(callback: WebKeyboardCallback): WebAttribute; 8696 8697 /** 8698 * Called when received Ads blocked results. 8699 * If blocked results exist at the end of page loading, the first call will be triggered. 8700 * To avoid performance issues, subsequent results will be periodically reported through this api. 8701 * 8702 * @param { OnAdsBlockedCallback } callback - The callback for OnAdsBlockedCallback. 8703 * @returns { WebAttribute } 8704 * @syscap SystemCapability.Web.Webview.Core 8705 * @atomicservice 8706 * @since 12 8707 */ 8708 onAdsBlocked(callback: OnAdsBlockedCallback): WebAttribute; 8709 8710 /** 8711 * Set web avoidance keyboard mode. The default value is WebKeyboardAvoidMode.RESIZE_CONTENT. 8712 * 8713 * @param { WebKeyboardAvoidMode } mode - The web keyboard avoid mode, which can be {@link WebKeyboardAvoidMode}. 8714 * @returns { WebAttribute } 8715 * @syscap SystemCapability.Web.Webview.Core 8716 * @atomicservice 8717 * @since 12 8718 */ 8719 keyboardAvoidMode(mode: WebKeyboardAvoidMode): WebAttribute; 8720 8721 /** 8722 * Set the custom text menu. 8723 * 8724 * @param { EditMenuOptions } editMenu - Customize text menu options. 8725 * @returns { WebAttribute } 8726 * @syscap SystemCapability.Web.Webview.Core 8727 * @since 12 8728 */ 8729 editMenuOptions(editMenu: EditMenuOptions): WebAttribute; 8730 8731 /** 8732 * Enable or disable haptic feedback. 8733 * 8734 * @param { boolean } enabled - Default value is true, set false to disable haptic feedback. 8735 * @returns { WebAttribute } 8736 * @syscap SystemCapability.Web.Webview.Core 8737 * @since 13 8738 */ 8739 enableHapticFeedback(enabled: boolean): WebAttribute; 8740 8741 /** 8742 * Bind to the selection menu. 8743 * 8744 * @param { WebElementType } elementType - Indicates the type of selection menu. 8745 * @param { CustomBuilder } content - Indicates the content of selection menu. 8746 * @param { WebResponseType } responseType - Indicates response type of selection menu. 8747 * @param { SelectionMenuOptionsExt } [options] - Indicates the options of selection menu. 8748 * @returns { WebAttribute } 8749 * @syscap SystemCapability.Web.Webview.Core 8750 * @since 13 8751 */ 8752 bindSelectionMenu(elementType: WebElementType, content: CustomBuilder, responseType: WebResponseType, 8753 options?: SelectionMenuOptionsExt): WebAttribute; 8754 8755 /** 8756 * Sets whether to optimize parser budget to reduce FCP time 8757 * 8758 * @param { boolean} optimizeParserBudget Default value is false, set true to enable optimize parser budget. 8759 * @returns { WebAttribute } 8760 * @syscap SystemCapability.Web.Webview.Core 8761 * @since 15 8762 */ 8763 optimizeParserBudget(optimizeParserBudget: boolean): WebAttribute; 8764 8765 /** 8766 * Injects the JavaScripts that will be run just after document object has been created. 8767 * 8768 * @param { Array<ScriptItem> } scripts - The JavaScripts executed in array order. 8769 * @returns { WebAttribute } 8770 * @syscap SystemCapability.Web.Webview.Core 8771 * @since 15 8772 */ 8773 runJavaScriptOnDocumentStart(scripts: Array<ScriptItem>): WebAttribute; 8774 8775 /** 8776 * Injects the JavaScripts that will be run after document has been parsed finished. 8777 * 8778 * @param { Array<ScriptItem> } scripts - The JavaScripts executed in array order. 8779 * @returns { WebAttribute } 8780 * @syscap SystemCapability.Web.Webview.Core 8781 * @since 15 8782 */ 8783 runJavaScriptOnDocumentEnd(scripts: Array<ScriptItem>): WebAttribute; 8784 8785 /** 8786 * Injects the JavaScripts that will be run after head element has been parsed finished. 8787 * 8788 * @param { Array<ScriptItem> } scripts - The JavaScripts executed in array order. 8789 * @returns { WebAttribute } 8790 * @syscap SystemCapability.Web.Webview.Core 8791 * @since 15 8792 */ 8793 runJavaScriptOnHeadEnd(scripts: Array<ScriptItem>): WebAttribute; 8794} 8795 8796/** 8797 * Defines Web Component. 8798 * 8799 * @syscap SystemCapability.Web.Webview.Core 8800 * @atomicservice 8801 * @since 8 8802 */ 8803/** 8804 * Defines Web Component. 8805 * 8806 * @syscap SystemCapability.Web.Webview.Core 8807 * @crossplatform 8808 * @since 10 8809 */ 8810/** 8811 * Defines Web Component. 8812 * 8813 * @syscap SystemCapability.Web.Webview.Core 8814 * @crossplatform 8815 * @atomicservice 8816 * @since 11 8817 */ 8818declare const Web: WebInterface; 8819 8820/** 8821 * Defines Web Component instance. 8822 * 8823 * @syscap SystemCapability.Web.Webview.Core 8824 * @since 8 8825 */ 8826/** 8827 * Defines Web Component instance. 8828 * 8829 * @syscap SystemCapability.Web.Webview.Core 8830 * @atomicservice 8831 * @since 11 8832 */ 8833declare const WebInstance: WebAttribute; 8834 8835/** 8836 * Defines the ssl error event. 8837 * 8838 * @typedef SslErrorEvent 8839 * @syscap SystemCapability.Web.Webview.Core 8840 * @atomicservice 8841 * @since 12 8842 */ 8843declare interface SslErrorEvent { 8844 /** 8845 * Notifies the user of the operation behavior of the web component. 8846 * 8847 * @type { SslErrorHandler } 8848 * @syscap SystemCapability.Web.Webview.Core 8849 * @atomicservice 8850 * @since 12 8851 */ 8852 handler: SslErrorHandler, 8853 /** 8854 * Error codes. 8855 * 8856 * @type { SslError } 8857 * @syscap SystemCapability.Web.Webview.Core 8858 * @atomicservice 8859 * @since 12 8860 */ 8861 error: SslError 8862 /** 8863 * Request url. 8864 * 8865 * @type { string } 8866 * @syscap SystemCapability.Web.Webview.Core 8867 * @atomicservice 8868 * @since 12 8869 */ 8870 url: string; 8871 /** 8872 * Original url. 8873 * 8874 * @type { string } 8875 * @syscap SystemCapability.Web.Webview.Core 8876 * @atomicservice 8877 * @since 12 8878 */ 8879 originalUrl: string; 8880 /** 8881 * Referrer. 8882 * 8883 * @type { string } 8884 * @syscap SystemCapability.Web.Webview.Core 8885 * @atomicservice 8886 * @since 12 8887 */ 8888 referrer: string; 8889 /** 8890 * Whether the error is fatal. 8891 * 8892 * @type { boolean } 8893 * @syscap SystemCapability.Web.Webview.Core 8894 * @atomicservice 8895 * @since 12 8896 */ 8897 isFatalError: boolean; 8898 /** 8899 * Whether the request is main frame. 8900 * 8901 * @type { boolean } 8902 * @syscap SystemCapability.Web.Webview.Core 8903 * @atomicservice 8904 * @since 12 8905 */ 8906 isMainFrame: boolean; 8907} 8908 8909/** 8910 * Defines the menu item option. 8911 * 8912 * @interface ExpandedMenuItemOptions 8913 * @syscap SystemCapability.Web.Webview.Core 8914 * @atomicservice 8915 * @since 12 8916 */ 8917declare interface ExpandedMenuItemOptions { 8918 /** 8919 * Customize what the menu displays. 8920 * 8921 * @type { ResourceStr } 8922 * @syscap SystemCapability.Web.Webview.Core 8923 * @atomicservice 8924 * @since 12 8925 */ 8926 content: ResourceStr; 8927 /** 8928 * Customize the icon before the menu displays content. 8929 * 8930 * @type { ?ResourceStr } 8931 * @syscap SystemCapability.Web.Webview.Core 8932 * @atomicservice 8933 * @since 12 8934 */ 8935 startIcon?: ResourceStr; 8936 /** 8937 * Get the selected text information. 8938 * 8939 * @type { function } 8940 * @syscap SystemCapability.Web.Webview.Core 8941 * @atomicservice 8942 * @since 12 8943 */ 8944 action: (selectedText: {plainText: string}) => void; 8945} 8946 8947/** 8948 * Define nested scroll options 8949 * 8950 * @interface NestedScrollOptionsExt 8951 * @syscap SystemCapability.Web.Webview.Core 8952 * @since 14 8953 */ 8954declare interface NestedScrollOptionsExt { 8955 /** 8956 * Set NestedScrollMode when the scrollable component scrolls up 8957 * 8958 * @type { ?NestedScrollMode } 8959 * @syscap SystemCapability.Web.Webview.Core 8960 * @since 14 8961 */ 8962 scrollUp?: NestedScrollMode; 8963 8964 /** 8965 * Set NestedScrollMode when the scrollable component scrolls down 8966 * 8967 * @type { ?NestedScrollMode } 8968 * @syscap SystemCapability.Web.Webview.Core 8969 * @since 14 8970 */ 8971 scrollDown?: NestedScrollMode; 8972 8973 /** 8974 * Set NestedScrollMode when the scrollable component scrolls right 8975 * 8976 * @type { ?NestedScrollMode } 8977 * @syscap SystemCapability.Web.Webview.Core 8978 * @since 14 8979 */ 8980 scrollRight?: NestedScrollMode; 8981 8982 /** 8983 * Set NestedScrollMode when the scrollable component scrolls left 8984 * 8985 * @type { ?NestedScrollMode } 8986 * @syscap SystemCapability.Web.Webview.Core 8987 * @since 14 8988 */ 8989 scrollLeft?: NestedScrollMode; 8990} 8991