Skip to content

activeTab permission not granting temporary host permission #163

@RitvarsZ

Description

@RitvarsZ

Was testing Asana and ran into a problem with chrome.scripting.executeScript.

The extension's manifest registers activeTab and scripting permissions which should allow the background script to executeScript into the active tab. However, the extension also registers host_permissions:

  "permissions": [
    "cookies",
    "activeTab",
    "scripting",
    "storage",
    "contextMenus",
    "tabs",
    "clipboardWrite"
  ],
  "host_permissions": [
    "https://*.asana.com/*",
    "https://mail.google.com/*"
  ],

When I click the browser action, a scripting.executeScript call is made which only works for asana and mail.google pages. All other pages get an error:

[1829990:0728/110812.404317:ERROR:extensions_browser_client.cc(72)] Extension Error:
  OTR:     false
  Level:   2
  Source:  chrome-extension://khnpeclbnipcdacdkhejifenadikeghk/background_bundle.js
  Message: Uncaught (in promise) Error: Cannot access contents of url "https://www.google.com/". Extension manifest must request permission to access this host.
  ID:      khnpeclbnipcdacdkhejifenadikeghk
  Type:    RuntimeError
  Context: chrome-extension://khnpeclbnipcdacdkhejifenadikeghk/background_bundle.js
  Stack Trace:
    {
      Line:     0
      Column:   1
      URL:      chrome-extension://khnpeclbnipcdacdkhejifenadikeghk/background_bundle.js
      Function: (anonymous function)
    }

This should not happen since activeTab should essentially give temporary host permission to the site.

This does seem like a Electron issue but I figured I'd bring it up here first as you have way more knowledge regarding extension support in Electron :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions