MV3: chrome.tabs.captureVisibleTab() only works on extension badge click

2,983 views
Skip to first unread message

Mathieu Goedhart

unread,
Sep 10, 2021, 7:19:44 AM9/10/21
to Chromium Extensions
I'm working on an enterprise extension where we make a screenshot of every page the user visits. For that we use the chrome.tabs.captureVisibleTab() function which used to work fine with mv2 but doesn't seem to work with mv3.

When i try to capture an tab (for example web.com)i get the following exception: Unchecked runtime.lastError: Either the '<all_urls>' or 'activeTab' permission is required.

I have the following permissions in my manifest file:
"permissions": ["cookies","activeTab","tabCapture", "tabs", "storage", ],

When I try to use the <all_urls> permission I get the error message below:
Permission ‘<all_urls>’ is unknown or URL pattern is malformed.

When I click on the extensions action-button, the screenshots strangely seem to go well.

Has something changed or am I doing something wrong?


Cuyler Stuwe

unread,
Sep 10, 2021, 9:17:09 AM9/10/21
to Mathieu Goedhart, Chromium Extensions
Yep; Host permissions are split out into a different manifest key now.


--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/0917f197-f9fc-460b-bee6-9214bdf22853n%40chromium.org.
Reply all
Reply to author
Forward
0 new messages