How can I inject CSS before content script is loaded in Chrome Extension MV2?

86 Views Asked by At

I am trying to use user-session recording tools (like FullStory or Livesession) in my Chrome Extension.

The way those tools work is that during the session capture, they make a copy of the page CSS to recreate the playback in the future.

The problem is that they don't collect my content script's injected CSS file:

  "content_scripts": [
    {
      "matches": [...],
      "js": [
        "build/content.js"
      ],
      "css": [
        "build/content.css"
      ]
    }
  ],

so the recording output is all messed up and broken.

I thought that it may be due to the CSS being injected after the JS is executed but I don't think this is the case according to this article.

How can I make it work?

0

There are 0 best solutions below