October 25, 2024
Chicago 12, Melborne City, USA
javascript

Using external code with chrome extenstion v3


I want to inject my remote script to chrome extenstion, but I think manifest V3 don’t let me do that. How to overcome that barrier?.
Here are the option I have tried.

const dynamicScript = fetch(...);
const data = {}   // to pass into dynamic script

chrome.scripting.executeScript(
   {
      target: { tabId: details.tabId },
      world: "MAIN",     // most important part
      func: data => {
         (new Function('data', dynamicScript))(data);
      },
      args: [data]  // passing app into func above
   }
); 

Thank you for your help



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video