github.com/primecitizens/pcz/std@v0.2.1/plat/js/webext/contentsettings/apis_js_wasm.go (about) 1 // SPDX-License-Identifier: Apache-2.0 2 // Copyright 2023 The Prime Citizens 3 4 package contentsettings 5 6 import ( 7 "github.com/primecitizens/pcz/std/ffi/js" 8 "github.com/primecitizens/pcz/std/plat/js/webext/contentsettings/bindings" 9 ) 10 11 type AutoVerifyContentSetting uint32 12 13 const ( 14 _ AutoVerifyContentSetting = iota 15 16 AutoVerifyContentSetting_ALLOW 17 AutoVerifyContentSetting_BLOCK 18 ) 19 20 func (AutoVerifyContentSetting) FromRef(str js.Ref) AutoVerifyContentSetting { 21 return AutoVerifyContentSetting(bindings.ConstOfAutoVerifyContentSetting(str)) 22 } 23 24 func (x AutoVerifyContentSetting) String() (string, bool) { 25 switch x { 26 case AutoVerifyContentSetting_ALLOW: 27 return "allow", true 28 case AutoVerifyContentSetting_BLOCK: 29 return "block", true 30 default: 31 return "", false 32 } 33 } 34 35 type CameraContentSetting uint32 36 37 const ( 38 _ CameraContentSetting = iota 39 40 CameraContentSetting_ALLOW 41 CameraContentSetting_BLOCK 42 CameraContentSetting_ASK 43 ) 44 45 func (CameraContentSetting) FromRef(str js.Ref) CameraContentSetting { 46 return CameraContentSetting(bindings.ConstOfCameraContentSetting(str)) 47 } 48 49 func (x CameraContentSetting) String() (string, bool) { 50 switch x { 51 case CameraContentSetting_ALLOW: 52 return "allow", true 53 case CameraContentSetting_BLOCK: 54 return "block", true 55 case CameraContentSetting_ASK: 56 return "ask", true 57 default: 58 return "", false 59 } 60 } 61 62 type Scope uint32 63 64 const ( 65 _ Scope = iota 66 67 Scope_REGULAR 68 Scope_INCOGNITO_SESSION_ONLY 69 ) 70 71 func (Scope) FromRef(str js.Ref) Scope { 72 return Scope(bindings.ConstOfScope(str)) 73 } 74 75 func (x Scope) String() (string, bool) { 76 switch x { 77 case Scope_REGULAR: 78 return "regular", true 79 case Scope_INCOGNITO_SESSION_ONLY: 80 return "incognito_session_only", true 81 default: 82 return "", false 83 } 84 } 85 86 type ClearArgDetails struct { 87 // Scope is "ClearArgDetails.scope" 88 // 89 // Optional 90 Scope Scope 91 92 FFI_USE bool 93 } 94 95 // FromRef calls UpdateFrom and returns a ClearArgDetails with all fields set. 96 func (p ClearArgDetails) FromRef(ref js.Ref) ClearArgDetails { 97 p.UpdateFrom(ref) 98 return p 99 } 100 101 // New creates a new ClearArgDetails in the application heap. 102 func (p ClearArgDetails) New() js.Ref { 103 return bindings.ClearArgDetailsJSLoad( 104 js.Pointer(&p), js.True, 0, 105 ) 106 } 107 108 // UpdateFrom copies value of all fields of the heap object to p. 109 func (p *ClearArgDetails) UpdateFrom(ref js.Ref) { 110 bindings.ClearArgDetailsJSStore( 111 js.Pointer(p), ref, 112 ) 113 } 114 115 // Update writes all fields of the p to the heap object referenced by ref. 116 func (p *ClearArgDetails) Update(ref js.Ref) { 117 bindings.ClearArgDetailsJSLoad( 118 js.Pointer(p), js.False, ref, 119 ) 120 } 121 122 // FreeMembers frees fields with heap reference, if recursive is true 123 // free all heap references reachable from p. 124 func (p *ClearArgDetails) FreeMembers(recursive bool) { 125 } 126 127 type GetReturnType struct { 128 // Setting is "GetReturnType.setting" 129 // 130 // Required 131 Setting js.Any 132 133 FFI_USE bool 134 } 135 136 // FromRef calls UpdateFrom and returns a GetReturnType with all fields set. 137 func (p GetReturnType) FromRef(ref js.Ref) GetReturnType { 138 p.UpdateFrom(ref) 139 return p 140 } 141 142 // New creates a new GetReturnType in the application heap. 143 func (p GetReturnType) New() js.Ref { 144 return bindings.GetReturnTypeJSLoad( 145 js.Pointer(&p), js.True, 0, 146 ) 147 } 148 149 // UpdateFrom copies value of all fields of the heap object to p. 150 func (p *GetReturnType) UpdateFrom(ref js.Ref) { 151 bindings.GetReturnTypeJSStore( 152 js.Pointer(p), ref, 153 ) 154 } 155 156 // Update writes all fields of the p to the heap object referenced by ref. 157 func (p *GetReturnType) Update(ref js.Ref) { 158 bindings.GetReturnTypeJSLoad( 159 js.Pointer(p), js.False, ref, 160 ) 161 } 162 163 // FreeMembers frees fields with heap reference, if recursive is true 164 // free all heap references reachable from p. 165 func (p *GetReturnType) FreeMembers(recursive bool) { 166 js.Free( 167 p.Setting.Ref(), 168 ) 169 p.Setting = p.Setting.FromRef(js.Undefined) 170 } 171 172 type ResourceIdentifier struct { 173 // Description is "ResourceIdentifier.description" 174 // 175 // Optional 176 Description js.String 177 // Id is "ResourceIdentifier.id" 178 // 179 // Required 180 Id js.String 181 182 FFI_USE bool 183 } 184 185 // FromRef calls UpdateFrom and returns a ResourceIdentifier with all fields set. 186 func (p ResourceIdentifier) FromRef(ref js.Ref) ResourceIdentifier { 187 p.UpdateFrom(ref) 188 return p 189 } 190 191 // New creates a new ResourceIdentifier in the application heap. 192 func (p ResourceIdentifier) New() js.Ref { 193 return bindings.ResourceIdentifierJSLoad( 194 js.Pointer(&p), js.True, 0, 195 ) 196 } 197 198 // UpdateFrom copies value of all fields of the heap object to p. 199 func (p *ResourceIdentifier) UpdateFrom(ref js.Ref) { 200 bindings.ResourceIdentifierJSStore( 201 js.Pointer(p), ref, 202 ) 203 } 204 205 // Update writes all fields of the p to the heap object referenced by ref. 206 func (p *ResourceIdentifier) Update(ref js.Ref) { 207 bindings.ResourceIdentifierJSLoad( 208 js.Pointer(p), js.False, ref, 209 ) 210 } 211 212 // FreeMembers frees fields with heap reference, if recursive is true 213 // free all heap references reachable from p. 214 func (p *ResourceIdentifier) FreeMembers(recursive bool) { 215 js.Free( 216 p.Description.Ref(), 217 p.Id.Ref(), 218 ) 219 p.Description = p.Description.FromRef(js.Undefined) 220 p.Id = p.Id.FromRef(js.Undefined) 221 } 222 223 type GetArgDetails struct { 224 // Incognito is "GetArgDetails.incognito" 225 // 226 // Optional 227 // 228 // NOTE: FFI_USE_Incognito MUST be set to true to make this field effective. 229 Incognito bool 230 // PrimaryUrl is "GetArgDetails.primaryUrl" 231 // 232 // Required 233 PrimaryUrl js.String 234 // ResourceIdentifier is "GetArgDetails.resourceIdentifier" 235 // 236 // Optional 237 // 238 // NOTE: ResourceIdentifier.FFI_USE MUST be set to true to get ResourceIdentifier used. 239 ResourceIdentifier ResourceIdentifier 240 // SecondaryUrl is "GetArgDetails.secondaryUrl" 241 // 242 // Optional 243 SecondaryUrl js.String 244 245 FFI_USE_Incognito bool // for Incognito. 246 247 FFI_USE bool 248 } 249 250 // FromRef calls UpdateFrom and returns a GetArgDetails with all fields set. 251 func (p GetArgDetails) FromRef(ref js.Ref) GetArgDetails { 252 p.UpdateFrom(ref) 253 return p 254 } 255 256 // New creates a new GetArgDetails in the application heap. 257 func (p GetArgDetails) New() js.Ref { 258 return bindings.GetArgDetailsJSLoad( 259 js.Pointer(&p), js.True, 0, 260 ) 261 } 262 263 // UpdateFrom copies value of all fields of the heap object to p. 264 func (p *GetArgDetails) UpdateFrom(ref js.Ref) { 265 bindings.GetArgDetailsJSStore( 266 js.Pointer(p), ref, 267 ) 268 } 269 270 // Update writes all fields of the p to the heap object referenced by ref. 271 func (p *GetArgDetails) Update(ref js.Ref) { 272 bindings.GetArgDetailsJSLoad( 273 js.Pointer(p), js.False, ref, 274 ) 275 } 276 277 // FreeMembers frees fields with heap reference, if recursive is true 278 // free all heap references reachable from p. 279 func (p *GetArgDetails) FreeMembers(recursive bool) { 280 js.Free( 281 p.PrimaryUrl.Ref(), 282 p.SecondaryUrl.Ref(), 283 ) 284 p.PrimaryUrl = p.PrimaryUrl.FromRef(js.Undefined) 285 p.SecondaryUrl = p.SecondaryUrl.FromRef(js.Undefined) 286 if recursive { 287 p.ResourceIdentifier.FreeMembers(true) 288 } 289 } 290 291 type SetArgDetails struct { 292 // PrimaryPattern is "SetArgDetails.primaryPattern" 293 // 294 // Required 295 PrimaryPattern js.String 296 // ResourceIdentifier is "SetArgDetails.resourceIdentifier" 297 // 298 // Optional 299 // 300 // NOTE: ResourceIdentifier.FFI_USE MUST be set to true to get ResourceIdentifier used. 301 ResourceIdentifier ResourceIdentifier 302 // Scope is "SetArgDetails.scope" 303 // 304 // Optional 305 Scope Scope 306 // SecondaryPattern is "SetArgDetails.secondaryPattern" 307 // 308 // Optional 309 SecondaryPattern js.String 310 // Setting is "SetArgDetails.setting" 311 // 312 // Required 313 Setting js.Any 314 315 FFI_USE bool 316 } 317 318 // FromRef calls UpdateFrom and returns a SetArgDetails with all fields set. 319 func (p SetArgDetails) FromRef(ref js.Ref) SetArgDetails { 320 p.UpdateFrom(ref) 321 return p 322 } 323 324 // New creates a new SetArgDetails in the application heap. 325 func (p SetArgDetails) New() js.Ref { 326 return bindings.SetArgDetailsJSLoad( 327 js.Pointer(&p), js.True, 0, 328 ) 329 } 330 331 // UpdateFrom copies value of all fields of the heap object to p. 332 func (p *SetArgDetails) UpdateFrom(ref js.Ref) { 333 bindings.SetArgDetailsJSStore( 334 js.Pointer(p), ref, 335 ) 336 } 337 338 // Update writes all fields of the p to the heap object referenced by ref. 339 func (p *SetArgDetails) Update(ref js.Ref) { 340 bindings.SetArgDetailsJSLoad( 341 js.Pointer(p), js.False, ref, 342 ) 343 } 344 345 // FreeMembers frees fields with heap reference, if recursive is true 346 // free all heap references reachable from p. 347 func (p *SetArgDetails) FreeMembers(recursive bool) { 348 js.Free( 349 p.PrimaryPattern.Ref(), 350 p.SecondaryPattern.Ref(), 351 p.Setting.Ref(), 352 ) 353 p.PrimaryPattern = p.PrimaryPattern.FromRef(js.Undefined) 354 p.SecondaryPattern = p.SecondaryPattern.FromRef(js.Undefined) 355 p.Setting = p.Setting.FromRef(js.Undefined) 356 if recursive { 357 p.ResourceIdentifier.FreeMembers(true) 358 } 359 } 360 361 type ContentSetting struct { 362 ref js.Ref 363 } 364 365 func (this ContentSetting) Once() ContentSetting { 366 this.ref.Once() 367 return this 368 } 369 370 func (this ContentSetting) Ref() js.Ref { 371 return this.ref 372 } 373 374 func (this ContentSetting) FromRef(ref js.Ref) ContentSetting { 375 this.ref = ref 376 return this 377 } 378 379 func (this ContentSetting) Free() { 380 this.ref.Free() 381 } 382 383 // HasFuncClear returns true if the method "ContentSetting.clear" exists. 384 func (this ContentSetting) HasFuncClear() bool { 385 return js.True == bindings.HasFuncContentSettingClear( 386 this.ref, 387 ) 388 } 389 390 // FuncClear returns the method "ContentSetting.clear". 391 func (this ContentSetting) FuncClear() (fn js.Func[func(details ClearArgDetails) js.Promise[js.Void]]) { 392 bindings.FuncContentSettingClear( 393 this.ref, js.Pointer(&fn), 394 ) 395 return 396 } 397 398 // Clear calls the method "ContentSetting.clear". 399 func (this ContentSetting) Clear(details ClearArgDetails) (ret js.Promise[js.Void]) { 400 bindings.CallContentSettingClear( 401 this.ref, js.Pointer(&ret), 402 js.Pointer(&details), 403 ) 404 405 return 406 } 407 408 // TryClear calls the method "ContentSetting.clear" 409 // in a try/catch block and returns (_, err, ok = false) when it went through 410 // the catch clause. 411 func (this ContentSetting) TryClear(details ClearArgDetails) (ret js.Promise[js.Void], exception js.Any, ok bool) { 412 ok = js.True == bindings.TryContentSettingClear( 413 this.ref, js.Pointer(&ret), js.Pointer(&exception), 414 js.Pointer(&details), 415 ) 416 417 return 418 } 419 420 // HasFuncGet returns true if the method "ContentSetting.get" exists. 421 func (this ContentSetting) HasFuncGet() bool { 422 return js.True == bindings.HasFuncContentSettingGet( 423 this.ref, 424 ) 425 } 426 427 // FuncGet returns the method "ContentSetting.get". 428 func (this ContentSetting) FuncGet() (fn js.Func[func(details GetArgDetails) js.Promise[GetReturnType]]) { 429 bindings.FuncContentSettingGet( 430 this.ref, js.Pointer(&fn), 431 ) 432 return 433 } 434 435 // Get calls the method "ContentSetting.get". 436 func (this ContentSetting) Get(details GetArgDetails) (ret js.Promise[GetReturnType]) { 437 bindings.CallContentSettingGet( 438 this.ref, js.Pointer(&ret), 439 js.Pointer(&details), 440 ) 441 442 return 443 } 444 445 // TryGet calls the method "ContentSetting.get" 446 // in a try/catch block and returns (_, err, ok = false) when it went through 447 // the catch clause. 448 func (this ContentSetting) TryGet(details GetArgDetails) (ret js.Promise[GetReturnType], exception js.Any, ok bool) { 449 ok = js.True == bindings.TryContentSettingGet( 450 this.ref, js.Pointer(&ret), js.Pointer(&exception), 451 js.Pointer(&details), 452 ) 453 454 return 455 } 456 457 // HasFuncSet returns true if the method "ContentSetting.set" exists. 458 func (this ContentSetting) HasFuncSet() bool { 459 return js.True == bindings.HasFuncContentSettingSet( 460 this.ref, 461 ) 462 } 463 464 // FuncSet returns the method "ContentSetting.set". 465 func (this ContentSetting) FuncSet() (fn js.Func[func(details SetArgDetails) js.Promise[js.Void]]) { 466 bindings.FuncContentSettingSet( 467 this.ref, js.Pointer(&fn), 468 ) 469 return 470 } 471 472 // Set calls the method "ContentSetting.set". 473 func (this ContentSetting) Set(details SetArgDetails) (ret js.Promise[js.Void]) { 474 bindings.CallContentSettingSet( 475 this.ref, js.Pointer(&ret), 476 js.Pointer(&details), 477 ) 478 479 return 480 } 481 482 // TrySet calls the method "ContentSetting.set" 483 // in a try/catch block and returns (_, err, ok = false) when it went through 484 // the catch clause. 485 func (this ContentSetting) TrySet(details SetArgDetails) (ret js.Promise[js.Void], exception js.Any, ok bool) { 486 ok = js.True == bindings.TryContentSettingSet( 487 this.ref, js.Pointer(&ret), js.Pointer(&exception), 488 js.Pointer(&details), 489 ) 490 491 return 492 } 493 494 // HasFuncGetResourceIdentifiers returns true if the method "ContentSetting.getResourceIdentifiers" exists. 495 func (this ContentSetting) HasFuncGetResourceIdentifiers() bool { 496 return js.True == bindings.HasFuncContentSettingGetResourceIdentifiers( 497 this.ref, 498 ) 499 } 500 501 // FuncGetResourceIdentifiers returns the method "ContentSetting.getResourceIdentifiers". 502 func (this ContentSetting) FuncGetResourceIdentifiers() (fn js.Func[func() js.Promise[js.Array[ResourceIdentifier]]]) { 503 bindings.FuncContentSettingGetResourceIdentifiers( 504 this.ref, js.Pointer(&fn), 505 ) 506 return 507 } 508 509 // GetResourceIdentifiers calls the method "ContentSetting.getResourceIdentifiers". 510 func (this ContentSetting) GetResourceIdentifiers() (ret js.Promise[js.Array[ResourceIdentifier]]) { 511 bindings.CallContentSettingGetResourceIdentifiers( 512 this.ref, js.Pointer(&ret), 513 ) 514 515 return 516 } 517 518 // TryGetResourceIdentifiers calls the method "ContentSetting.getResourceIdentifiers" 519 // in a try/catch block and returns (_, err, ok = false) when it went through 520 // the catch clause. 521 func (this ContentSetting) TryGetResourceIdentifiers() (ret js.Promise[js.Array[ResourceIdentifier]], exception js.Any, ok bool) { 522 ok = js.True == bindings.TryContentSettingGetResourceIdentifiers( 523 this.ref, js.Pointer(&ret), js.Pointer(&exception), 524 ) 525 526 return 527 } 528 529 type CookiesContentSetting uint32 530 531 const ( 532 _ CookiesContentSetting = iota 533 534 CookiesContentSetting_ALLOW 535 CookiesContentSetting_BLOCK 536 CookiesContentSetting_SESSION_ONLY 537 ) 538 539 func (CookiesContentSetting) FromRef(str js.Ref) CookiesContentSetting { 540 return CookiesContentSetting(bindings.ConstOfCookiesContentSetting(str)) 541 } 542 543 func (x CookiesContentSetting) String() (string, bool) { 544 switch x { 545 case CookiesContentSetting_ALLOW: 546 return "allow", true 547 case CookiesContentSetting_BLOCK: 548 return "block", true 549 case CookiesContentSetting_SESSION_ONLY: 550 return "session_only", true 551 default: 552 return "", false 553 } 554 } 555 556 type FullscreenContentSetting uint32 557 558 const ( 559 _ FullscreenContentSetting = iota 560 561 FullscreenContentSetting_ALLOW 562 ) 563 564 func (FullscreenContentSetting) FromRef(str js.Ref) FullscreenContentSetting { 565 return FullscreenContentSetting(bindings.ConstOfFullscreenContentSetting(str)) 566 } 567 568 func (x FullscreenContentSetting) String() (string, bool) { 569 switch x { 570 case FullscreenContentSetting_ALLOW: 571 return "allow", true 572 default: 573 return "", false 574 } 575 } 576 577 type ImagesContentSetting uint32 578 579 const ( 580 _ ImagesContentSetting = iota 581 582 ImagesContentSetting_ALLOW 583 ImagesContentSetting_BLOCK 584 ) 585 586 func (ImagesContentSetting) FromRef(str js.Ref) ImagesContentSetting { 587 return ImagesContentSetting(bindings.ConstOfImagesContentSetting(str)) 588 } 589 590 func (x ImagesContentSetting) String() (string, bool) { 591 switch x { 592 case ImagesContentSetting_ALLOW: 593 return "allow", true 594 case ImagesContentSetting_BLOCK: 595 return "block", true 596 default: 597 return "", false 598 } 599 } 600 601 type JavascriptContentSetting uint32 602 603 const ( 604 _ JavascriptContentSetting = iota 605 606 JavascriptContentSetting_ALLOW 607 JavascriptContentSetting_BLOCK 608 ) 609 610 func (JavascriptContentSetting) FromRef(str js.Ref) JavascriptContentSetting { 611 return JavascriptContentSetting(bindings.ConstOfJavascriptContentSetting(str)) 612 } 613 614 func (x JavascriptContentSetting) String() (string, bool) { 615 switch x { 616 case JavascriptContentSetting_ALLOW: 617 return "allow", true 618 case JavascriptContentSetting_BLOCK: 619 return "block", true 620 default: 621 return "", false 622 } 623 } 624 625 type LocationContentSetting uint32 626 627 const ( 628 _ LocationContentSetting = iota 629 630 LocationContentSetting_ALLOW 631 LocationContentSetting_BLOCK 632 LocationContentSetting_ASK 633 ) 634 635 func (LocationContentSetting) FromRef(str js.Ref) LocationContentSetting { 636 return LocationContentSetting(bindings.ConstOfLocationContentSetting(str)) 637 } 638 639 func (x LocationContentSetting) String() (string, bool) { 640 switch x { 641 case LocationContentSetting_ALLOW: 642 return "allow", true 643 case LocationContentSetting_BLOCK: 644 return "block", true 645 case LocationContentSetting_ASK: 646 return "ask", true 647 default: 648 return "", false 649 } 650 } 651 652 type MicrophoneContentSetting uint32 653 654 const ( 655 _ MicrophoneContentSetting = iota 656 657 MicrophoneContentSetting_ALLOW 658 MicrophoneContentSetting_BLOCK 659 MicrophoneContentSetting_ASK 660 ) 661 662 func (MicrophoneContentSetting) FromRef(str js.Ref) MicrophoneContentSetting { 663 return MicrophoneContentSetting(bindings.ConstOfMicrophoneContentSetting(str)) 664 } 665 666 func (x MicrophoneContentSetting) String() (string, bool) { 667 switch x { 668 case MicrophoneContentSetting_ALLOW: 669 return "allow", true 670 case MicrophoneContentSetting_BLOCK: 671 return "block", true 672 case MicrophoneContentSetting_ASK: 673 return "ask", true 674 default: 675 return "", false 676 } 677 } 678 679 type MouselockContentSetting uint32 680 681 const ( 682 _ MouselockContentSetting = iota 683 684 MouselockContentSetting_ALLOW 685 ) 686 687 func (MouselockContentSetting) FromRef(str js.Ref) MouselockContentSetting { 688 return MouselockContentSetting(bindings.ConstOfMouselockContentSetting(str)) 689 } 690 691 func (x MouselockContentSetting) String() (string, bool) { 692 switch x { 693 case MouselockContentSetting_ALLOW: 694 return "allow", true 695 default: 696 return "", false 697 } 698 } 699 700 type MultipleAutomaticDownloadsContentSetting uint32 701 702 const ( 703 _ MultipleAutomaticDownloadsContentSetting = iota 704 705 MultipleAutomaticDownloadsContentSetting_ALLOW 706 MultipleAutomaticDownloadsContentSetting_BLOCK 707 MultipleAutomaticDownloadsContentSetting_ASK 708 ) 709 710 func (MultipleAutomaticDownloadsContentSetting) FromRef(str js.Ref) MultipleAutomaticDownloadsContentSetting { 711 return MultipleAutomaticDownloadsContentSetting(bindings.ConstOfMultipleAutomaticDownloadsContentSetting(str)) 712 } 713 714 func (x MultipleAutomaticDownloadsContentSetting) String() (string, bool) { 715 switch x { 716 case MultipleAutomaticDownloadsContentSetting_ALLOW: 717 return "allow", true 718 case MultipleAutomaticDownloadsContentSetting_BLOCK: 719 return "block", true 720 case MultipleAutomaticDownloadsContentSetting_ASK: 721 return "ask", true 722 default: 723 return "", false 724 } 725 } 726 727 type NotificationsContentSetting uint32 728 729 const ( 730 _ NotificationsContentSetting = iota 731 732 NotificationsContentSetting_ALLOW 733 NotificationsContentSetting_BLOCK 734 NotificationsContentSetting_ASK 735 ) 736 737 func (NotificationsContentSetting) FromRef(str js.Ref) NotificationsContentSetting { 738 return NotificationsContentSetting(bindings.ConstOfNotificationsContentSetting(str)) 739 } 740 741 func (x NotificationsContentSetting) String() (string, bool) { 742 switch x { 743 case NotificationsContentSetting_ALLOW: 744 return "allow", true 745 case NotificationsContentSetting_BLOCK: 746 return "block", true 747 case NotificationsContentSetting_ASK: 748 return "ask", true 749 default: 750 return "", false 751 } 752 } 753 754 type PluginsContentSetting uint32 755 756 const ( 757 _ PluginsContentSetting = iota 758 759 PluginsContentSetting_BLOCK 760 ) 761 762 func (PluginsContentSetting) FromRef(str js.Ref) PluginsContentSetting { 763 return PluginsContentSetting(bindings.ConstOfPluginsContentSetting(str)) 764 } 765 766 func (x PluginsContentSetting) String() (string, bool) { 767 switch x { 768 case PluginsContentSetting_BLOCK: 769 return "block", true 770 default: 771 return "", false 772 } 773 } 774 775 type PopupsContentSetting uint32 776 777 const ( 778 _ PopupsContentSetting = iota 779 780 PopupsContentSetting_ALLOW 781 PopupsContentSetting_BLOCK 782 ) 783 784 func (PopupsContentSetting) FromRef(str js.Ref) PopupsContentSetting { 785 return PopupsContentSetting(bindings.ConstOfPopupsContentSetting(str)) 786 } 787 788 func (x PopupsContentSetting) String() (string, bool) { 789 switch x { 790 case PopupsContentSetting_ALLOW: 791 return "allow", true 792 case PopupsContentSetting_BLOCK: 793 return "block", true 794 default: 795 return "", false 796 } 797 } 798 799 type PpapiBrokerContentSetting uint32 800 801 const ( 802 _ PpapiBrokerContentSetting = iota 803 804 PpapiBrokerContentSetting_BLOCK 805 ) 806 807 func (PpapiBrokerContentSetting) FromRef(str js.Ref) PpapiBrokerContentSetting { 808 return PpapiBrokerContentSetting(bindings.ConstOfPpapiBrokerContentSetting(str)) 809 } 810 811 func (x PpapiBrokerContentSetting) String() (string, bool) { 812 switch x { 813 case PpapiBrokerContentSetting_BLOCK: 814 return "block", true 815 default: 816 return "", false 817 } 818 } 819 820 // AutoVerify returns the value of property "WEBEXT.contentSettings.autoVerify". 821 // 822 // The returned bool will be false if there is no such property. 823 func AutoVerify() (ret ContentSetting, ok bool) { 824 ok = js.True == bindings.GetAutoVerify( 825 js.Pointer(&ret), 826 ) 827 828 return 829 } 830 831 // SetAutoVerify sets the value of property "WEBEXT.contentSettings.autoVerify" to val. 832 // 833 // It returns false if the property cannot be set. 834 func SetAutoVerify(val ContentSetting) bool { 835 return js.True == bindings.SetAutoVerify( 836 val.Ref()) 837 } 838 839 // AutomaticDownloads returns the value of property "WEBEXT.contentSettings.automaticDownloads". 840 // 841 // The returned bool will be false if there is no such property. 842 func AutomaticDownloads() (ret ContentSetting, ok bool) { 843 ok = js.True == bindings.GetAutomaticDownloads( 844 js.Pointer(&ret), 845 ) 846 847 return 848 } 849 850 // SetAutomaticDownloads sets the value of property "WEBEXT.contentSettings.automaticDownloads" to val. 851 // 852 // It returns false if the property cannot be set. 853 func SetAutomaticDownloads(val ContentSetting) bool { 854 return js.True == bindings.SetAutomaticDownloads( 855 val.Ref()) 856 } 857 858 // Camera returns the value of property "WEBEXT.contentSettings.camera". 859 // 860 // The returned bool will be false if there is no such property. 861 func Camera() (ret ContentSetting, ok bool) { 862 ok = js.True == bindings.GetCamera( 863 js.Pointer(&ret), 864 ) 865 866 return 867 } 868 869 // SetCamera sets the value of property "WEBEXT.contentSettings.camera" to val. 870 // 871 // It returns false if the property cannot be set. 872 func SetCamera(val ContentSetting) bool { 873 return js.True == bindings.SetCamera( 874 val.Ref()) 875 } 876 877 // Cookies returns the value of property "WEBEXT.contentSettings.cookies". 878 // 879 // The returned bool will be false if there is no such property. 880 func Cookies() (ret ContentSetting, ok bool) { 881 ok = js.True == bindings.GetCookies( 882 js.Pointer(&ret), 883 ) 884 885 return 886 } 887 888 // SetCookies sets the value of property "WEBEXT.contentSettings.cookies" to val. 889 // 890 // It returns false if the property cannot be set. 891 func SetCookies(val ContentSetting) bool { 892 return js.True == bindings.SetCookies( 893 val.Ref()) 894 } 895 896 // Fullscreen returns the value of property "WEBEXT.contentSettings.fullscreen". 897 // 898 // The returned bool will be false if there is no such property. 899 func Fullscreen() (ret ContentSetting, ok bool) { 900 ok = js.True == bindings.GetFullscreen( 901 js.Pointer(&ret), 902 ) 903 904 return 905 } 906 907 // SetFullscreen sets the value of property "WEBEXT.contentSettings.fullscreen" to val. 908 // 909 // It returns false if the property cannot be set. 910 func SetFullscreen(val ContentSetting) bool { 911 return js.True == bindings.SetFullscreen( 912 val.Ref()) 913 } 914 915 // Images returns the value of property "WEBEXT.contentSettings.images". 916 // 917 // The returned bool will be false if there is no such property. 918 func Images() (ret ContentSetting, ok bool) { 919 ok = js.True == bindings.GetImages( 920 js.Pointer(&ret), 921 ) 922 923 return 924 } 925 926 // SetImages sets the value of property "WEBEXT.contentSettings.images" to val. 927 // 928 // It returns false if the property cannot be set. 929 func SetImages(val ContentSetting) bool { 930 return js.True == bindings.SetImages( 931 val.Ref()) 932 } 933 934 // Javascript returns the value of property "WEBEXT.contentSettings.javascript". 935 // 936 // The returned bool will be false if there is no such property. 937 func Javascript() (ret ContentSetting, ok bool) { 938 ok = js.True == bindings.GetJavascript( 939 js.Pointer(&ret), 940 ) 941 942 return 943 } 944 945 // SetJavascript sets the value of property "WEBEXT.contentSettings.javascript" to val. 946 // 947 // It returns false if the property cannot be set. 948 func SetJavascript(val ContentSetting) bool { 949 return js.True == bindings.SetJavascript( 950 val.Ref()) 951 } 952 953 // Location returns the value of property "WEBEXT.contentSettings.location". 954 // 955 // The returned bool will be false if there is no such property. 956 func Location() (ret ContentSetting, ok bool) { 957 ok = js.True == bindings.GetLocation( 958 js.Pointer(&ret), 959 ) 960 961 return 962 } 963 964 // SetLocation sets the value of property "WEBEXT.contentSettings.location" to val. 965 // 966 // It returns false if the property cannot be set. 967 func SetLocation(val ContentSetting) bool { 968 return js.True == bindings.SetLocation( 969 val.Ref()) 970 } 971 972 // Microphone returns the value of property "WEBEXT.contentSettings.microphone". 973 // 974 // The returned bool will be false if there is no such property. 975 func Microphone() (ret ContentSetting, ok bool) { 976 ok = js.True == bindings.GetMicrophone( 977 js.Pointer(&ret), 978 ) 979 980 return 981 } 982 983 // SetMicrophone sets the value of property "WEBEXT.contentSettings.microphone" to val. 984 // 985 // It returns false if the property cannot be set. 986 func SetMicrophone(val ContentSetting) bool { 987 return js.True == bindings.SetMicrophone( 988 val.Ref()) 989 } 990 991 // Mouselock returns the value of property "WEBEXT.contentSettings.mouselock". 992 // 993 // The returned bool will be false if there is no such property. 994 func Mouselock() (ret ContentSetting, ok bool) { 995 ok = js.True == bindings.GetMouselock( 996 js.Pointer(&ret), 997 ) 998 999 return 1000 } 1001 1002 // SetMouselock sets the value of property "WEBEXT.contentSettings.mouselock" to val. 1003 // 1004 // It returns false if the property cannot be set. 1005 func SetMouselock(val ContentSetting) bool { 1006 return js.True == bindings.SetMouselock( 1007 val.Ref()) 1008 } 1009 1010 // Notifications returns the value of property "WEBEXT.contentSettings.notifications". 1011 // 1012 // The returned bool will be false if there is no such property. 1013 func Notifications() (ret ContentSetting, ok bool) { 1014 ok = js.True == bindings.GetNotifications( 1015 js.Pointer(&ret), 1016 ) 1017 1018 return 1019 } 1020 1021 // SetNotifications sets the value of property "WEBEXT.contentSettings.notifications" to val. 1022 // 1023 // It returns false if the property cannot be set. 1024 func SetNotifications(val ContentSetting) bool { 1025 return js.True == bindings.SetNotifications( 1026 val.Ref()) 1027 } 1028 1029 // Plugins returns the value of property "WEBEXT.contentSettings.plugins". 1030 // 1031 // The returned bool will be false if there is no such property. 1032 func Plugins() (ret ContentSetting, ok bool) { 1033 ok = js.True == bindings.GetPlugins( 1034 js.Pointer(&ret), 1035 ) 1036 1037 return 1038 } 1039 1040 // SetPlugins sets the value of property "WEBEXT.contentSettings.plugins" to val. 1041 // 1042 // It returns false if the property cannot be set. 1043 func SetPlugins(val ContentSetting) bool { 1044 return js.True == bindings.SetPlugins( 1045 val.Ref()) 1046 } 1047 1048 // Popups returns the value of property "WEBEXT.contentSettings.popups". 1049 // 1050 // The returned bool will be false if there is no such property. 1051 func Popups() (ret ContentSetting, ok bool) { 1052 ok = js.True == bindings.GetPopups( 1053 js.Pointer(&ret), 1054 ) 1055 1056 return 1057 } 1058 1059 // SetPopups sets the value of property "WEBEXT.contentSettings.popups" to val. 1060 // 1061 // It returns false if the property cannot be set. 1062 func SetPopups(val ContentSetting) bool { 1063 return js.True == bindings.SetPopups( 1064 val.Ref()) 1065 } 1066 1067 // UnsandboxedPlugins returns the value of property "WEBEXT.contentSettings.unsandboxedPlugins". 1068 // 1069 // The returned bool will be false if there is no such property. 1070 func UnsandboxedPlugins() (ret ContentSetting, ok bool) { 1071 ok = js.True == bindings.GetUnsandboxedPlugins( 1072 js.Pointer(&ret), 1073 ) 1074 1075 return 1076 } 1077 1078 // SetUnsandboxedPlugins sets the value of property "WEBEXT.contentSettings.unsandboxedPlugins" to val. 1079 // 1080 // It returns false if the property cannot be set. 1081 func SetUnsandboxedPlugins(val ContentSetting) bool { 1082 return js.True == bindings.SetUnsandboxedPlugins( 1083 val.Ref()) 1084 }