0

I have a Manifest v2 extension that I need to convert to Manifest v3. Within this extension, the user can enter javascript code to be executed in the current page's context.

In manifest v2 I did:

let func = new Function(code)
let result = func() 

In manifest v3, it shows a message about unsafe-eval. I read this thread and this one. I may conclude it's definitely not possible to do that with ManifestV3 but it seems strange to me as the code is entered by the user himself, and not downloaded remotely or something like that.

Do I miss something?

Thanks a lot

jr888
  • 1
  • 1
  • No that seems about right. v3 only allows that to run in a sandbox without DOM access... – Cerbrus Jun 15 '22 at 08:06
  • A bit more context (pun not intended) please. When you say "in the current page's context", do you mean: an extension page's context? a web page's own context? a content script context? – Xan Jun 15 '22 at 09:03
  • That said, even if some of this might be possible to work around, the Web Store policies disallow running code not bundled with the extension, so it's a moot point.. – Xan Jun 15 '22 at 09:10

0 Answers0