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
@@ -9,69 +9,69 @@ Extensions can request host permissions via:
9
9
- Manifest declared `optional_host_permissions`, granted at runtime after a user gesture by `<browser>.permissions.request()`
10
10
- Manifest declared `matches` for a `content_script`, granted at install time by default
11
11
12
-
In some browsers, users can withhold host permissions causing the extension to only have site access when the extension is invoked. For example, in Chrome a user can set an extension to run only "on click". When the extension is clicked, it gains site access to the tab's main frame origin (effectively acting like [`activeTab` permission](https://developer.chrome.com/docs/extensions/develop/concepts/activeTab#what-activeTab-allows).
12
+
In some browsers, users can withhold host permissions causing the extension to only have host access when the extension is invoked. For example, in Chrome a user can set an extension to run only "on click". When the extension is clicked, it gains access to the tab's main frame origin (effectively acting like [`activeTab` permission](https://developer.chrome.com/docs/extensions/develop/concepts/activeTab#what-activeTab-allows).
13
13
14
-
Each browser may decide how it signals the user when an extension is requesting access (e.g through the extensions menu). However, there is no way for an extension to explicitly signal at runtime it’s requesting site access after it was withheld without a user gesture and a heavy-weight permission dialog.
14
+
Each browser may decide how it signals the user when an extension is requesting access (e.g through the extensions menu). However, there is no way for an extension to explicitly signal at runtime it’s requesting host access after it was withheld without a user gesture and a heavy-weight permission dialog.
15
15
16
16
17
17
### Objective
18
18
19
-
Allow the extension to show site access requests at runtime without any user gesture in a less-obtrusive way than with `permissions.request()`. This can be done with a new API that:
19
+
Allow the extension to show host access requests at runtime without any user gesture in a less-obtrusive way than with `permissions.request()`. This can be done with a new API that:
20
20
21
21
- Applies to a specific tab or document id. Developers can specify inactive tabs (request will be shown by the browser when the user activated them).
22
22
- Doesn’t need to be made inside the handler for a user action
23
23
- Shows the request in the UI, handled differently by each browser. See more in [UI Elements and User-Visible Effects](#ui-elements-and-user-visible\-effects) section
24
-
- When accepted, grants always access to the site’s top origin
24
+
- When accepted, grants always access to the host
25
25
- Resets the request on cross-origin navigation
26
26
27
27
#### Use Cases
28
28
29
-
An extension requested access to a site but the user withheld its access and forgot about it. Extension wants to signal it needs site access to execute without user action. For example, “shopping” extension wants to show site access when user navigates to “amazon.com” and access was withheld.
29
+
An extension requested access to a host but the user withheld its access and forgot about it. Extension wants to signal it needs host access to execute without user action. For example, “shopping” extension wants to show host access when user navigates to “amazon.com” and access was withheld.
30
30
31
31
### Consumers
32
32
33
-
Extensions that want to signal the user when they need site access.
33
+
Extensions that want to signal the user when they need host access.
34
34
35
35
## Implementation
36
36
37
37
### API Schema
38
38
39
39
```
40
-
// Adds a site access request. Request will only be signaled to the user if
41
-
// extension can be granted access to site in the request (i.e., one specified
40
+
// Adds a host access request. Request will only be signaled to the user if
41
+
// extension can be granted access to host in the request (i.e., one specified
42
42
// in host_permissions, optional_host_permissions, a content script match
| N/A | Permissions API is used to “request declared optional permissions at run time rather than install time, so users understand why the permissions are needed and grant only those that are necessary” (according to documentation). The goal of this new method is for the extension to request site access, which is effectively a permission. We can adjust the description to not be restricted just to optional permissions. |
86
+
| N/A | Permissions API is used to “request declared optional permissions at run time rather than install time, so users understand why the permissions are needed and grant only those that are necessary” (according to documentation). The goal of this new method is for the extension to request host access, which is effectively a permission. We can adjust the description to not be restricted just to optional permissions. |
87
87
88
88
#### Other Alternatives considered
89
89
90
-
- Action API is used to control the extension’s button in the browser’s toolbar. It’s exposed if the extension includes the "action" key in the manifest. This is troublesome since an extension could not have an action, but still want to show site access requests. We should not limit requests for extensions with actions
91
-
-`permissions.addSiteAccessRequest()` resolves when request is accepted/rejected. An extension could be requesting site access and be granted site access through another mechanism (e.g changing site access in the extensions menu). We would either return a) true if we consider permissions granted through other mechanisms or b) false, because permission wasn't explicitely granted through the request. a) adds complexity and b) may cause confusion. Thus, we consider better to resolve whether the request is valid, and separately extension can listen whether permission is granted through `permissions.onAdded()`.
90
+
- Action API is used to control the extension’s button in the browser’s toolbar. It’s exposed if the extension includes the "action" key in the manifest. This is troublesome since an extension could not have an action, but still want to show host access requests. We should not limit requests for extensions with actions
91
+
-`permissions.addHostAccessRequest()` resolves when request is accepted/rejected. An extension could be requesting host access and be granted host access through another mechanism (e.g changing host access in the extensions menu). We would either return a) true if we consider permissions granted through other mechanisms or b) false, because permission wasn't explicitely granted through the request. a) adds complexity and b) may cause confusion. Thus, we consider better to resolve whether the request is valid, and separately extension can listen whether permission is granted through `permissions.onAdded()`.
92
92
93
93
### Manifest Changes
94
94
@@ -102,11 +102,11 @@ None.
102
102
103
103
#### Persistence
104
104
105
-
Showing a site access request is never persisted.
105
+
Showing a host access request is never persisted.
106
106
107
107
#### Alignment with Other Vendors and Action APIs
108
108
109
-
Each browser can decide how they want to signal the extension site access requests. Browsers may decide to ignore the request (e.g due to noisiness, or if an extension has no visible UI).
109
+
Each browser can decide how they want to signal the extension host access requests. Browsers may decide to ignore the request (e.g due to noisiness, or if an extension has no visible UI).
110
110
On Chrome’s side, we are exploring adding an ‘Allow’ chip in the extensions toolbar.
111
111
112
112
## User Experience
@@ -115,29 +115,29 @@ On Chrome’s side, we are exploring adding an ‘Allow’ chip in the extension
115
115
116
116
Each browser will handle the request as desired. On Chrome’s side, we are considering showing an ‘Allow’ button in the toolbar for these requests. On click, it would grant persistent access to the site’s origin (which can be again withheld by the user)
117
117
118
-

118
+

119
119
120
120
We would also provide a way for users to silence the requests for an extension through a setting in the extensions menu and in chrome://extensions.
121
121
122
-

122
+

123
123
124
124
#### Attribution
125
-
The site access request will be attributed directly to the extension.
125
+
The host access request will be attributed directly to the extension.
126
126
127
127
## Security and Privacy
128
128
129
129
### Exposed Sensitive Data
130
130
131
-
This API does not directly expose any sensitive data to the extension. However, it could lead to the extension gaining access to the site.
131
+
This API does not directly expose any sensitive data to the extension. However, it could lead to the extension gaining access to the host.
132
132
133
133
### Abuse Scenarios
134
134
135
-
Extensions can enable site access requests on every tab, which could be annoying to the user.
135
+
Extensions can enable host access requests on every tab, which could be annoying to the user.
136
136
137
137
#### Mitigations
138
138
Attacks of annoyance are not in our threat model. Extensions can have annoying behaviors, but they risk uninstallation.
139
139
On the browser side, we can place some restrictions to limit noisiness:
140
-
- User can decide whether they want to see site access requests for an specific extension
140
+
- User can decide whether they want to see host access requests for an specific extension
141
141
- We can explore setting a max amount of times the request is shown when the user ignores it.
142
142
143
143
### Additional Security Considerations
@@ -147,17 +147,17 @@ None
147
147
148
148
### Existing Workarounds
149
149
150
-
Users can change an extension's site access. The only way for extensions to signal the user they want to regain access to the site is through `permissions.request()` flow which is noisy and requires a user gesture. Otherwise, they rely on the user realizing through the browser UI (e.g extensions menu).
150
+
Users can change an extension's host access. The only way for extensions to signal the user they want to regain access to the host is through `permissions.request()` flow which is noisy and requires a user gesture. Otherwise, they rely on the user realizing through the browser UI (e.g extensions menu).
151
151
152
-
Extensions have no way to signal the user that they want access to the site, and rely on the user realizing through the browser UI (e.g extensions menu)
152
+
Extensions have no way to signal the user that they want access to the host, and rely on the user realizing through the browser UI (e.g extensions menu)
153
153
154
154
### Other Alternatives Considered
155
155
156
156
Specifying URL patterns in the extension's manifest. We decided against that because:
157
157
- This is designed to be a highly-contextual signal. The extension should do it only if they have strong believe they will provide value to the user on the given page. This should not be a passive, "hey, I think I can do something here", it should be a "hey, you, the user, probably want me to do something here".
158
158
- We do not want extensions to simply show a request on every page, and specifying a list of patterns would lend itself to that behavior (even by not allowing broad match patterns).
159
-
- It's too close to host permissions themselves. We suspect that the vast majority of extensions would just have the same field match as in their host permissions, since there is no more knowledge at manifest time about why the extension would run on a specific site.
160
-
That being said, each browser a URL pattern can be specified in `permissions.addSiteAccessRequest`. Each browser can determine whether other parameters must be specified apart from the URL pattern.
159
+
- It's too close to host permissions themselves. We suspect that the vast majority of extensions would just have the same field match as in their host permissions, since there is no more knowledge at manifest time about why the extension would run on a specific host.
160
+
That being said, each browser a URL pattern can be specified in `permissions.addHostAccessRequest`. Each browser can determine whether other parameters must be specified apart from the URL pattern.
161
161
162
162
### Open Web API
163
-
This is related to the extensions showing site access requests in the browser; it doesn't affect the web.
163
+
This is related to the extensions showing host access requests in the browser; it doesn't affect the web.
0 commit comments