You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For certain WebView host apps, there is a desire to have different contexts for
6
6
different WebViews using the same profile so that when the same websites run in
7
-
these WebViews, they will have different DOM storages and cookie jars. An example
8
-
is different accounts within an application.
7
+
these WebViews, they will have different DOM storages and cookie jars. For example,
8
+
a content editing application might use one WebView to visit a site as signed in user
9
+
to modify content on the site, while using another WebView to visit the same site as
10
+
anonymous user to view the changes as seen by normal users.
9
11
Previously, the application can use different profiles for different contexts, but
10
12
that has 2 short comings:
11
13
- WebViews from different profiles are not allowed to have opener/opened window relationship.
12
14
- Using profiles means totally different storage for all files like http caches and less performance.
13
15
14
16
To help managing different application contexts while using the same profile, we are
15
-
introducing an API to set custom storage partition and an API to clear all data in
16
-
a custom storage partition.
17
+
introducing an API to set custom data partition and an API to clear all data in
18
+
a custom data partition.
17
19
18
-
When an application sets custom storage partition for a WebView, the sites and iframes
20
+
When an application sets custom data partition for a WebView, the sites and iframes
19
21
running inside the WebView will act as if the site were running in a third party iframe
20
-
inside a top level site uniquely associated with the custom storage partition id and have
22
+
inside a top level site uniquely associated with the custom data partition id and have
21
23
separate [storage partition](https://developer.chrome.com/docs/privacy-sandbox/storage-partitioning/)
22
24
and [cookie partition](https://developer.chrome.com/docs/privacy-sandbox/chips/).
23
25
@@ -27,16 +29,16 @@ and [cookie partition](https://developer.chrome.com/docs/privacy-sandbox/chips/)
27
29
features which are currently experimental. Before those features are enabled by default,
28
30
the application must enable them by ensuring `--enable-features=ThirdPartyStoragePartitioning,PartitionedCookies`
29
31
is set in [CoreWebView2EnvironmentOptions.AdditionalBrowserArguments](https://learn.microsoft.com/microsoft-edge/webview2/reference/winrt/microsoft_web_webview2_core/corewebview2environmentoptions#additionalbrowserarguments)
30
-
used to create CoreWebView2Environment. If not set, no custom storage partition will be
32
+
used to create CoreWebView2Environment. If the features are not enabled, no custom data partition will be
31
33
created and all data will be treated as unpartitioned and stored in the global default
32
34
location for the profile.
33
-
The custom storage partition APIs will remain experimental when related browser features
35
+
The custom data partition APIs will remain experimental when related browser features
34
36
are still experimental.
35
37
36
38
# Examples
37
39
38
40
The example below illustrates how to set partition id on WebView and how to clear all
39
-
data stored in the custom storage partition.
41
+
data stored in the custom data partition.
40
42
41
43
## Win32 C++
42
44
```cpp
@@ -47,38 +49,39 @@ data stored in the custom storage partition.
47
49
// ...
48
50
// other WebView setup like add event handlers, update settings.
49
51
50
-
// Sets custom storage partition identified by the partitionId, which uniquely
51
-
// identifies an application context.
52
+
// Sets custom data partition identified by the partitionId. Used by app
53
+
// to uniquely identify an application context, like for visiting the site
54
+
// as anonymous user instead of the signed in user in other WebViews.
0 commit comments