Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

252
Views
Host permission issue in a created window - Chrome Extension

I'm currently creating a quite easy chrome extension which open a new window with a simple URL, and inject JS in this new window.

But I have this issue : "Uncaught (in promise) Error: Cannot access contents of url "". Extension manifest must request permission to access this host."

I'm pretty sure of my code and my manifest, and I really can't find any solution.

My code:

chrome.windows.create({url: "http://www.google.fr", type: "popup", width: 1240, height: 768, focused: true}, tab => {
      chrome.scripting.executeScript({
         target: { tabId: tab.tabs[0].id },
         function: test,
      });
})

 function test(){
    alert('it's working');
  }

My manifest:

{
    "name": "COSMO Heatmap",
    "description": "Description à faire",
    "version": "1.0",
    "manifest_version": 3,
    "background": {
        "service_worker": "background.js"
    },
    "content_security_policy": {
        "extension_pages": "script-src 'self'; script-src-elem 'self' 'unsafe-inline' https://ajax.googleapis.com; object-src 'self'"
    },
    "permissions": ["storage", "activeTab", "scripting", "unlimitedStorage", "tabs","webRequest", "<all_urls>"],
    "host_permissions": ["<all_urls>"],
    "optional_permissions": ["<all_urls>"],
    "action": {
        "default_popup": "popup.html",
        "default_icon": {
            "16": "/images/CosmoLogo.png"
          }
      },
      "icons": {
        "16": "/images/CosmoLogo.png",
        "32": "/images/CosmoLogo.png",
        "48": "/images/CosmoLogo.png",
        "128": "/images/CosmoLogo.png"
      }
  }
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!