struct NoopTimersPermission;
impl deno_web::TimersPermission for NoopTimersPermission {
fn allow_hrtime(&mut self) -> bool {
false
}
}
let blob_store = Arc::new(deno_web::BlobStore::default());
let extensions: Vec<Extension> = vec![
deno_url::init_ops_and_esm(),
deno_webidl::deno_webidl::init_ops_and_esm(),
deno_console::deno_console::init_ops_and_esm(),
deno_web::deno_web::init_ops_and_esm::<NoopTimersPermission>(blob_store, None)
];
let options = RuntimeOptions {
module_loader: Some(loader),
extensions,
..Default::default()
};
let mut runtime = JsRuntime::new(options);
// Run the event loop to completion
runtime.run_event_loop(PollEventLoopOptions::default()).await
.map_err(|e| format!("Failed to run event loop: {}", e))?;