Skip to content
Discussion options

You must be logged in to vote

Delightful... Seems like these are the necessary steps to support MV2 & MV3. I stripped away all of the other configuration that I have, that isn't relevant to the question.

export default defineConfig({
  manifest: ({ manifestVersion }) => {
    const hosts = ['https://*/*', 'http://*/*']

    const config: UserManifest = {
      web_accessible_resources: [
        {
          resources: ['/content-scripts/inject.css'],
          matches: hosts,
        },
      ],
    }

    if (manifestVersion === 2) {
      config.web_accessible_resources = ['/content-scripts/inject.css']
    }

    return config
  },
})

And then in inject.content.ts (or whatever the filename is)

export default define…

Replies: 2 comments 9 replies

Comment options

You must be logged in to vote
6 replies
@nonwip
Comment options

@aklinker1
Comment options

@aklinker1
Comment options

@nonwip
Comment options

@nonwip
Comment options

Comment options

You must be logged in to vote
3 replies
@aklinker1
Comment options

@nonwip
Comment options

@nonwip
Comment options

Answer selected by nonwip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants