• Home
Name Date Size #Lines LOC

..--

interfaces/kits/napi/12-May-2024-7,6096,137

ohos_adapter/12-May-2024-5,5813,866

ohos_nweb/12-May-2024-5,2882,449

test/12-May-2024-35,96523,935

.clang-formatD12-May-20243 KiB107106

.gitattributesD12-May-2024140 32

.gitignoreD12-May-202410 21

LICENSED12-May-20249.9 KiB177150

OAT.xmlD12-May-20243.9 KiB6815

README.mdD12-May-20242.5 KiB6255

README_ZH.mdD12-May-20242.2 KiB6660

bundle.jsonD12-May-202420 KiB256255

hisysevent.yamlD12-May-20241.6 KiB3619

run_shell_cmd.pyD12-May-2024805 266

web_aafwk.gniD12-May-2024715 1614

README.md

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

README_ZH.md

1# web_webview
2- [简介](#简介)
3- [目录](#目录)
4- [使用说明](#使用说明)
5- [相关仓](#相关仓)
6## 简介
7### 内容介绍
8nwebview是OpenHarmony web组件的Native引擎,基于Chromium和CEF构建。
9### 软件架构
10软件架构说明
11```
12    -----------------------
13    |       web组件         |
14    -----------------------
15    |      nwebview        |
16    -----------------------
17    |        CEF           |
18    -----------------------
19    |      Chromium        |
20    -----------------------
21    |  OpenHarmony基础库    |
22    -----------------------
23```
24* web组件:OpenHarmony的UI组件。
25* nwebview:基于CEF构建的OpenHarmony web组件的Native引擎。
26* CEF:CEF全称Chromium Embedded Framework,是一个基于Google Chromium 的开源项目。
27* Chromium: Chromium是一个由Google主导开发的网页浏览器。以BSD许可证等多重自由版权发行并开放源代码。
28 ## 目录
29```
30.
31├── ohos_nweb            # openharmony适配代码
32│   ├── include
33│   ├── prebuilts        # NWeb.hap,基于third_party_chromium源码仓构建
34│   └── src
35└── test                 # nwebview测试代码
36```
37## 使用说明
38**此代码仓是openharmony web组件的Native引擎,此处仅提供基于Native接口的测试使用说明。**
39
401. 测试代码默认不编译,使用测试代码时,需要在代码仓根目录bundle.json中增加nweb_test目标:
41```
42"sub_component": [
43    "//base/web/webview/ohos_nweb:libnweb",
44    "//base/web/webview/ohos_nweb:nweb_hap",
45    "//base/web/webview/test:nweb_test"
46],
47```
482. 编译
49```
50./build.sh --product-name rk3568 --ccache --build-target nweb_test
51```
523. 运行,将nweb_test push到RK3568中,连接wifi保证网络可用,设置日期保证开发板与当前系统时间一致
53```
54nweb_test 1 --width=720 --height=1184 --add-args=--for-test
55```
56以上命令会默认加载百度首页,--url=xxx.com命令行参数可以设置你想加载的网页。
57
58## 相关仓
59
60[ace_ace_engine](https://gitee.com/openharmony/ace_ace_engine)
61
62[third_party_cef](https://gitee.com/openharmony/third_party_cef)
63
64**[web_webview](https://gitee.com/openharmony/web_webview)**
65
66[third_party_chromium](https://gitee.com/openharmony/third_party_chromium)