qwen3-235b-a22b-no-thinking· Alibaba (Qwen) LMArena Human Preference 140K
What manifest permissions do I need when writing a browser extension which saves files…
- User
What manifest permissions do I need when writing a browser extension which saves files via chrome.download in private tabs?
- Assistant
When writing a Chrome browser extension that uses the
chrome.downloads.download()method to save files from private tabs, you need to declare specific manifest permissions in yourmanifest.jsonfile.
✅ Required Permissions
To use
chrome.downloads.download()and handle downloads from private browsing mode (incognito), you must include these in yourmanifest.json:{ "permissions": [ "downloads", "incognito" ] }
🔍 Explanation of Each Permission
-
"downloads"- Grants access to the
chrome.downloadsAPI. - Allows downloading files programmatically using
chrome.downloads.download().
- Grants access to the
-
"incognito"- Required if your extension needs to run in private/incognito windows.
- Ensures that your extension can interact with content from incognito tabs.
- Without this, your extension may not have access to data or be able to trigger downloads initiated from private tabs.
📌 Optional: Run Extension in Private Mode
If your extension should run in private windows, also add:
{ "incognito": "split" // or "not_allowed", "split" is most common }"split"means the extension runs separately in regular and incognito sessions."not_allowed"prevents the extension from running in incognito mode.
Example:
{ "name": "My Extension", "version": "1.0", "manifest_version": 3, "incognito": "split", "permissions": [ "downloads", "incognito" ], "background": { "service_worker": "background.js" } }
🧪 Testing Tips
- Make sure your background script (e.g.,
background.js) correctly handles messages from content scripts when triggered from an incognito tab. - Use
chrome.windows.create({ incognito: true })if you're opening new windows and want them private.
🛑 Important Notes
- The
chrome.downloadsAPI works in both normal and incognito contexts, but you must explicitly request the"incognito"permission to access incognito tab data. - Manifest V3 is now standard in Chrome; ensure compatibility with service workers instead of old background pages.
Let me know if you want a full working example of such an extension!
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.