WebView API

WebView API

WebView API

This document in Russian / Перевод этого документа на русский язык

Contents

Application description

The application is an example of using the WebView API. It shows how to run JavaScript script, filter URL addresses, send and receive async messages from the web, use SSL-providers, use JavaScript dialogs, use private WebView mode.

Build and use features

The project is built using the ru.auroraos.WebViewAPI.pro file.

Installation and build

The project is built in the usual way using the Aurora SDK.

Screenshots

Screenshots

Use cases

Running the JavaScript script

  • To demonstrate the JavaScript script execution, select the "JS script execution" option on the main screen.
  • A page will be opened showing the status of the job.

URL filtering

  • To demonstrate URL filtering, select "URL filtering" on the main screen.
  • You can select the desired page and click on the appropriate button, and the page will be displayed at the bottom of the screen.

Async messages usage

  • To demonstrate the async messages usage, select "Async messages" on the main screen.
  • On the opened page you can send messages by clicking on the appropriate buttons. At the same time, the received messages will be counted.

Using the SSL provider

  • To demonstrate the SSL provider usage, select "SSL Provider" on the main screen.
  • On the opened page you can select the type of SSL provider: Embedded or CryptoPro.

Using JavaScript dialogs

  • To demonstrate the JavaScript dialogs usage, select the "JS dialogs" item on the main screen.
  • On the opened page select the type of dialog, click on the button "OK" and get information about the corresponding event at the bottom of the screen.

Using the private mode

  • To demonstrate the private mode usage, select "Private Mode" on the main screen.
  • One of the opened page WebViews will show a private window, and the second one will show a not private one.

Uploading a file to an HTML form

  • To demonstrate uploading a file to an HTML form, select the "Upload file to HTML form" on the main screen.
  • On the opened page you can open a file selection dialog and upload an image to the HTML form.

Downloading a file

  • To demonstrate downloading a file, select the "Download file" on the main screen.
  • On the opened page you can download a file and use the dialog to select the directory where the file will be saved.

Known errors

No known errors have been found in the project.

Compatibility

The application is working correctly since 5.1.3 version of Aurora OS.

Project structure

The project has a standard structure of an application based on C++ and QML for Aurora OS.

  • ru.auroraos.WebViewAPI.pro file describes the project structure for the qmake build system.
  • html directory contains accessory html pages.
  • icons directory contains the application icons for different screen resoulions.
  • qml directory contains the QML source code and the UI resources.
    • cover directory contains the application cover implementations.
    • pages directory contains the application pages.
    • WebViewAPI.qml file provides the application window implementation.
  • rpm directory contains the rpm-package build settings.
  • src directory contains the C++ source code.
    • main.cpp file is the application entry point.
  • translations directory contains the UI translation files.
  • ru.auroraos.WebViewAPI.desktop file defines the display and parameters for launching the application.

Terms of Use and Participation

The source code of the project is provided under the license, which allows its use in third-party applications.

The contributor agreement documents the rights granted by contributors of the Open Mobile Platform.

Information about the contributors is specified in the AUTHORS file.

Code of conduct is a current set of rules of the Open Mobile Platform which informs you how we expect the members of the community will interact while contributing and communicating.