Screen Tools can upload recordings and screenshots to Google Drive and Dropbox. Each service needs an OAuth app that the maintainer sets up once, and the build reads the app’s public ID from the environment. Read this guide to set up the apps, build with them, or add another service.
A build without an ID still works: the service shows in Settings with Connect turned off.
Every service signs in through browser.identity.launchWebAuthFlow, which works in Chrome, Edge, Brave and Firefox and lets the user pick an account. The redirect URI is always:
https://<extension-id>.chromiumapp.org/
Register that exact URI, with the trailing slash, with each service. The extension ID has to stay the same between builds for it to match; see Keeping the extension ID stable.
Firefox has its own redirect URI, worked out from the add-on ID (screen-tools@pipelabs.com.au), so it’s the same in every Firefox build. To find it, open the add-on’s Settings page, open the console and run browser.identity.getRedirectURL(). It looks like https://<hash>.extensions.allizom.org/. Register it with each service too.
prompt=none.token_access_type=offline, which returns a refresh token.Neither flow uses a client secret, and there’s no server. The client ID and app key are public identifiers, not secrets.
Copy .env.example to .env.local and fill it in. .env.local is ignored by git.
| Variable | What it holds |
|---|---|
WXT_GOOGLE_CLIENT_ID |
Google OAuth client ID, ending in .apps.googleusercontent.com |
WXT_DROPBOX_APP_KEY |
Dropbox app key |
WXT_EXTENSION_KEY |
The store public key, so dev builds get the store extension ID |
pnpm dev and pnpm build read these at build time, so any build that should offer uploads, including release builds, needs them set.
Uploads use the drive.file scope, which only gives access to files the extension created. They go to a Screen Tools folder in the user’s Drive.
https://tombouquet.github.io/screen-tools/ as the home page and https://tombouquet.github.io/screen-tools/privacy as the privacy policy, and add tombouquet.github.io under Authorized domains. Google asks you to verify that domain in Search Console. A URL-prefix property for https://tombouquet.github.io/ needs its verification file at the site root, which is served from a separate tombouquet.github.io repository.https://www.googleapis.com/auth/drive.file.chrome.identity.getAuthToken, which is Chrome-only and can’t pick an account.)https://<extension-id>.chromiumapp.org/..env.local as WXT_GOOGLE_CLIENT_ID.drive.file is a non-sensitive scope, so it needs only brand verification (name, logo, home page and privacy policy), not the security review that sensitive and restricted scopes need. Google says this usually takes a few business days. Until it’s verified, users see an “unverified app” warning.Google’s docs: Drive API scopes, brand verification.
Uploads go to the app folder, Apps/Screen Tools, in the user’s Dropbox. The app can’t see anything outside it.
account_info.read, to show who’s connectedfiles.content.write, to uploadsharing.write, to create share linkssharing.read, to reuse a share link that already existshttps://<extension-id>.chromiumapp.org/. Leave Allow public clients (Implicit Grant & PKCE) on..env.local as WXT_DROPBOX_APP_KEY. Don’t use the app secret.A new app has development status. Up to 500 Dropbox users can link it, and once 50 have, you have two weeks to get production approval before new users are blocked. Apply for production from the Settings tab before that. See the Dropbox developer guide.
Chrome derives the extension ID from the manifest’s key. Without one, an unpacked build gets an ID from its folder path, so the redirect URI changes between machines and doesn’t match what’s registered.
Set WXT_EXTENSION_KEY to the store’s public key and the build writes it to manifest.key, so every build gets the store ID:
-----BEGIN PUBLIC KEY----- and -----END PUBLIC KEY----- lines, as one line..env.local as WXT_EXTENSION_KEY.Load the build and check the ID on chrome://extensions matches the store’s. Register both redirect URIs with each service if you also test with an ID of your own.
Each destination is a connector. Settings, the save dialog and upload status only know about the Connector interface in src/lib/connectors/types.ts and the list in registry.ts.
ConnectorId union in types.ts.src/lib/connectors/<id>.ts exporting a Connector: its name, description, the kinds it accepts, the API hosts it calls, its OAuthConfig and an upload function. google-drive.ts and dropbox.ts are the examples for the implicit and PKCE flows.CONNECTORS in registry.ts, in the order it should show.hosts to optional_host_permissions in wxt.config.ts. They’re requested when the user clicks Connect, not at install.WXT_* variable, and add that to .env.example and the table above.upload gets an AuthorizedFetch that adds the token and renews it, so a connector only speaks the service’s upload API. Throw UploadError with retryable: true for network errors, 5xx and 429, and use saveResumeState if the service supports resumable uploads.