402 lines
14 KiB
Rust
402 lines
14 KiB
Rust
#![allow(unused_imports)]
|
|
use super::*;
|
|
use wasm_bindgen::prelude::*;
|
|
#[wasm_bindgen]
|
|
extern "C" {
|
|
# [wasm_bindgen (extends = :: js_sys :: Object , js_name = CSP)]
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
#[doc = "The `Csp` dictionary."]
|
|
#[doc = ""]
|
|
#[doc = "*This API requires the following crate features to be activated: `Csp`*"]
|
|
pub type Csp;
|
|
}
|
|
impl Csp {
|
|
#[doc = "Construct a new `Csp`."]
|
|
#[doc = ""]
|
|
#[doc = "*This API requires the following crate features to be activated: `Csp`*"]
|
|
pub fn new() -> Self {
|
|
#[allow(unused_mut)]
|
|
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
|
|
ret
|
|
}
|
|
#[doc = "Change the `base-uri` field of this object."]
|
|
#[doc = ""]
|
|
#[doc = "*This API requires the following crate features to be activated: `Csp`*"]
|
|
pub fn base_uri(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
|
|
use wasm_bindgen::JsValue;
|
|
let r = ::js_sys::Reflect::set(
|
|
self.as_ref(),
|
|
&JsValue::from("base-uri"),
|
|
&JsValue::from(val),
|
|
);
|
|
debug_assert!(
|
|
r.is_ok(),
|
|
"setting properties should never fail on our dictionary objects"
|
|
);
|
|
let _ = r;
|
|
self
|
|
}
|
|
#[doc = "Change the `block-all-mixed-content` field of this object."]
|
|
#[doc = ""]
|
|
#[doc = "*This API requires the following crate features to be activated: `Csp`*"]
|
|
pub fn block_all_mixed_content(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
|
|
use wasm_bindgen::JsValue;
|
|
let r = ::js_sys::Reflect::set(
|
|
self.as_ref(),
|
|
&JsValue::from("block-all-mixed-content"),
|
|
&JsValue::from(val),
|
|
);
|
|
debug_assert!(
|
|
r.is_ok(),
|
|
"setting properties should never fail on our dictionary objects"
|
|
);
|
|
let _ = r;
|
|
self
|
|
}
|
|
#[doc = "Change the `child-src` field of this object."]
|
|
#[doc = ""]
|
|
#[doc = "*This API requires the following crate features to be activated: `Csp`*"]
|
|
pub fn child_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
|
|
use wasm_bindgen::JsValue;
|
|
let r = ::js_sys::Reflect::set(
|
|
self.as_ref(),
|
|
&JsValue::from("child-src"),
|
|
&JsValue::from(val),
|
|
);
|
|
debug_assert!(
|
|
r.is_ok(),
|
|
"setting properties should never fail on our dictionary objects"
|
|
);
|
|
let _ = r;
|
|
self
|
|
}
|
|
#[doc = "Change the `connect-src` field of this object."]
|
|
#[doc = ""]
|
|
#[doc = "*This API requires the following crate features to be activated: `Csp`*"]
|
|
pub fn connect_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
|
|
use wasm_bindgen::JsValue;
|
|
let r = ::js_sys::Reflect::set(
|
|
self.as_ref(),
|
|
&JsValue::from("connect-src"),
|
|
&JsValue::from(val),
|
|
);
|
|
debug_assert!(
|
|
r.is_ok(),
|
|
"setting properties should never fail on our dictionary objects"
|
|
);
|
|
let _ = r;
|
|
self
|
|
}
|
|
#[doc = "Change the `default-src` field of this object."]
|
|
#[doc = ""]
|
|
#[doc = "*This API requires the following crate features to be activated: `Csp`*"]
|
|
pub fn default_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
|
|
use wasm_bindgen::JsValue;
|
|
let r = ::js_sys::Reflect::set(
|
|
self.as_ref(),
|
|
&JsValue::from("default-src"),
|
|
&JsValue::from(val),
|
|
);
|
|
debug_assert!(
|
|
r.is_ok(),
|
|
"setting properties should never fail on our dictionary objects"
|
|
);
|
|
let _ = r;
|
|
self
|
|
}
|
|
#[doc = "Change the `font-src` field of this object."]
|
|
#[doc = ""]
|
|
#[doc = "*This API requires the following crate features to be activated: `Csp`*"]
|
|
pub fn font_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
|
|
use wasm_bindgen::JsValue;
|
|
let r = ::js_sys::Reflect::set(
|
|
self.as_ref(),
|
|
&JsValue::from("font-src"),
|
|
&JsValue::from(val),
|
|
);
|
|
debug_assert!(
|
|
r.is_ok(),
|
|
"setting properties should never fail on our dictionary objects"
|
|
);
|
|
let _ = r;
|
|
self
|
|
}
|
|
#[doc = "Change the `form-action` field of this object."]
|
|
#[doc = ""]
|
|
#[doc = "*This API requires the following crate features to be activated: `Csp`*"]
|
|
pub fn form_action(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
|
|
use wasm_bindgen::JsValue;
|
|
let r = ::js_sys::Reflect::set(
|
|
self.as_ref(),
|
|
&JsValue::from("form-action"),
|
|
&JsValue::from(val),
|
|
);
|
|
debug_assert!(
|
|
r.is_ok(),
|
|
"setting properties should never fail on our dictionary objects"
|
|
);
|
|
let _ = r;
|
|
self
|
|
}
|
|
#[doc = "Change the `frame-ancestors` field of this object."]
|
|
#[doc = ""]
|
|
#[doc = "*This API requires the following crate features to be activated: `Csp`*"]
|
|
pub fn frame_ancestors(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
|
|
use wasm_bindgen::JsValue;
|
|
let r = ::js_sys::Reflect::set(
|
|
self.as_ref(),
|
|
&JsValue::from("frame-ancestors"),
|
|
&JsValue::from(val),
|
|
);
|
|
debug_assert!(
|
|
r.is_ok(),
|
|
"setting properties should never fail on our dictionary objects"
|
|
);
|
|
let _ = r;
|
|
self
|
|
}
|
|
#[doc = "Change the `frame-src` field of this object."]
|
|
#[doc = ""]
|
|
#[doc = "*This API requires the following crate features to be activated: `Csp`*"]
|
|
pub fn frame_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
|
|
use wasm_bindgen::JsValue;
|
|
let r = ::js_sys::Reflect::set(
|
|
self.as_ref(),
|
|
&JsValue::from("frame-src"),
|
|
&JsValue::from(val),
|
|
);
|
|
debug_assert!(
|
|
r.is_ok(),
|
|
"setting properties should never fail on our dictionary objects"
|
|
);
|
|
let _ = r;
|
|
self
|
|
}
|
|
#[doc = "Change the `img-src` field of this object."]
|
|
#[doc = ""]
|
|
#[doc = "*This API requires the following crate features to be activated: `Csp`*"]
|
|
pub fn img_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
|
|
use wasm_bindgen::JsValue;
|
|
let r = ::js_sys::Reflect::set(
|
|
self.as_ref(),
|
|
&JsValue::from("img-src"),
|
|
&JsValue::from(val),
|
|
);
|
|
debug_assert!(
|
|
r.is_ok(),
|
|
"setting properties should never fail on our dictionary objects"
|
|
);
|
|
let _ = r;
|
|
self
|
|
}
|
|
#[doc = "Change the `manifest-src` field of this object."]
|
|
#[doc = ""]
|
|
#[doc = "*This API requires the following crate features to be activated: `Csp`*"]
|
|
pub fn manifest_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
|
|
use wasm_bindgen::JsValue;
|
|
let r = ::js_sys::Reflect::set(
|
|
self.as_ref(),
|
|
&JsValue::from("manifest-src"),
|
|
&JsValue::from(val),
|
|
);
|
|
debug_assert!(
|
|
r.is_ok(),
|
|
"setting properties should never fail on our dictionary objects"
|
|
);
|
|
let _ = r;
|
|
self
|
|
}
|
|
#[doc = "Change the `media-src` field of this object."]
|
|
#[doc = ""]
|
|
#[doc = "*This API requires the following crate features to be activated: `Csp`*"]
|
|
pub fn media_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
|
|
use wasm_bindgen::JsValue;
|
|
let r = ::js_sys::Reflect::set(
|
|
self.as_ref(),
|
|
&JsValue::from("media-src"),
|
|
&JsValue::from(val),
|
|
);
|
|
debug_assert!(
|
|
r.is_ok(),
|
|
"setting properties should never fail on our dictionary objects"
|
|
);
|
|
let _ = r;
|
|
self
|
|
}
|
|
#[doc = "Change the `object-src` field of this object."]
|
|
#[doc = ""]
|
|
#[doc = "*This API requires the following crate features to be activated: `Csp`*"]
|
|
pub fn object_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
|
|
use wasm_bindgen::JsValue;
|
|
let r = ::js_sys::Reflect::set(
|
|
self.as_ref(),
|
|
&JsValue::from("object-src"),
|
|
&JsValue::from(val),
|
|
);
|
|
debug_assert!(
|
|
r.is_ok(),
|
|
"setting properties should never fail on our dictionary objects"
|
|
);
|
|
let _ = r;
|
|
self
|
|
}
|
|
#[doc = "Change the `referrer` field of this object."]
|
|
#[doc = ""]
|
|
#[doc = "*This API requires the following crate features to be activated: `Csp`*"]
|
|
pub fn referrer(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
|
|
use wasm_bindgen::JsValue;
|
|
let r = ::js_sys::Reflect::set(
|
|
self.as_ref(),
|
|
&JsValue::from("referrer"),
|
|
&JsValue::from(val),
|
|
);
|
|
debug_assert!(
|
|
r.is_ok(),
|
|
"setting properties should never fail on our dictionary objects"
|
|
);
|
|
let _ = r;
|
|
self
|
|
}
|
|
#[doc = "Change the `report-only` field of this object."]
|
|
#[doc = ""]
|
|
#[doc = "*This API requires the following crate features to be activated: `Csp`*"]
|
|
pub fn report_only(&mut self, val: bool) -> &mut Self {
|
|
use wasm_bindgen::JsValue;
|
|
let r = ::js_sys::Reflect::set(
|
|
self.as_ref(),
|
|
&JsValue::from("report-only"),
|
|
&JsValue::from(val),
|
|
);
|
|
debug_assert!(
|
|
r.is_ok(),
|
|
"setting properties should never fail on our dictionary objects"
|
|
);
|
|
let _ = r;
|
|
self
|
|
}
|
|
#[doc = "Change the `report-uri` field of this object."]
|
|
#[doc = ""]
|
|
#[doc = "*This API requires the following crate features to be activated: `Csp`*"]
|
|
pub fn report_uri(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
|
|
use wasm_bindgen::JsValue;
|
|
let r = ::js_sys::Reflect::set(
|
|
self.as_ref(),
|
|
&JsValue::from("report-uri"),
|
|
&JsValue::from(val),
|
|
);
|
|
debug_assert!(
|
|
r.is_ok(),
|
|
"setting properties should never fail on our dictionary objects"
|
|
);
|
|
let _ = r;
|
|
self
|
|
}
|
|
#[doc = "Change the `require-sri-for` field of this object."]
|
|
#[doc = ""]
|
|
#[doc = "*This API requires the following crate features to be activated: `Csp`*"]
|
|
pub fn require_sri_for(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
|
|
use wasm_bindgen::JsValue;
|
|
let r = ::js_sys::Reflect::set(
|
|
self.as_ref(),
|
|
&JsValue::from("require-sri-for"),
|
|
&JsValue::from(val),
|
|
);
|
|
debug_assert!(
|
|
r.is_ok(),
|
|
"setting properties should never fail on our dictionary objects"
|
|
);
|
|
let _ = r;
|
|
self
|
|
}
|
|
#[doc = "Change the `sandbox` field of this object."]
|
|
#[doc = ""]
|
|
#[doc = "*This API requires the following crate features to be activated: `Csp`*"]
|
|
pub fn sandbox(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
|
|
use wasm_bindgen::JsValue;
|
|
let r = ::js_sys::Reflect::set(
|
|
self.as_ref(),
|
|
&JsValue::from("sandbox"),
|
|
&JsValue::from(val),
|
|
);
|
|
debug_assert!(
|
|
r.is_ok(),
|
|
"setting properties should never fail on our dictionary objects"
|
|
);
|
|
let _ = r;
|
|
self
|
|
}
|
|
#[doc = "Change the `script-src` field of this object."]
|
|
#[doc = ""]
|
|
#[doc = "*This API requires the following crate features to be activated: `Csp`*"]
|
|
pub fn script_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
|
|
use wasm_bindgen::JsValue;
|
|
let r = ::js_sys::Reflect::set(
|
|
self.as_ref(),
|
|
&JsValue::from("script-src"),
|
|
&JsValue::from(val),
|
|
);
|
|
debug_assert!(
|
|
r.is_ok(),
|
|
"setting properties should never fail on our dictionary objects"
|
|
);
|
|
let _ = r;
|
|
self
|
|
}
|
|
#[doc = "Change the `style-src` field of this object."]
|
|
#[doc = ""]
|
|
#[doc = "*This API requires the following crate features to be activated: `Csp`*"]
|
|
pub fn style_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
|
|
use wasm_bindgen::JsValue;
|
|
let r = ::js_sys::Reflect::set(
|
|
self.as_ref(),
|
|
&JsValue::from("style-src"),
|
|
&JsValue::from(val),
|
|
);
|
|
debug_assert!(
|
|
r.is_ok(),
|
|
"setting properties should never fail on our dictionary objects"
|
|
);
|
|
let _ = r;
|
|
self
|
|
}
|
|
#[doc = "Change the `upgrade-insecure-requests` field of this object."]
|
|
#[doc = ""]
|
|
#[doc = "*This API requires the following crate features to be activated: `Csp`*"]
|
|
pub fn upgrade_insecure_requests(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
|
|
use wasm_bindgen::JsValue;
|
|
let r = ::js_sys::Reflect::set(
|
|
self.as_ref(),
|
|
&JsValue::from("upgrade-insecure-requests"),
|
|
&JsValue::from(val),
|
|
);
|
|
debug_assert!(
|
|
r.is_ok(),
|
|
"setting properties should never fail on our dictionary objects"
|
|
);
|
|
let _ = r;
|
|
self
|
|
}
|
|
#[doc = "Change the `worker-src` field of this object."]
|
|
#[doc = ""]
|
|
#[doc = "*This API requires the following crate features to be activated: `Csp`*"]
|
|
pub fn worker_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
|
|
use wasm_bindgen::JsValue;
|
|
let r = ::js_sys::Reflect::set(
|
|
self.as_ref(),
|
|
&JsValue::from("worker-src"),
|
|
&JsValue::from(val),
|
|
);
|
|
debug_assert!(
|
|
r.is_ok(),
|
|
"setting properties should never fail on our dictionary objects"
|
|
);
|
|
let _ = r;
|
|
self
|
|
}
|
|
}
|
|
impl Default for Csp {
|
|
fn default() -> Self {
|
|
Self::new()
|
|
}
|
|
}
|