feat: support registering MV3 extension service workers (#27562)
* feat: support registering MV3 extension service workers * feat: load chrome extension APIs in worker context * feat: add more ContentRendererClient service worker overrides * fix: lint error * refactor: emit object for 'registration-completed' * docs: clarify when registration-completed emits
This commit is contained in:
parent
6681f8f507
commit
3250ef551c
10 changed files with 152 additions and 6 deletions
|
@ -117,6 +117,28 @@ class RendererClientBase : public content::ContentRendererClient
|
|||
void RunScriptsAtDocumentEnd(content::RenderFrame* render_frame) override;
|
||||
void RunScriptsAtDocumentIdle(content::RenderFrame* render_frame) override;
|
||||
|
||||
bool AllowScriptExtensionForServiceWorker(
|
||||
const url::Origin& script_origin) override;
|
||||
void DidInitializeServiceWorkerContextOnWorkerThread(
|
||||
blink::WebServiceWorkerContextProxy* context_proxy,
|
||||
const GURL& service_worker_scope,
|
||||
const GURL& script_url) override;
|
||||
void WillEvaluateServiceWorkerOnWorkerThread(
|
||||
blink::WebServiceWorkerContextProxy* context_proxy,
|
||||
v8::Local<v8::Context> v8_context,
|
||||
int64_t service_worker_version_id,
|
||||
const GURL& service_worker_scope,
|
||||
const GURL& script_url) override;
|
||||
void DidStartServiceWorkerContextOnWorkerThread(
|
||||
int64_t service_worker_version_id,
|
||||
const GURL& service_worker_scope,
|
||||
const GURL& script_url) override;
|
||||
void WillDestroyServiceWorkerContextOnWorkerThread(
|
||||
v8::Local<v8::Context> context,
|
||||
int64_t service_worker_version_id,
|
||||
const GURL& service_worker_scope,
|
||||
const GURL& script_url) override;
|
||||
|
||||
protected:
|
||||
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
|
||||
// app_shell embedders may need custom extensions client interfaces.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue