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

1.1K
Views
Uncaught TypeError: Failed to construct 'URL': Invalid URL in chrome extension v3 when using messages

Here is a minimal extension for chrome in v3:

manifest.json

{
  "manifest_version": 3,
  "name": "Test",
  "version": "1.0",
  "description": "Test extension",
  "icons": {
    "48": "dark.png"
  },
  "background": {
    "service_worker": "button.js"
  },
  "permissions": [
    "activeTab"
  ],
  "action": {
    "default_icon": "dark.png",
    "default_title": "Test"
  }
}

button.js

chrome.action.onClicked.addListener(tab => {
  console.log('clicked')
  chrome.tabs.sendMessage(tab.id, { value: false })
});

The API seems quite clear in the doc. So I don't understand why, when I press the plugin button, I get weird errors:

extensions.js:4187 Uncaught TypeError: Failed to construct 'URL': Invalid URL
    at ExtensionsErrorPageElement.onSelectedErrorChanged_ (extensions.js:4187:2827)
    at Object.runObserverEffect [as fn] (polymer_bundled.min.js:1:37568)
    at runEffectsForProperty (polymer_bundled.min.js:1:37087)
    at runEffects (polymer_bundled.min.js:1:36604)
    at ExtensionsErrorPageElement._propertiesChanged (polymer_bundled.min.js:1:52973)
    at ExtensionsErrorPageElement._flushProperties (polymer_bundled.min.js:1:26564)
    at ExtensionsErrorPageElement._flushProperties (polymer_bundled.min.js:1:51737)
    at ExtensionsErrorPageElement._invalidateProperties (polymer_bundled.min.js:1:51534)
    at ExtensionsErrorPageElement._setProperty (polymer_bundled.min.js:1:51459)
    at ExtensionsErrorPageElement.Object.defineProperty.set (polymer_bundled.min.js:1:24863)
onSelectedErrorChanged_ @ extensions.js:4187
runObserverEffect @ polymer_bundled.min.js:1
runEffectsForProperty @ polymer_bundled.min.js:1
runEffects @ polymer_bundled.min.js:1
_propertiesChanged @ polymer_bundled.min.js:1
_flushProperties @ polymer_bundled.min.js:1
_flushProperties @ polymer_bundled.min.js:1
_invalidateProperties @ polymer_bundled.min.js:1
_setProperty @ polymer_bundled.min.js:1
Object.defineProperty.set @ polymer_bundled.min.js:1

What am I missing?

This is on Chromium Version 100.0.4896.75 (Build officiel) snap (64 bits)

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

I had the same exception but with another reason.

So, i see the possible solution(how to get real error message).

I've set breakpoint on failed line and check the runtimeError message.

Can be usefull for somebody.

enter image description here enter image description here

about 4 years ago · Santiago Gelvez Report
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!