ArkWeb Project

1. Overview

The ArkWeb project is a comprehensive solution designed to integrate the Chromium Web engine into the OpenHarmony (OHOS) operating system. It serves as the foundation for the system's Web component, providing powerful Web rendering capabilities for OHOS applications.

This project extends and enhances the Chromium source code to adapt it to the OHOS architecture and APIs. Based on the OpenHarmony platform, many new features have been added, such as ad blocking, task downloading, input box filling, and more. It includes an API interface implementation layer, extensions to core Chromium modules, and an OS adaptation layer.

2. Architecture

The project follows a layered architecture, where the yellow Chromium module in the diagram represents the contents of this repository:

image.png

In the architecture diagram, CEF, chromium_arkweb, and the current Chromium repository are compiled together to produce the Web kernel, with the compilation output being NWeb.hap, which is integrated into the OpenHarmony system through binary integration.

4. Usage Instructions

  1. Download Code: Using the master branch as an example, to download code from other branches, replace the manifest branch parameter after -b. For the parameter list, see section 7.

    repo init -u https://gitcode.com/openharmony-tpc/manifest -b master -m developer.xml --no-repo-verify
    repo sync -c
    repo forall -c 'git lfs pull'
    
  2. Compilation

    Build unsigned HAP package simultaneously:

    Platform: rk3568

    ./build.sh  -t w -A rk3568
    

    Only compile SO library:

    ./build.sh -A rk3568
    

    Platform: rk3568_64

    ./build.sh  -t w -A rk3568_64
    

    Only compile SO library:

    ./build.sh -A rk3568_64
    
  3. Signing

    Platform: rk3568

    ./sign.sh rk3568
    

    Platform: rk3568_64

    ./sign.sh rk3568_64
    
  4. Debugging Methods

    Method 1: Replace SO libraries

    After compilation, find the corresponding SO library files in the out directory and push them to the device:

    hdc shell "mount -o remount,rw /"
    hdc file send libnweb_render.so /data/app/el1/bundle/public/com.ohos.nweb/libs/arm
    hdc file send libweb_engine.so /data/app/el1/bundle/public/com.ohos.nweb/libs/arm
    pause
    hdc shell reboot
    pause
    

    Method 2: Replace HAP package

    After compilation, find NWeb-rk3568.hap or NWeb-rk3568_64.hap in the out directory and push it to the device:

    hdc shell "mount -o remount,rw /"
    hdc file send NWeb-rk3568.hap /system/app/com.ohos.nweb/NWeb.hap
    hdc shell "rm /data/* -rf"
    hdc shell reboot
    
  5. All Chromium Repository Directory Mapping

    https://gitcode.com/openharmony-tpc/manifest/blob/chromium/chromium.xml

  6. Submission Guidelines

    6.1 Fork the chromium_src repository to your private repository

    6.2 Download the full codebase

    6.3 Modify and debug the code

    6.4 Add files to the staging area

    Use git add to add modified files to the staging area

    6.5 Show working directory and staging area status

    Use git status to check if your modifications are in the staging area, and use git log to view project history information.

    6.6 Commit working directory or staging area content to the version repository

    Use git commit -sm "commit message description" to commit modified files. Note: -s must not be omitted as it is a signature, otherwise the PR will report a DCO error.

    DCO signing link: https://dco.openharmony.cn/sign-dco

    6.7 Push code to the corresponding forked private repository address

    For example: git push ***https://gitcode.com/[gitcodeUserName]/chromium_src***

    6.8 Create a new PR

    6.9 If joint construction is involved, create an ISSUE and bind it to all PRs that require joint construction

    6.10 Comment "start build" under the PR to begin construction

    6.11 Contact a committer for scoring

  7. Chromium Version Manifest Branch Names

    99 branch: chromium

    114 branch: 114_trunk

    132 branch: 132_trunk

    Compatible with OpenHarmony 3.2 Release branch: 3.2_Release

    Compatible with OpenHarmony 4.0 Release branch: 4.0_Release

    Compatible with OpenHarmony 4.1 Beta1 branch: master114_20231218

Webview ArkTS Repository in Architecture Diagram

Webview NDK Repository in Architecture Diagram

Web Component Repository in Architecture Diagram

web_webview Repository in Architecture Diagram

chromium_arkweb Repository in Architecture Diagram

CEF Repository in Architecture Diagram


Chromium docs

The following is the original Chromium documentation from docs/README.md, provided here for reference. It covers source code checkout, building, testing, design documents, and development guides for the Chromium project.

This directory contains chromium project documentation in Gitiles-flavored Markdown. It is automatically rendered by Gitiles.

If you add new documents, please also add a link to them in the Document Index below.

[TOC]

Creating Documentation

Guidelines

Previewing changes

Locally using md_browser

# in chromium checkout
./tools/md_browser/md_browser.py

This is only an estimate. The gitiles view may differ.

  1. Upload a patch to gerrit, or receive a review request. e.g. https://chromium-review.googlesource.com/c/3362532
  2. View a specific .md file. e.g. https://chromium-review.googlesource.com/c/3362532/2/docs/README.md
  3. You will see something like
    Base preview -> Patchset 3 preview | DOWNLOAD
    at the top left of the page. Click on the second "preview" link to open the preview for the current patch set.

This gitiles view is the authoritative view, exactly the same as will be used when committed.

Document Index

Note: this is not an exhaustive list of all documents.

Checking Out and Building

Design Docs

Integrated Development Environment (IDE) Set Up Guides

Git

Clang

General Development

Testing

Configuration Docs

Misc Linux-Specific Docs

Misc MacOS-Specific Docs

Misc Windows-Specific Docs

Misc Android-Specific Docs

Misc iOS-Specific Docs

Misc Chrome-OS-Specific Docs

Misc WebUI-Specific Docs

  • WebUI Explainer - An explanation of C++ and TypeScript infrastructural code for Chrome UIs implemented with web technologies (i.e. chrome:// URLs).
  • Optimizing Chrome Web UIs - Notes on making WebUIs more performant
  • Trusted Types on WebUI - Tips for coding in WebUI with Trusted Types in mind.
  • chrome-untrusted:// FAQ - Explainer on the usage of the chrome-untrusted:// scheme for hosting WebUIs that handle untrustworthy content.

Media

Accessibility

Memory

Memory Infrastructure Timeline Profiling (MemoryInfra)

Metrics

Misc

Mojo & Services

Security

  • The Rule Of 2 - An important security rule when handling untrustworthy contents (like anything downloaded from the web).

Speed

  • Chrome Speed - Documentation for performance measurements and regressions in Chrome.
  • Chrome Speed Metrics - Documentation about user experience metrics on the web and their JavaScript APIs.

UI

What's Up With That Transcripts

These are transcripts of What's Up With That, a video series of interviews with Chromium software engineers.

Probably Obsolete