feat: add userAgent property to Navigator's prototype (#14415)

This commit is contained in:
randomicon00 2022-05-14 11:00:02 +01:00 committed by GitHub
parent 20ee3110d8
commit f82a79ffdb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 29 additions and 12 deletions

View file

@ -20,6 +20,7 @@ pub struct BootstrapOptions {
/// Sets `Deno.version.typescript` in JS runtime.
pub ts_version: String,
pub unstable: bool,
pub user_agent: String,
}
impl BootstrapOptions {
@ -42,6 +43,7 @@ impl BootstrapOptions {
"ppid": ppid(),
"target": env!("TARGET"),
"v8Version": deno_core::v8_version(),
"userAgent": self.user_agent,
});
serde_json::to_string_pretty(&payload).unwrap()
}