[Extensions] Update captureVisibleTab permission checks
tabs.captureVisibleTab() is interesting. It used to work with every URL ever, and just checked for if activeTab or <all_urls> was present. However, this led to some issues where the extension could capture pages it shouldn't be able to, such as https://crbug.com/810220. Changing this to only allow access to pages that the extension had explicit access to also broke important use cases. For instance, taking screenshots of chrome:-scheme pages is important for filing bugs, tracking features, etc. This similarly broke use cases for other URLs that extensions don't have full access to, like other extensions' pages. An exception was added for chrome:-scheme pages, but this was insufficient for other cases. Adjust the permissions check to allow page capture of otherwise- restricted pages if the extension has activeTab granted. We require activeTab (rather than either <all_urls> or activeTab) because it gives a stronger guarantee that the user wants the extension to run on the given site. Note: this does not allow any other action on these restricted pages; only capturing the page is permitted. The new behavior enforces the following permission requirements for the host types: <arbitrary web page>: activeTab OR <all_urls> file:-scheme page: (activeTab OR <all_urls>) AND explicit file access from chrome://extensions. Pages restricted by enterprise policy: blocked Extension's own page: activeTab OR <all_urls> Another extension's page: activeTab chrome:-scheme page: activeTab Support for IPv6 pages and pseudo urls is dependent on these being properly supported with activeTab, which will be pursued in a followup. Bug: 839857 Change-Id: Ied3a71732cd5d41ad16f9b459f6fda9b1815edaf Reviewed-on: https://chromium-review.googlesource.com/1102902Reviewed-by:Karan Bhatia <karandeepb@chromium.org> Commit-Queue: Devlin <rdevlin.cronin@chromium.org> Cr-Commit-Position: refs/heads/master@{#568471}
Showing
Please register or sign in to comment