Skip to content
The Chat Archive
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…

  1. User

    What manifest permissions do I need when writing a browser extension which saves files via chrome.download in private tabs?

  2. 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 your manifest.json file.


    ✅ Required Permissions

    To use chrome.downloads.download() and handle downloads from private browsing mode (incognito), you must include these in your manifest.json:

    {
      "permissions": [
        "downloads",
        "incognito"
      ]
    }
    

    🔍 Explanation of Each Permission

    1. "downloads"

      • Grants access to the chrome.downloads API.
      • Allows downloading files programmatically using chrome.downloads.download().
    2. "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.downloads API 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!

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.