• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# web_webview
2## Introduction
3nwebview is the native engine of the OpenHarmony web component and is built based on Chromium and the Chromium Embedded Framework (CEF).
4## Software Architecture
5Below is the software architecture.
6```
7    ------------------------------
8    |       Web component         |
9    ------------------------------
10    |      nwebview               |
11    ------------------------------
12    |        CEF                  |
13    ------------------------------
14    |      Chromium               |
15    ------------------------------
16    |  OpenHarmony base library   |
17    ------------------------------
18```
19* Web component: UI component in OpenHarmony.
20* nwebview: native engine of the OpenHarmony web component, which is built based on the Chromium Embedded Framework (CEF).
21* CEF: stands for Chromium Embedded Framework. It is an open-source project based on Google Chromium.
22* Chromium: an open-source web browser principally developed by Google and released under the BSD license and other permissive open-source licenses.
23 ## Directory Structure
24```
25.
26├── ohos_nweb            # OpenHarmony adaptation code
27│   ├── include
28│   ├── prebuilts        # NWeb.hap, built based on the third_party_chromium source code repository
29│   └── src
30└── test                 # nwebview test code
31```
32## Usage
33** This code repository is the native engine of the OpenHarmony web component. This topic describes only how to use the test code based on the native interfaces.**
34
351. By default, the test code is not compiled. Therefore, to use the test code, you need to add the **nweb_test** target to the **bundle.json** file in the root directory of the code repository.
36```
37"sub_component": [
38    "//base/web/webview/ohos_nweb:libnweb",
39    "//base/web/webview/ohos_nweb:nweb_hap",
40    "//base/web/webview/test:nweb_test"
41],
42```
432. Build source code.
44```
45./build.sh --product-name rk3568 --ccache --build-target nweb_test
46```
473. Push **nweb_test** to RK3568, connect to a Wi-Fi network, and make sure the time on RK3568 is the same as the current system time.
48```
49nweb_test 1 --width=720 --height=1184 --add-args=--for-test
50```
51The preceding command loads the Baidu home page by default. To load another page, run **--url=xxx.com**.
52
53## Repositories Involved
54
55[ace_ace_engine](https://gitee.com/openharmony/ace_ace_engine)
56
57[third_party_cef](https://gitee.com/openharmony/third_party_cef)
58
59**[web_webview](https://gitee.com/openharmony/web_webview)**
60
61[third_party_chromium](https://gitee.com/openharmony/third_party_chromium)
62