Skip to content

How to use an injected content script #1

@garethharding

Description

@garethharding

Thanks for your work on this, has been really helpful.

I was wondering if you knew how to add a content script? I've been racking my brains for a while and have tried every combo of ...

  chrome.tabs.executeScript(null, {
    file: "content.js"
  });

The standard way above works fine for vanilla js but in the context of angular it doesn't seem to work. I presume something webpack related maybe.

I've updated the webpack conf as so...

module.exports = {
  entry: {
    background: "src/background.ts",
    content: "src/content.ts"
  }
};

(dev)

entries: {
        background: "background",
        content: "content"
      }

and the content file transpiles to the dist dir fine. It evens reports to have injected properly with no last runtime error, however I am unable to see any logs or alerts in the websites own console.

Do you kow what might be the way to get this working in the angular context you presented?

thanks :)

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