Hi there,
Our extension has a requirement of needing to inject and load javascript before the page's scripts load.
We are able to meet this requirement in manifest v2 by inlining a script like:
```
const script = document.createElement('script');
script.type = 'text/javascript';
script.setAttribute('async', 'false');
script.textContent = 'console.log("test")';
const container = document.head || document.documentElement;
container.insertBefore(script, container.children[0]);
```
This allows our script to be injected and load before the page's scripts, whereas setting src does not:
```
script.src = chrome.runtime.getURL('inject.js');
```
But manifest v3 does not allow inline scripting due to csp changes, it looks like. Is there a way to inline scripts in v3 or another approach to inject and load javascript before the page loads?
Error inlining in a manifest v3:
> Refused to execute inline script because it violates the following Content Security Policy directive: "default-src 'self' data: gap: ... 'unsafe-eval'". Either the 'unsafe-inline' keyword, a hash ('sha256-V+/U3qbjHKP0SaNQhMwYNm62gfWX4QHwPJ7We1PXokI='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'script-src' was not explicitly set, so 'default-src' is used as a fallback.
Thank you,
Christopher