diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml new file mode 100644 index 0000000..5d54d8b --- /dev/null +++ b/.github/workflows/preview.yml @@ -0,0 +1,23 @@ +name: Deploy PR previews + +on: + pull_request: + types: + - opened + - reopened + - synchronize + - closed + +concurrency: preview-${{ github.ref }} + +jobs: + deploy-preview: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Deploy preview + uses: rossjrw/pr-preview-action@2fb559e4766555e23d07b73d313fe97c4f8c3cfe + with: + source-dir: ./ \ No newline at end of file diff --git a/README.md b/README.md index 7a8f7df..ee898f4 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -# webview-definition +# WebView Definition Explainer diff --git a/index.html b/index.html index 4b2a84f..6b0b34e 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ - WebView Definition + WebView Explainer
-

This document aims to define WebViews

+

Abstract

+

This document aims to define what a WebView is.

+

+ This document is a work in progress. It is intended to provide clarity on the definition of a WebView, which has been a topic of discussion within the WebView Community Group. +

-
-

Web Browser vs. WebView Definition

+
+

Introduction

- The WebView CG identified a need to come up with a definition to clearly identify a web browser vs. WebView. This was discussed via email - here. + The WebView Community Group has identified a lack of clarity and consensus around the definition of a WebView. This has + led to confusion among developers and users alike, as the term is often used inconsistently across different platforms + and contexts.

- Here is my attempt to summarise the discussion. Let me know if I missed anything important from the email discussion in this summary. Note that the goal here is only to define a web browser vs. webview, and not to define different types of webview (see #19 for that). + Non-goal: The purpose of this document is to define what a WebView is and which types of WebViews exist. It is not intended to provide a comprehensive overview of all WebView implementations or their specific features. + You can find more information about the implementations in the usage and challenges report.

-
-

Use Cases Discussed

+
+
+

How do WebViews differ from other user agents, such as browsers?

+

+ This was discussed via e-mail in the WebView CG. WebViews are usually locked down and configured by apps embedding them to fit their use case. Sometimes they are used to build fully featured browsers or show general web content. +

+
+

WebView User Experience

+
    +
  • Whether the user can enter their own URL to navigate to
  • +
  • "Embedded" WebViews vs "Delegated" Browser Views, which differ by whether they run in a separate context, or the same context as a web browser on the device
  • +
  • Whether the user may "freely navigate the web" (i.e. browsing, since they are called "web browsers" after all)
  • +
  • Whether certain UX features are available (e.g. managing security and privacy, back/forward button, bookmarks...)
  • +
+
+
+

Use Cases

  • Web browsers (e.g. Chrome, Firefox, Safari)
  • In-app browsers like Android Custom Tabs, SFSafariViewController
  • @@ -57,52 +85,79 @@

    Use Cases Discussed

  • A web browser in private browsing mode
-
-

Definitions Discussed

-

- A specification's definition of a webview should not refer to specific technologies like Android WebView or WKWebView. The general consensus appeared to be the definition should focus on how the web content is used. Definitions discussed included: -

-
    -
  • Whether the user can enter their own URL to navigate to
  • -
  • - "Embedded" (e.g. WKWebView) vs "System" (e.g. Custom Tabs) WebViews, which differ by whether they run in a separate context, or the same context as a web browser on the device -
  • -
  • Whether the user may "freely navigate the web" (i.e. browsing, since they are called "web browsers" after all)
  • -
  • Whether certain UX features are available (e.g. managing security and privacy, back/forward button, bookmarks...)
  • -
-
-
+

Additional Points Raised

    -
  • In-app browsers like SFSafariViewController are usually virtually identical to a regular web browser, differing only by user interface
  • +
  • In-app browsers like SFSafariViewController are usually virtually identical to a regular web browser, differing only by user interface.
+
+
+

Proposed Definition

+
+

What is a WebView?

+

+ A WebView is defined as a software component that is used to render Web technology-based content outside of a Web browser (Native Apps, MiniApps, etc). +

+

+ If you look at how the web content is used—for example, if you can freely navigate the web or certain UX elements exist—you could determine which type of WebView and whether who the user agent is. +

+ + +
-

Proposed Definition

+

User Agent Considerations

- In conclusion I would propose that the definition of a web browser is where the user may freely navigate the web. What identifies a WebView is the fact that navigation is restricted to a certain set of content that the app developer wishes to provide, and therefore free navigation of the open web is not allowed. + Whether a WebView is a user agent or not is difficult to tell. In cases where a WebView acts as a general-purpose browser, it could be considered a user agent.

-

Web Browser

-

Under this definition, things that count as a web browser include:

-
    -
  • Web browsers like Chrome, Firefox and Safari
  • -
  • Web browsers in private browsing mode
  • -
  • Web browsers with browser extension that do things like intercept network requests
  • -
  • A web browser built using an embedded WebView (as the purpose of the app is to allow free navigation of the web) - resolving #41
  • -
  • - In-app browsers like Android Custom Tabs and SFSafariViewController - despite the fact these do not show an editable URL bar, they typically function like web browsers in every other respect, including allowing free navigation through links in the web content -
  • -
-

WebView

-

Under this definition things that count as a WebView include:

+

+ If a WebView is used in such a way that it's not transparent to the user that they are interacting with web content or the app embedding the WebView is interacting with the Web content, it's less clear if all duties of a user agent are fulfilled, and the embedding app might become the user agent. +

+
+
+
+

Types of WebViews

+ +
+

WebView Properties

+

[=WebViews=] can differ based on the following properties:

+

    -
  • WebView embedded in app (e.g. Android WebView or Microsoft Edge WebView2 as a view inside an app)
  • -
  • A web browser in "kiosk" mode (as navigation is restricted) - this is a tricky one to define either way but in my opinion this is an appropriate categorisation
  • +
  • UX flexibility: Whether + the native application has full control over the UX provided by the WebView or whether the WebView imposes + the UX with limited customization and control from the native application.
  • +
  • Access to the web content: Whether the + native application has the ability to read and modify the web content rendered in the WebView. The native + application can leverage this to establish a communication link between the native code and the Web code, and + in particular to expose native APIs to the Web content, making it possible for the Web content to make native + calls.
  • +
  • State sharing: Whether the WebView shares state such as + cookies and cache with the system-wide web browser, or is completely isolated.
-

- Whether web content uses an iframe does not affect this definition, as it essentially only takes in to account how the top frame is used. For clarity perhaps this should be incorporated in to the definition, i.e. "in a web browser the user may freely navigate the web in the top frame of the browsing context".

+
+

WebView Categories

+

In practice, [=WebViews=] are classified into one of two categories with fixed properties:

+
+
Browser-like WebViews
+
These WebViews are straightforward to embed with a simpler API surface mostly targeted at loading the web + page. They are generally not [=flexible=], do not provide [=access to the web content=], but [=share state=] + with the system-wide web browser.
+
Fully-fledged WebViews
+
These WebViews are used for creating richer experiences and feature powerful integration primitives. They + have full [=UX flexibility=] when integrated within an application, provide the ability to [=access the web + content=] (native and web parts of the application can communicate), and do not [=share state=] with the + system-wide web browser.
+
+
+ + +