Al hacer una extensión de Chrome, sigo recibiendo este error
Uncaught (in promise) Error: Could not establish connection. Receiving end does not exist.Junto con
background.js:0 (anonymous function)¿Alguien sabe como podría solucionar esto? Literalmente tengo como 3 líneas en mis dos archivos.
Este es mi archivo background.js
chrome.tabs.onUpdated.addListener((tabId, tab) => { if (tab.url && tab.url.includes("linkedin.com/in")) { chrome.tabs.sendMessage(tabId, {type: "MAIN", profile: "test"}); } });y este es mi archivo ContentScript.js
(() => { chrome.runtime.onMessage.addListener((obj, sender, response) => { //const { type, profile } = obj; response = {line1 : "hello"} }); })();Cualquier ayuda sería muy apreciada :)