Skip to content

Commit 212589f

Browse files
jyasskincsarven
andauthored
Describe how pieces of an application can be user agents. (#21)
* Describe how pieces of an application can be user agents. An application might not act as a UA when browsing 1p content, as long as the distinction is clear to users. A library might or might not implement the UA duties, depending on the purpose it's meant to serve in applications that embed it. * Try to be clearer/shorter about what allows an app to treat only part of itself as a UA. * Be clearer that applications need to work to follow the Duties when using WebViews to browse 3p content. * Add an address bar example for confusing 3p and 1p content. * Replace mentions of first- and third-party content. * Combine sentences about a too-small distinction between local and external content. * s/embedded/embedding/ and some adjacent wording tweaks. * Emphasize webviews' behavior. * Take Sarven's rewording of the last paragraph. * Apply 2 of Sarven's suggestions from code review Co-authored-by: Sarven Capadisli <[email protected]> * s/software entities/software components/ Co-authored-by: Sarven Capadisli <[email protected]> --------- Co-authored-by: Sarven Capadisli <[email protected]>
1 parent 959467f commit 212589f

File tree

1 file changed

+50
-1
lines changed

1 file changed

+50
-1
lines changed

index.bs

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,61 @@ user agents choose which specifications to implement in order to best serve thei
5858
and they implement proprietary user interfaces and other behavior
5959
around the specifications they do implement.
6060

61+
## User agents as software components ## {#ua-as-software}
62+
63+
As software components, user agents can be parts of larger applications
64+
and can call libraries that implement the web platform or parts of it.
65+
66+
When an application makes a clear distinction
67+
between its pieces that are [=user agents=] and its pieces that aren't,
68+
then only the [=user agent=] parts,
69+
which browse content from outside the user agent itself,
70+
need to follow the [=user agent duties=].
71+
Parts that are clearly only showing the application's own content
72+
can act on their own behalf,
73+
but the application should still
74+
give its users clear expectations about
75+
what behavior they should expect from different parts of the application.
76+
If the distinction between internal and external content is too small—for example
77+
if the application doesn't show an address bar
78+
or another indicator of content origin
79+
when browsing external content—then
80+
the application should also follow the [=user agent duties=]
81+
when showing its own content.
82+
83+
Similarly a library that implements the web platform
84+
may or may not be a full [=user agent=].
85+
Some, like [`SFSafariViewController`](https://developer.apple.com/documentation/safariservices/sfsafariviewcontroller)
86+
and [Android Custom Tabs](https://developer.chrome.com/docs/android/custom-tabs)
87+
take on the responsibility of implementing the [=user agent duties=]
88+
and of clearly distinguishing between the external content they browse
89+
and the content controlled by the embedding application.
90+
These libraries are [=user agents=].
91+
92+
Other libraries, like the
93+
[Android](https://developer.android.com/reference/android/webkit/WebView),
94+
[iOS](https://developer.apple.com/documentation/webkit/wkwebview),
95+
and [Windows](https://developer.microsoft.com/en-us/Microsoft-edge/webview2/)
96+
WebView libraries,
97+
are designed to support many kinds of applications.
98+
Because some of these applications include only their own content,
99+
WebView libraries are not meant to be [=user agents=] on their own,
100+
and they do not implement the [=user agent duties=].
101+
102+
Ultimately, an embedding application is responsible for
103+
following the [=user agent duties=]
104+
if it, or any part of it, acts as a [=user agent=].
105+
This can be straightforward if the application only browses external content through a [=user agent=] library.
106+
Developers need to take extra care
107+
to follow the [=user agent duties=]
108+
when using a non-[=user agent=] WebView to implement an in-app browser .
61109

62110
# Duties of user agents # {#duties}
63111

64112
Each user agent serves its user ([[!RFC8890 inline]]),
65113
not any of the other constituencies.
66-
A user agent owes its user various duties,
114+
A user agent owes its user various
115+
<dfn lt="user agent duties|UA duties">duties</dfn>,
67116
which should be established through collective discussions
68117
and embodied in the various standards that user agents implement.
69118

0 commit comments

Comments
 (0)