Subject: How to integrate Google Picker API in a Manifest V3 Chrome Extension?

199 views
Skip to first unread message

Віталій Тимів

unread,
Jul 14, 2025, 4:53:37 PMJul 14
to Chromium Extensions
Hi everyone,

I'm developing a Chrome extension using Manifest V3, and I would like to integrate the Google Picker API to allow users to choose a folder on Google Drive before uploading a file.
However, including the standard script like:
<script src="https://apis.google.com/js/api.js"></script>
is blocked by the extension’s Content Security Policy (CSP):
Refused to load the script 'https://apis.google.com/js/api.js' because it violates the following Content Security Policy directive: "script-src 'self'"...
I understand that Manifest V3 disallows remote scripts. I’m currently able to use the Drive REST API (e.g., list, upload) through fetch and chrome.identity.getAuthToken, but I would really like to use the visual Google Picker UI.
So the question is:
Is there any supported or recommended way to use Google Picker inside a Manifest V3 Chrome Extension?
Or is it completely incompatible with MV3 due to dynamic loading and CSP restrictions?
Any workaround or guidance would be greatly appreciated.

Thanks in advance!

Rajat Paharia

unread,
Jul 22, 2025, 1:05:49 PMJul 22
to Chromium Extensions, Віталій Тимів
I don't know if this is the recommended way, but it was the only way I could figure out :)

I implemented this by hosting a page with the Drive Picker on a remote server. 
My extension sends the OAuth token and extensionId and any other necessary variables to the remote Drive Picker page in the querystring. 
When the user picks or cancels selection, the remote page uses external messaging to send the results back to the extension.
You can see how this works in practice in this 5 second snippet here: https://youtu.be/CF4wJiIxJ8Y?si=0LN0aAtG-UWCjQRs&t=170

Happy to share code if that would be helpful!

- rajat

Reply all
Reply to author
Forward
0 new messages