1 #![allow(unused_imports)] 2 use super::*; 3 use wasm_bindgen::prelude::*; 4 #[wasm_bindgen] 5 extern "C" { 6 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = CSP)] 7 #[derive(Debug, Clone, PartialEq, Eq)] 8 #[doc = "The `Csp` dictionary."] 9 #[doc = ""] 10 #[doc = "*This API requires the following crate features to be activated: `Csp`*"] 11 pub type Csp; 12 } 13 impl Csp { 14 #[doc = "Construct a new `Csp`."] 15 #[doc = ""] 16 #[doc = "*This API requires the following crate features to be activated: `Csp`*"] new() -> Self17 pub fn new() -> Self { 18 #[allow(unused_mut)] 19 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); 20 ret 21 } 22 #[doc = "Change the `base-uri` field of this object."] 23 #[doc = ""] 24 #[doc = "*This API requires the following crate features to be activated: `Csp`*"] base_uri(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self25 pub fn base_uri(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { 26 use wasm_bindgen::JsValue; 27 let r = ::js_sys::Reflect::set( 28 self.as_ref(), 29 &JsValue::from("base-uri"), 30 &JsValue::from(val), 31 ); 32 debug_assert!( 33 r.is_ok(), 34 "setting properties should never fail on our dictionary objects" 35 ); 36 let _ = r; 37 self 38 } 39 #[doc = "Change the `block-all-mixed-content` field of this object."] 40 #[doc = ""] 41 #[doc = "*This API requires the following crate features to be activated: `Csp`*"] block_all_mixed_content(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self42 pub fn block_all_mixed_content(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { 43 use wasm_bindgen::JsValue; 44 let r = ::js_sys::Reflect::set( 45 self.as_ref(), 46 &JsValue::from("block-all-mixed-content"), 47 &JsValue::from(val), 48 ); 49 debug_assert!( 50 r.is_ok(), 51 "setting properties should never fail on our dictionary objects" 52 ); 53 let _ = r; 54 self 55 } 56 #[doc = "Change the `child-src` field of this object."] 57 #[doc = ""] 58 #[doc = "*This API requires the following crate features to be activated: `Csp`*"] child_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self59 pub fn child_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { 60 use wasm_bindgen::JsValue; 61 let r = ::js_sys::Reflect::set( 62 self.as_ref(), 63 &JsValue::from("child-src"), 64 &JsValue::from(val), 65 ); 66 debug_assert!( 67 r.is_ok(), 68 "setting properties should never fail on our dictionary objects" 69 ); 70 let _ = r; 71 self 72 } 73 #[doc = "Change the `connect-src` field of this object."] 74 #[doc = ""] 75 #[doc = "*This API requires the following crate features to be activated: `Csp`*"] connect_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self76 pub fn connect_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { 77 use wasm_bindgen::JsValue; 78 let r = ::js_sys::Reflect::set( 79 self.as_ref(), 80 &JsValue::from("connect-src"), 81 &JsValue::from(val), 82 ); 83 debug_assert!( 84 r.is_ok(), 85 "setting properties should never fail on our dictionary objects" 86 ); 87 let _ = r; 88 self 89 } 90 #[doc = "Change the `default-src` field of this object."] 91 #[doc = ""] 92 #[doc = "*This API requires the following crate features to be activated: `Csp`*"] default_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self93 pub fn default_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { 94 use wasm_bindgen::JsValue; 95 let r = ::js_sys::Reflect::set( 96 self.as_ref(), 97 &JsValue::from("default-src"), 98 &JsValue::from(val), 99 ); 100 debug_assert!( 101 r.is_ok(), 102 "setting properties should never fail on our dictionary objects" 103 ); 104 let _ = r; 105 self 106 } 107 #[doc = "Change the `font-src` field of this object."] 108 #[doc = ""] 109 #[doc = "*This API requires the following crate features to be activated: `Csp`*"] font_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self110 pub fn font_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { 111 use wasm_bindgen::JsValue; 112 let r = ::js_sys::Reflect::set( 113 self.as_ref(), 114 &JsValue::from("font-src"), 115 &JsValue::from(val), 116 ); 117 debug_assert!( 118 r.is_ok(), 119 "setting properties should never fail on our dictionary objects" 120 ); 121 let _ = r; 122 self 123 } 124 #[doc = "Change the `form-action` field of this object."] 125 #[doc = ""] 126 #[doc = "*This API requires the following crate features to be activated: `Csp`*"] form_action(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self127 pub fn form_action(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { 128 use wasm_bindgen::JsValue; 129 let r = ::js_sys::Reflect::set( 130 self.as_ref(), 131 &JsValue::from("form-action"), 132 &JsValue::from(val), 133 ); 134 debug_assert!( 135 r.is_ok(), 136 "setting properties should never fail on our dictionary objects" 137 ); 138 let _ = r; 139 self 140 } 141 #[doc = "Change the `frame-ancestors` field of this object."] 142 #[doc = ""] 143 #[doc = "*This API requires the following crate features to be activated: `Csp`*"] frame_ancestors(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self144 pub fn frame_ancestors(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { 145 use wasm_bindgen::JsValue; 146 let r = ::js_sys::Reflect::set( 147 self.as_ref(), 148 &JsValue::from("frame-ancestors"), 149 &JsValue::from(val), 150 ); 151 debug_assert!( 152 r.is_ok(), 153 "setting properties should never fail on our dictionary objects" 154 ); 155 let _ = r; 156 self 157 } 158 #[doc = "Change the `frame-src` field of this object."] 159 #[doc = ""] 160 #[doc = "*This API requires the following crate features to be activated: `Csp`*"] frame_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self161 pub fn frame_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { 162 use wasm_bindgen::JsValue; 163 let r = ::js_sys::Reflect::set( 164 self.as_ref(), 165 &JsValue::from("frame-src"), 166 &JsValue::from(val), 167 ); 168 debug_assert!( 169 r.is_ok(), 170 "setting properties should never fail on our dictionary objects" 171 ); 172 let _ = r; 173 self 174 } 175 #[doc = "Change the `img-src` field of this object."] 176 #[doc = ""] 177 #[doc = "*This API requires the following crate features to be activated: `Csp`*"] img_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self178 pub fn img_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { 179 use wasm_bindgen::JsValue; 180 let r = ::js_sys::Reflect::set( 181 self.as_ref(), 182 &JsValue::from("img-src"), 183 &JsValue::from(val), 184 ); 185 debug_assert!( 186 r.is_ok(), 187 "setting properties should never fail on our dictionary objects" 188 ); 189 let _ = r; 190 self 191 } 192 #[doc = "Change the `manifest-src` field of this object."] 193 #[doc = ""] 194 #[doc = "*This API requires the following crate features to be activated: `Csp`*"] manifest_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self195 pub fn manifest_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { 196 use wasm_bindgen::JsValue; 197 let r = ::js_sys::Reflect::set( 198 self.as_ref(), 199 &JsValue::from("manifest-src"), 200 &JsValue::from(val), 201 ); 202 debug_assert!( 203 r.is_ok(), 204 "setting properties should never fail on our dictionary objects" 205 ); 206 let _ = r; 207 self 208 } 209 #[doc = "Change the `media-src` field of this object."] 210 #[doc = ""] 211 #[doc = "*This API requires the following crate features to be activated: `Csp`*"] media_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self212 pub fn media_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { 213 use wasm_bindgen::JsValue; 214 let r = ::js_sys::Reflect::set( 215 self.as_ref(), 216 &JsValue::from("media-src"), 217 &JsValue::from(val), 218 ); 219 debug_assert!( 220 r.is_ok(), 221 "setting properties should never fail on our dictionary objects" 222 ); 223 let _ = r; 224 self 225 } 226 #[doc = "Change the `object-src` field of this object."] 227 #[doc = ""] 228 #[doc = "*This API requires the following crate features to be activated: `Csp`*"] object_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self229 pub fn object_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { 230 use wasm_bindgen::JsValue; 231 let r = ::js_sys::Reflect::set( 232 self.as_ref(), 233 &JsValue::from("object-src"), 234 &JsValue::from(val), 235 ); 236 debug_assert!( 237 r.is_ok(), 238 "setting properties should never fail on our dictionary objects" 239 ); 240 let _ = r; 241 self 242 } 243 #[doc = "Change the `referrer` field of this object."] 244 #[doc = ""] 245 #[doc = "*This API requires the following crate features to be activated: `Csp`*"] referrer(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self246 pub fn referrer(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { 247 use wasm_bindgen::JsValue; 248 let r = ::js_sys::Reflect::set( 249 self.as_ref(), 250 &JsValue::from("referrer"), 251 &JsValue::from(val), 252 ); 253 debug_assert!( 254 r.is_ok(), 255 "setting properties should never fail on our dictionary objects" 256 ); 257 let _ = r; 258 self 259 } 260 #[doc = "Change the `report-only` field of this object."] 261 #[doc = ""] 262 #[doc = "*This API requires the following crate features to be activated: `Csp`*"] report_only(&mut self, val: bool) -> &mut Self263 pub fn report_only(&mut self, val: bool) -> &mut Self { 264 use wasm_bindgen::JsValue; 265 let r = ::js_sys::Reflect::set( 266 self.as_ref(), 267 &JsValue::from("report-only"), 268 &JsValue::from(val), 269 ); 270 debug_assert!( 271 r.is_ok(), 272 "setting properties should never fail on our dictionary objects" 273 ); 274 let _ = r; 275 self 276 } 277 #[doc = "Change the `report-uri` field of this object."] 278 #[doc = ""] 279 #[doc = "*This API requires the following crate features to be activated: `Csp`*"] report_uri(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self280 pub fn report_uri(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { 281 use wasm_bindgen::JsValue; 282 let r = ::js_sys::Reflect::set( 283 self.as_ref(), 284 &JsValue::from("report-uri"), 285 &JsValue::from(val), 286 ); 287 debug_assert!( 288 r.is_ok(), 289 "setting properties should never fail on our dictionary objects" 290 ); 291 let _ = r; 292 self 293 } 294 #[doc = "Change the `require-sri-for` field of this object."] 295 #[doc = ""] 296 #[doc = "*This API requires the following crate features to be activated: `Csp`*"] require_sri_for(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self297 pub fn require_sri_for(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { 298 use wasm_bindgen::JsValue; 299 let r = ::js_sys::Reflect::set( 300 self.as_ref(), 301 &JsValue::from("require-sri-for"), 302 &JsValue::from(val), 303 ); 304 debug_assert!( 305 r.is_ok(), 306 "setting properties should never fail on our dictionary objects" 307 ); 308 let _ = r; 309 self 310 } 311 #[doc = "Change the `sandbox` field of this object."] 312 #[doc = ""] 313 #[doc = "*This API requires the following crate features to be activated: `Csp`*"] sandbox(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self314 pub fn sandbox(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { 315 use wasm_bindgen::JsValue; 316 let r = ::js_sys::Reflect::set( 317 self.as_ref(), 318 &JsValue::from("sandbox"), 319 &JsValue::from(val), 320 ); 321 debug_assert!( 322 r.is_ok(), 323 "setting properties should never fail on our dictionary objects" 324 ); 325 let _ = r; 326 self 327 } 328 #[doc = "Change the `script-src` field of this object."] 329 #[doc = ""] 330 #[doc = "*This API requires the following crate features to be activated: `Csp`*"] script_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self331 pub fn script_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { 332 use wasm_bindgen::JsValue; 333 let r = ::js_sys::Reflect::set( 334 self.as_ref(), 335 &JsValue::from("script-src"), 336 &JsValue::from(val), 337 ); 338 debug_assert!( 339 r.is_ok(), 340 "setting properties should never fail on our dictionary objects" 341 ); 342 let _ = r; 343 self 344 } 345 #[doc = "Change the `style-src` field of this object."] 346 #[doc = ""] 347 #[doc = "*This API requires the following crate features to be activated: `Csp`*"] style_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self348 pub fn style_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { 349 use wasm_bindgen::JsValue; 350 let r = ::js_sys::Reflect::set( 351 self.as_ref(), 352 &JsValue::from("style-src"), 353 &JsValue::from(val), 354 ); 355 debug_assert!( 356 r.is_ok(), 357 "setting properties should never fail on our dictionary objects" 358 ); 359 let _ = r; 360 self 361 } 362 #[doc = "Change the `upgrade-insecure-requests` field of this object."] 363 #[doc = ""] 364 #[doc = "*This API requires the following crate features to be activated: `Csp`*"] upgrade_insecure_requests(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self365 pub fn upgrade_insecure_requests(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { 366 use wasm_bindgen::JsValue; 367 let r = ::js_sys::Reflect::set( 368 self.as_ref(), 369 &JsValue::from("upgrade-insecure-requests"), 370 &JsValue::from(val), 371 ); 372 debug_assert!( 373 r.is_ok(), 374 "setting properties should never fail on our dictionary objects" 375 ); 376 let _ = r; 377 self 378 } 379 #[doc = "Change the `worker-src` field of this object."] 380 #[doc = ""] 381 #[doc = "*This API requires the following crate features to be activated: `Csp`*"] worker_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self382 pub fn worker_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { 383 use wasm_bindgen::JsValue; 384 let r = ::js_sys::Reflect::set( 385 self.as_ref(), 386 &JsValue::from("worker-src"), 387 &JsValue::from(val), 388 ); 389 debug_assert!( 390 r.is_ok(), 391 "setting properties should never fail on our dictionary objects" 392 ); 393 let _ = r; 394 self 395 } 396 } 397