github.com/primecitizens/pcz/std@v0.2.1/plat/js/webext/webviewinternal/apis_js_wasm.go (about)

     1  // SPDX-License-Identifier: Apache-2.0
     2  // Copyright 2023 The Prime Citizens
     3  
     4  package webviewinternal
     5  
     6  import (
     7  	"github.com/primecitizens/pcz/std/core/abi"
     8  	"github.com/primecitizens/pcz/std/core/mark"
     9  	"github.com/primecitizens/pcz/std/ffi/js"
    10  	"github.com/primecitizens/pcz/std/plat/js/webext/extensiontypes"
    11  	"github.com/primecitizens/pcz/std/plat/js/webext/webviewinternal/bindings"
    12  )
    13  
    14  type CaptureVisibleRegionArgCallbackFunc func(this js.Ref, dataUrl js.String) js.Ref
    15  
    16  func (fn CaptureVisibleRegionArgCallbackFunc) Register() js.Func[func(dataUrl js.String)] {
    17  	return js.RegisterCallback[func(dataUrl js.String)](
    18  		fn, abi.FuncPCABIInternal(fn),
    19  	)
    20  }
    21  
    22  func (fn CaptureVisibleRegionArgCallbackFunc) DispatchCallback(
    23  	targetPC uintptr, ctx *js.CallbackContext,
    24  ) {
    25  	args := ctx.Args()
    26  	if len(args) != 1+1 /* js this */ ||
    27  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
    28  		js.ThrowInvalidCallbackInvocation()
    29  	}
    30  
    31  	if ctx.Return(fn(
    32  		args[0],
    33  
    34  		js.String{}.FromRef(args[0+1]),
    35  	)) {
    36  		return
    37  	}
    38  
    39  	js.ThrowCallbackValueNotReturned()
    40  }
    41  
    42  type CaptureVisibleRegionArgCallback[T any] struct {
    43  	Fn  func(arg T, this js.Ref, dataUrl js.String) js.Ref
    44  	Arg T
    45  }
    46  
    47  func (cb *CaptureVisibleRegionArgCallback[T]) Register() js.Func[func(dataUrl js.String)] {
    48  	return js.RegisterCallback[func(dataUrl js.String)](
    49  		cb, abi.FuncPCABIInternal(cb.Fn),
    50  	)
    51  }
    52  
    53  func (cb *CaptureVisibleRegionArgCallback[T]) DispatchCallback(
    54  	targetPC uintptr, ctx *js.CallbackContext,
    55  ) {
    56  	args := ctx.Args()
    57  	if len(args) != 1+1 /* js this */ ||
    58  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
    59  		js.ThrowInvalidCallbackInvocation()
    60  	}
    61  
    62  	if ctx.Return(cb.Fn(
    63  		cb.Arg,
    64  		args[0],
    65  
    66  		js.String{}.FromRef(args[0+1]),
    67  	)) {
    68  		return
    69  	}
    70  
    71  	js.ThrowCallbackValueNotReturned()
    72  }
    73  
    74  type ClearDataArgCallbackFunc func(this js.Ref) js.Ref
    75  
    76  func (fn ClearDataArgCallbackFunc) Register() js.Func[func()] {
    77  	return js.RegisterCallback[func()](
    78  		fn, abi.FuncPCABIInternal(fn),
    79  	)
    80  }
    81  
    82  func (fn ClearDataArgCallbackFunc) DispatchCallback(
    83  	targetPC uintptr, ctx *js.CallbackContext,
    84  ) {
    85  	args := ctx.Args()
    86  	if len(args) != 0+1 /* js this */ ||
    87  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
    88  		js.ThrowInvalidCallbackInvocation()
    89  	}
    90  
    91  	if ctx.Return(fn(
    92  		args[0],
    93  	)) {
    94  		return
    95  	}
    96  
    97  	js.ThrowCallbackValueNotReturned()
    98  }
    99  
   100  type ClearDataArgCallback[T any] struct {
   101  	Fn  func(arg T, this js.Ref) js.Ref
   102  	Arg T
   103  }
   104  
   105  func (cb *ClearDataArgCallback[T]) Register() js.Func[func()] {
   106  	return js.RegisterCallback[func()](
   107  		cb, abi.FuncPCABIInternal(cb.Fn),
   108  	)
   109  }
   110  
   111  func (cb *ClearDataArgCallback[T]) DispatchCallback(
   112  	targetPC uintptr, ctx *js.CallbackContext,
   113  ) {
   114  	args := ctx.Args()
   115  	if len(args) != 0+1 /* js this */ ||
   116  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
   117  		js.ThrowInvalidCallbackInvocation()
   118  	}
   119  
   120  	if ctx.Return(cb.Fn(
   121  		cb.Arg,
   122  		args[0],
   123  	)) {
   124  		return
   125  	}
   126  
   127  	js.ThrowCallbackValueNotReturned()
   128  }
   129  
   130  type InjectionItems struct {
   131  	// Code is "InjectionItems.code"
   132  	//
   133  	// Optional
   134  	Code js.String
   135  	// Files is "InjectionItems.files"
   136  	//
   137  	// Optional
   138  	Files js.Array[js.String]
   139  
   140  	FFI_USE bool
   141  }
   142  
   143  // FromRef calls UpdateFrom and returns a InjectionItems with all fields set.
   144  func (p InjectionItems) FromRef(ref js.Ref) InjectionItems {
   145  	p.UpdateFrom(ref)
   146  	return p
   147  }
   148  
   149  // New creates a new InjectionItems in the application heap.
   150  func (p InjectionItems) New() js.Ref {
   151  	return bindings.InjectionItemsJSLoad(
   152  		js.Pointer(&p), js.True, 0,
   153  	)
   154  }
   155  
   156  // UpdateFrom copies value of all fields of the heap object to p.
   157  func (p *InjectionItems) UpdateFrom(ref js.Ref) {
   158  	bindings.InjectionItemsJSStore(
   159  		js.Pointer(p), ref,
   160  	)
   161  }
   162  
   163  // Update writes all fields of the p to the heap object referenced by ref.
   164  func (p *InjectionItems) Update(ref js.Ref) {
   165  	bindings.InjectionItemsJSLoad(
   166  		js.Pointer(p), js.False, ref,
   167  	)
   168  }
   169  
   170  // FreeMembers frees fields with heap reference, if recursive is true
   171  // free all heap references reachable from p.
   172  func (p *InjectionItems) FreeMembers(recursive bool) {
   173  	js.Free(
   174  		p.Code.Ref(),
   175  		p.Files.Ref(),
   176  	)
   177  	p.Code = p.Code.FromRef(js.Undefined)
   178  	p.Files = p.Files.FromRef(js.Undefined)
   179  }
   180  
   181  type ContentScriptDetails struct {
   182  	// AllFrames is "ContentScriptDetails.all_frames"
   183  	//
   184  	// Optional
   185  	//
   186  	// NOTE: FFI_USE_AllFrames MUST be set to true to make this field effective.
   187  	AllFrames bool
   188  	// Css is "ContentScriptDetails.css"
   189  	//
   190  	// Optional
   191  	//
   192  	// NOTE: Css.FFI_USE MUST be set to true to get Css used.
   193  	Css InjectionItems
   194  	// ExcludeGlobs is "ContentScriptDetails.exclude_globs"
   195  	//
   196  	// Optional
   197  	ExcludeGlobs js.Array[js.String]
   198  	// ExcludeMatches is "ContentScriptDetails.exclude_matches"
   199  	//
   200  	// Optional
   201  	ExcludeMatches js.Array[js.String]
   202  	// IncludeGlobs is "ContentScriptDetails.include_globs"
   203  	//
   204  	// Optional
   205  	IncludeGlobs js.Array[js.String]
   206  	// Js is "ContentScriptDetails.js"
   207  	//
   208  	// Optional
   209  	//
   210  	// NOTE: Js.FFI_USE MUST be set to true to get Js used.
   211  	Js InjectionItems
   212  	// MatchAboutBlank is "ContentScriptDetails.match_about_blank"
   213  	//
   214  	// Optional
   215  	//
   216  	// NOTE: FFI_USE_MatchAboutBlank MUST be set to true to make this field effective.
   217  	MatchAboutBlank bool
   218  	// Matches is "ContentScriptDetails.matches"
   219  	//
   220  	// Required
   221  	Matches js.Array[js.String]
   222  	// Name is "ContentScriptDetails.name"
   223  	//
   224  	// Required
   225  	Name js.String
   226  	// RunAt is "ContentScriptDetails.run_at"
   227  	//
   228  	// Optional
   229  	RunAt extensiontypes.RunAt
   230  
   231  	FFI_USE_AllFrames       bool // for AllFrames.
   232  	FFI_USE_MatchAboutBlank bool // for MatchAboutBlank.
   233  
   234  	FFI_USE bool
   235  }
   236  
   237  // FromRef calls UpdateFrom and returns a ContentScriptDetails with all fields set.
   238  func (p ContentScriptDetails) FromRef(ref js.Ref) ContentScriptDetails {
   239  	p.UpdateFrom(ref)
   240  	return p
   241  }
   242  
   243  // New creates a new ContentScriptDetails in the application heap.
   244  func (p ContentScriptDetails) New() js.Ref {
   245  	return bindings.ContentScriptDetailsJSLoad(
   246  		js.Pointer(&p), js.True, 0,
   247  	)
   248  }
   249  
   250  // UpdateFrom copies value of all fields of the heap object to p.
   251  func (p *ContentScriptDetails) UpdateFrom(ref js.Ref) {
   252  	bindings.ContentScriptDetailsJSStore(
   253  		js.Pointer(p), ref,
   254  	)
   255  }
   256  
   257  // Update writes all fields of the p to the heap object referenced by ref.
   258  func (p *ContentScriptDetails) Update(ref js.Ref) {
   259  	bindings.ContentScriptDetailsJSLoad(
   260  		js.Pointer(p), js.False, ref,
   261  	)
   262  }
   263  
   264  // FreeMembers frees fields with heap reference, if recursive is true
   265  // free all heap references reachable from p.
   266  func (p *ContentScriptDetails) FreeMembers(recursive bool) {
   267  	js.Free(
   268  		p.ExcludeGlobs.Ref(),
   269  		p.ExcludeMatches.Ref(),
   270  		p.IncludeGlobs.Ref(),
   271  		p.Matches.Ref(),
   272  		p.Name.Ref(),
   273  	)
   274  	p.ExcludeGlobs = p.ExcludeGlobs.FromRef(js.Undefined)
   275  	p.ExcludeMatches = p.ExcludeMatches.FromRef(js.Undefined)
   276  	p.IncludeGlobs = p.IncludeGlobs.FromRef(js.Undefined)
   277  	p.Matches = p.Matches.FromRef(js.Undefined)
   278  	p.Name = p.Name.FromRef(js.Undefined)
   279  	if recursive {
   280  		p.Css.FreeMembers(true)
   281  		p.Js.FreeMembers(true)
   282  	}
   283  }
   284  
   285  type DataTypeSet struct {
   286  	// Appcache is "DataTypeSet.appcache"
   287  	//
   288  	// Optional
   289  	//
   290  	// NOTE: FFI_USE_Appcache MUST be set to true to make this field effective.
   291  	Appcache bool
   292  	// Cache is "DataTypeSet.cache"
   293  	//
   294  	// Optional
   295  	//
   296  	// NOTE: FFI_USE_Cache MUST be set to true to make this field effective.
   297  	Cache bool
   298  	// Cookies is "DataTypeSet.cookies"
   299  	//
   300  	// Optional
   301  	//
   302  	// NOTE: FFI_USE_Cookies MUST be set to true to make this field effective.
   303  	Cookies bool
   304  	// FileSystems is "DataTypeSet.fileSystems"
   305  	//
   306  	// Optional
   307  	//
   308  	// NOTE: FFI_USE_FileSystems MUST be set to true to make this field effective.
   309  	FileSystems bool
   310  	// IndexedDB is "DataTypeSet.indexedDB"
   311  	//
   312  	// Optional
   313  	//
   314  	// NOTE: FFI_USE_IndexedDB MUST be set to true to make this field effective.
   315  	IndexedDB bool
   316  	// LocalStorage is "DataTypeSet.localStorage"
   317  	//
   318  	// Optional
   319  	//
   320  	// NOTE: FFI_USE_LocalStorage MUST be set to true to make this field effective.
   321  	LocalStorage bool
   322  	// PersistentCookies is "DataTypeSet.persistentCookies"
   323  	//
   324  	// Optional
   325  	//
   326  	// NOTE: FFI_USE_PersistentCookies MUST be set to true to make this field effective.
   327  	PersistentCookies bool
   328  	// SessionCookies is "DataTypeSet.sessionCookies"
   329  	//
   330  	// Optional
   331  	//
   332  	// NOTE: FFI_USE_SessionCookies MUST be set to true to make this field effective.
   333  	SessionCookies bool
   334  	// WebSQL is "DataTypeSet.webSQL"
   335  	//
   336  	// Optional
   337  	//
   338  	// NOTE: FFI_USE_WebSQL MUST be set to true to make this field effective.
   339  	WebSQL bool
   340  
   341  	FFI_USE_Appcache          bool // for Appcache.
   342  	FFI_USE_Cache             bool // for Cache.
   343  	FFI_USE_Cookies           bool // for Cookies.
   344  	FFI_USE_FileSystems       bool // for FileSystems.
   345  	FFI_USE_IndexedDB         bool // for IndexedDB.
   346  	FFI_USE_LocalStorage      bool // for LocalStorage.
   347  	FFI_USE_PersistentCookies bool // for PersistentCookies.
   348  	FFI_USE_SessionCookies    bool // for SessionCookies.
   349  	FFI_USE_WebSQL            bool // for WebSQL.
   350  
   351  	FFI_USE bool
   352  }
   353  
   354  // FromRef calls UpdateFrom and returns a DataTypeSet with all fields set.
   355  func (p DataTypeSet) FromRef(ref js.Ref) DataTypeSet {
   356  	p.UpdateFrom(ref)
   357  	return p
   358  }
   359  
   360  // New creates a new DataTypeSet in the application heap.
   361  func (p DataTypeSet) New() js.Ref {
   362  	return bindings.DataTypeSetJSLoad(
   363  		js.Pointer(&p), js.True, 0,
   364  	)
   365  }
   366  
   367  // UpdateFrom copies value of all fields of the heap object to p.
   368  func (p *DataTypeSet) UpdateFrom(ref js.Ref) {
   369  	bindings.DataTypeSetJSStore(
   370  		js.Pointer(p), ref,
   371  	)
   372  }
   373  
   374  // Update writes all fields of the p to the heap object referenced by ref.
   375  func (p *DataTypeSet) Update(ref js.Ref) {
   376  	bindings.DataTypeSetJSLoad(
   377  		js.Pointer(p), js.False, ref,
   378  	)
   379  }
   380  
   381  // FreeMembers frees fields with heap reference, if recursive is true
   382  // free all heap references reachable from p.
   383  func (p *DataTypeSet) FreeMembers(recursive bool) {
   384  }
   385  
   386  type ExecuteScriptArgCallbackFunc func(this js.Ref, result js.Array[js.Any]) js.Ref
   387  
   388  func (fn ExecuteScriptArgCallbackFunc) Register() js.Func[func(result js.Array[js.Any])] {
   389  	return js.RegisterCallback[func(result js.Array[js.Any])](
   390  		fn, abi.FuncPCABIInternal(fn),
   391  	)
   392  }
   393  
   394  func (fn ExecuteScriptArgCallbackFunc) DispatchCallback(
   395  	targetPC uintptr, ctx *js.CallbackContext,
   396  ) {
   397  	args := ctx.Args()
   398  	if len(args) != 1+1 /* js this */ ||
   399  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
   400  		js.ThrowInvalidCallbackInvocation()
   401  	}
   402  
   403  	if ctx.Return(fn(
   404  		args[0],
   405  
   406  		js.Array[js.Any]{}.FromRef(args[0+1]),
   407  	)) {
   408  		return
   409  	}
   410  
   411  	js.ThrowCallbackValueNotReturned()
   412  }
   413  
   414  type ExecuteScriptArgCallback[T any] struct {
   415  	Fn  func(arg T, this js.Ref, result js.Array[js.Any]) js.Ref
   416  	Arg T
   417  }
   418  
   419  func (cb *ExecuteScriptArgCallback[T]) Register() js.Func[func(result js.Array[js.Any])] {
   420  	return js.RegisterCallback[func(result js.Array[js.Any])](
   421  		cb, abi.FuncPCABIInternal(cb.Fn),
   422  	)
   423  }
   424  
   425  func (cb *ExecuteScriptArgCallback[T]) DispatchCallback(
   426  	targetPC uintptr, ctx *js.CallbackContext,
   427  ) {
   428  	args := ctx.Args()
   429  	if len(args) != 1+1 /* js this */ ||
   430  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
   431  		js.ThrowInvalidCallbackInvocation()
   432  	}
   433  
   434  	if ctx.Return(cb.Fn(
   435  		cb.Arg,
   436  		args[0],
   437  
   438  		js.Array[js.Any]{}.FromRef(args[0+1]),
   439  	)) {
   440  		return
   441  	}
   442  
   443  	js.ThrowCallbackValueNotReturned()
   444  }
   445  
   446  type FindArgCallbackFunc func(this js.Ref, results *FindArgCallbackArgResults) js.Ref
   447  
   448  func (fn FindArgCallbackFunc) Register() js.Func[func(results *FindArgCallbackArgResults)] {
   449  	return js.RegisterCallback[func(results *FindArgCallbackArgResults)](
   450  		fn, abi.FuncPCABIInternal(fn),
   451  	)
   452  }
   453  
   454  func (fn FindArgCallbackFunc) DispatchCallback(
   455  	targetPC uintptr, ctx *js.CallbackContext,
   456  ) {
   457  	args := ctx.Args()
   458  	if len(args) != 1+1 /* js this */ ||
   459  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
   460  		js.ThrowInvalidCallbackInvocation()
   461  	}
   462  	var arg0 FindArgCallbackArgResults
   463  	arg0.UpdateFrom(args[0+1])
   464  	defer arg0.FreeMembers(true)
   465  
   466  	if ctx.Return(fn(
   467  		args[0],
   468  
   469  		mark.NoEscape(&arg0),
   470  	)) {
   471  		return
   472  	}
   473  
   474  	js.ThrowCallbackValueNotReturned()
   475  }
   476  
   477  type FindArgCallback[T any] struct {
   478  	Fn  func(arg T, this js.Ref, results *FindArgCallbackArgResults) js.Ref
   479  	Arg T
   480  }
   481  
   482  func (cb *FindArgCallback[T]) Register() js.Func[func(results *FindArgCallbackArgResults)] {
   483  	return js.RegisterCallback[func(results *FindArgCallbackArgResults)](
   484  		cb, abi.FuncPCABIInternal(cb.Fn),
   485  	)
   486  }
   487  
   488  func (cb *FindArgCallback[T]) DispatchCallback(
   489  	targetPC uintptr, ctx *js.CallbackContext,
   490  ) {
   491  	args := ctx.Args()
   492  	if len(args) != 1+1 /* js this */ ||
   493  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
   494  		js.ThrowInvalidCallbackInvocation()
   495  	}
   496  	var arg0 FindArgCallbackArgResults
   497  	arg0.UpdateFrom(args[0+1])
   498  	defer arg0.FreeMembers(true)
   499  
   500  	if ctx.Return(cb.Fn(
   501  		cb.Arg,
   502  		args[0],
   503  
   504  		mark.NoEscape(&arg0),
   505  	)) {
   506  		return
   507  	}
   508  
   509  	js.ThrowCallbackValueNotReturned()
   510  }
   511  
   512  type FindArgCallbackArgResultsFieldSelectionRect struct {
   513  	// Height is "FindArgCallbackArgResultsFieldSelectionRect.height"
   514  	//
   515  	// Required
   516  	Height int64
   517  	// Left is "FindArgCallbackArgResultsFieldSelectionRect.left"
   518  	//
   519  	// Required
   520  	Left int64
   521  	// Top is "FindArgCallbackArgResultsFieldSelectionRect.top"
   522  	//
   523  	// Required
   524  	Top int64
   525  	// Width is "FindArgCallbackArgResultsFieldSelectionRect.width"
   526  	//
   527  	// Required
   528  	Width int64
   529  
   530  	FFI_USE bool
   531  }
   532  
   533  // FromRef calls UpdateFrom and returns a FindArgCallbackArgResultsFieldSelectionRect with all fields set.
   534  func (p FindArgCallbackArgResultsFieldSelectionRect) FromRef(ref js.Ref) FindArgCallbackArgResultsFieldSelectionRect {
   535  	p.UpdateFrom(ref)
   536  	return p
   537  }
   538  
   539  // New creates a new FindArgCallbackArgResultsFieldSelectionRect in the application heap.
   540  func (p FindArgCallbackArgResultsFieldSelectionRect) New() js.Ref {
   541  	return bindings.FindArgCallbackArgResultsFieldSelectionRectJSLoad(
   542  		js.Pointer(&p), js.True, 0,
   543  	)
   544  }
   545  
   546  // UpdateFrom copies value of all fields of the heap object to p.
   547  func (p *FindArgCallbackArgResultsFieldSelectionRect) UpdateFrom(ref js.Ref) {
   548  	bindings.FindArgCallbackArgResultsFieldSelectionRectJSStore(
   549  		js.Pointer(p), ref,
   550  	)
   551  }
   552  
   553  // Update writes all fields of the p to the heap object referenced by ref.
   554  func (p *FindArgCallbackArgResultsFieldSelectionRect) Update(ref js.Ref) {
   555  	bindings.FindArgCallbackArgResultsFieldSelectionRectJSLoad(
   556  		js.Pointer(p), js.False, ref,
   557  	)
   558  }
   559  
   560  // FreeMembers frees fields with heap reference, if recursive is true
   561  // free all heap references reachable from p.
   562  func (p *FindArgCallbackArgResultsFieldSelectionRect) FreeMembers(recursive bool) {
   563  }
   564  
   565  type FindArgCallbackArgResults struct {
   566  	// ActiveMatchOrdinal is "FindArgCallbackArgResults.activeMatchOrdinal"
   567  	//
   568  	// Required
   569  	ActiveMatchOrdinal int64
   570  	// Canceled is "FindArgCallbackArgResults.canceled"
   571  	//
   572  	// Required
   573  	Canceled bool
   574  	// NumberOfMatches is "FindArgCallbackArgResults.numberOfMatches"
   575  	//
   576  	// Required
   577  	NumberOfMatches int64
   578  	// SelectionRect is "FindArgCallbackArgResults.selectionRect"
   579  	//
   580  	// Required
   581  	//
   582  	// NOTE: SelectionRect.FFI_USE MUST be set to true to get SelectionRect used.
   583  	SelectionRect FindArgCallbackArgResultsFieldSelectionRect
   584  
   585  	FFI_USE bool
   586  }
   587  
   588  // FromRef calls UpdateFrom and returns a FindArgCallbackArgResults with all fields set.
   589  func (p FindArgCallbackArgResults) FromRef(ref js.Ref) FindArgCallbackArgResults {
   590  	p.UpdateFrom(ref)
   591  	return p
   592  }
   593  
   594  // New creates a new FindArgCallbackArgResults in the application heap.
   595  func (p FindArgCallbackArgResults) New() js.Ref {
   596  	return bindings.FindArgCallbackArgResultsJSLoad(
   597  		js.Pointer(&p), js.True, 0,
   598  	)
   599  }
   600  
   601  // UpdateFrom copies value of all fields of the heap object to p.
   602  func (p *FindArgCallbackArgResults) UpdateFrom(ref js.Ref) {
   603  	bindings.FindArgCallbackArgResultsJSStore(
   604  		js.Pointer(p), ref,
   605  	)
   606  }
   607  
   608  // Update writes all fields of the p to the heap object referenced by ref.
   609  func (p *FindArgCallbackArgResults) Update(ref js.Ref) {
   610  	bindings.FindArgCallbackArgResultsJSLoad(
   611  		js.Pointer(p), js.False, ref,
   612  	)
   613  }
   614  
   615  // FreeMembers frees fields with heap reference, if recursive is true
   616  // free all heap references reachable from p.
   617  func (p *FindArgCallbackArgResults) FreeMembers(recursive bool) {
   618  	if recursive {
   619  		p.SelectionRect.FreeMembers(true)
   620  	}
   621  }
   622  
   623  type FindArgOptions struct {
   624  	// Backward is "FindArgOptions.backward"
   625  	//
   626  	// Optional
   627  	//
   628  	// NOTE: FFI_USE_Backward MUST be set to true to make this field effective.
   629  	Backward bool
   630  	// MatchCase is "FindArgOptions.matchCase"
   631  	//
   632  	// Optional
   633  	//
   634  	// NOTE: FFI_USE_MatchCase MUST be set to true to make this field effective.
   635  	MatchCase bool
   636  
   637  	FFI_USE_Backward  bool // for Backward.
   638  	FFI_USE_MatchCase bool // for MatchCase.
   639  
   640  	FFI_USE bool
   641  }
   642  
   643  // FromRef calls UpdateFrom and returns a FindArgOptions with all fields set.
   644  func (p FindArgOptions) FromRef(ref js.Ref) FindArgOptions {
   645  	p.UpdateFrom(ref)
   646  	return p
   647  }
   648  
   649  // New creates a new FindArgOptions in the application heap.
   650  func (p FindArgOptions) New() js.Ref {
   651  	return bindings.FindArgOptionsJSLoad(
   652  		js.Pointer(&p), js.True, 0,
   653  	)
   654  }
   655  
   656  // UpdateFrom copies value of all fields of the heap object to p.
   657  func (p *FindArgOptions) UpdateFrom(ref js.Ref) {
   658  	bindings.FindArgOptionsJSStore(
   659  		js.Pointer(p), ref,
   660  	)
   661  }
   662  
   663  // Update writes all fields of the p to the heap object referenced by ref.
   664  func (p *FindArgOptions) Update(ref js.Ref) {
   665  	bindings.FindArgOptionsJSLoad(
   666  		js.Pointer(p), js.False, ref,
   667  	)
   668  }
   669  
   670  // FreeMembers frees fields with heap reference, if recursive is true
   671  // free all heap references reachable from p.
   672  func (p *FindArgOptions) FreeMembers(recursive bool) {
   673  }
   674  
   675  type GetAudioStateArgCallbackFunc func(this js.Ref, audible bool) js.Ref
   676  
   677  func (fn GetAudioStateArgCallbackFunc) Register() js.Func[func(audible bool)] {
   678  	return js.RegisterCallback[func(audible bool)](
   679  		fn, abi.FuncPCABIInternal(fn),
   680  	)
   681  }
   682  
   683  func (fn GetAudioStateArgCallbackFunc) DispatchCallback(
   684  	targetPC uintptr, ctx *js.CallbackContext,
   685  ) {
   686  	args := ctx.Args()
   687  	if len(args) != 1+1 /* js this */ ||
   688  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
   689  		js.ThrowInvalidCallbackInvocation()
   690  	}
   691  
   692  	if ctx.Return(fn(
   693  		args[0],
   694  
   695  		args[0+1] == js.True,
   696  	)) {
   697  		return
   698  	}
   699  
   700  	js.ThrowCallbackValueNotReturned()
   701  }
   702  
   703  type GetAudioStateArgCallback[T any] struct {
   704  	Fn  func(arg T, this js.Ref, audible bool) js.Ref
   705  	Arg T
   706  }
   707  
   708  func (cb *GetAudioStateArgCallback[T]) Register() js.Func[func(audible bool)] {
   709  	return js.RegisterCallback[func(audible bool)](
   710  		cb, abi.FuncPCABIInternal(cb.Fn),
   711  	)
   712  }
   713  
   714  func (cb *GetAudioStateArgCallback[T]) DispatchCallback(
   715  	targetPC uintptr, ctx *js.CallbackContext,
   716  ) {
   717  	args := ctx.Args()
   718  	if len(args) != 1+1 /* js this */ ||
   719  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
   720  		js.ThrowInvalidCallbackInvocation()
   721  	}
   722  
   723  	if ctx.Return(cb.Fn(
   724  		cb.Arg,
   725  		args[0],
   726  
   727  		args[0+1] == js.True,
   728  	)) {
   729  		return
   730  	}
   731  
   732  	js.ThrowCallbackValueNotReturned()
   733  }
   734  
   735  type GetZoomArgCallbackFunc func(this js.Ref, zoomFactor float64) js.Ref
   736  
   737  func (fn GetZoomArgCallbackFunc) Register() js.Func[func(zoomFactor float64)] {
   738  	return js.RegisterCallback[func(zoomFactor float64)](
   739  		fn, abi.FuncPCABIInternal(fn),
   740  	)
   741  }
   742  
   743  func (fn GetZoomArgCallbackFunc) DispatchCallback(
   744  	targetPC uintptr, ctx *js.CallbackContext,
   745  ) {
   746  	args := ctx.Args()
   747  	if len(args) != 1+1 /* js this */ ||
   748  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
   749  		js.ThrowInvalidCallbackInvocation()
   750  	}
   751  
   752  	if ctx.Return(fn(
   753  		args[0],
   754  
   755  		js.Number[float64]{}.FromRef(args[0+1]).Get(),
   756  	)) {
   757  		return
   758  	}
   759  
   760  	js.ThrowCallbackValueNotReturned()
   761  }
   762  
   763  type GetZoomArgCallback[T any] struct {
   764  	Fn  func(arg T, this js.Ref, zoomFactor float64) js.Ref
   765  	Arg T
   766  }
   767  
   768  func (cb *GetZoomArgCallback[T]) Register() js.Func[func(zoomFactor float64)] {
   769  	return js.RegisterCallback[func(zoomFactor float64)](
   770  		cb, abi.FuncPCABIInternal(cb.Fn),
   771  	)
   772  }
   773  
   774  func (cb *GetZoomArgCallback[T]) DispatchCallback(
   775  	targetPC uintptr, ctx *js.CallbackContext,
   776  ) {
   777  	args := ctx.Args()
   778  	if len(args) != 1+1 /* js this */ ||
   779  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
   780  		js.ThrowInvalidCallbackInvocation()
   781  	}
   782  
   783  	if ctx.Return(cb.Fn(
   784  		cb.Arg,
   785  		args[0],
   786  
   787  		js.Number[float64]{}.FromRef(args[0+1]).Get(),
   788  	)) {
   789  		return
   790  	}
   791  
   792  	js.ThrowCallbackValueNotReturned()
   793  }
   794  
   795  type GetZoomModeArgCallbackFunc func(this js.Ref, ZoomMode ZoomMode) js.Ref
   796  
   797  func (fn GetZoomModeArgCallbackFunc) Register() js.Func[func(ZoomMode ZoomMode)] {
   798  	return js.RegisterCallback[func(ZoomMode ZoomMode)](
   799  		fn, abi.FuncPCABIInternal(fn),
   800  	)
   801  }
   802  
   803  func (fn GetZoomModeArgCallbackFunc) DispatchCallback(
   804  	targetPC uintptr, ctx *js.CallbackContext,
   805  ) {
   806  	args := ctx.Args()
   807  	if len(args) != 1+1 /* js this */ ||
   808  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
   809  		js.ThrowInvalidCallbackInvocation()
   810  	}
   811  
   812  	if ctx.Return(fn(
   813  		args[0],
   814  
   815  		ZoomMode(0).FromRef(args[0+1]),
   816  	)) {
   817  		return
   818  	}
   819  
   820  	js.ThrowCallbackValueNotReturned()
   821  }
   822  
   823  type GetZoomModeArgCallback[T any] struct {
   824  	Fn  func(arg T, this js.Ref, ZoomMode ZoomMode) js.Ref
   825  	Arg T
   826  }
   827  
   828  func (cb *GetZoomModeArgCallback[T]) Register() js.Func[func(ZoomMode ZoomMode)] {
   829  	return js.RegisterCallback[func(ZoomMode ZoomMode)](
   830  		cb, abi.FuncPCABIInternal(cb.Fn),
   831  	)
   832  }
   833  
   834  func (cb *GetZoomModeArgCallback[T]) DispatchCallback(
   835  	targetPC uintptr, ctx *js.CallbackContext,
   836  ) {
   837  	args := ctx.Args()
   838  	if len(args) != 1+1 /* js this */ ||
   839  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
   840  		js.ThrowInvalidCallbackInvocation()
   841  	}
   842  
   843  	if ctx.Return(cb.Fn(
   844  		cb.Arg,
   845  		args[0],
   846  
   847  		ZoomMode(0).FromRef(args[0+1]),
   848  	)) {
   849  		return
   850  	}
   851  
   852  	js.ThrowCallbackValueNotReturned()
   853  }
   854  
   855  type ZoomMode uint32
   856  
   857  const (
   858  	_ ZoomMode = iota
   859  
   860  	ZoomMode_PER_ORIGIN
   861  	ZoomMode_PER_VIEW
   862  	ZoomMode_DISABLED
   863  )
   864  
   865  func (ZoomMode) FromRef(str js.Ref) ZoomMode {
   866  	return ZoomMode(bindings.ConstOfZoomMode(str))
   867  }
   868  
   869  func (x ZoomMode) String() (string, bool) {
   870  	switch x {
   871  	case ZoomMode_PER_ORIGIN:
   872  		return "per-origin", true
   873  	case ZoomMode_PER_VIEW:
   874  		return "per-view", true
   875  	case ZoomMode_DISABLED:
   876  		return "disabled", true
   877  	default:
   878  		return "", false
   879  	}
   880  }
   881  
   882  type GoArgCallbackFunc func(this js.Ref, success bool) js.Ref
   883  
   884  func (fn GoArgCallbackFunc) Register() js.Func[func(success bool)] {
   885  	return js.RegisterCallback[func(success bool)](
   886  		fn, abi.FuncPCABIInternal(fn),
   887  	)
   888  }
   889  
   890  func (fn GoArgCallbackFunc) DispatchCallback(
   891  	targetPC uintptr, ctx *js.CallbackContext,
   892  ) {
   893  	args := ctx.Args()
   894  	if len(args) != 1+1 /* js this */ ||
   895  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
   896  		js.ThrowInvalidCallbackInvocation()
   897  	}
   898  
   899  	if ctx.Return(fn(
   900  		args[0],
   901  
   902  		args[0+1] == js.True,
   903  	)) {
   904  		return
   905  	}
   906  
   907  	js.ThrowCallbackValueNotReturned()
   908  }
   909  
   910  type GoArgCallback[T any] struct {
   911  	Fn  func(arg T, this js.Ref, success bool) js.Ref
   912  	Arg T
   913  }
   914  
   915  func (cb *GoArgCallback[T]) Register() js.Func[func(success bool)] {
   916  	return js.RegisterCallback[func(success bool)](
   917  		cb, abi.FuncPCABIInternal(cb.Fn),
   918  	)
   919  }
   920  
   921  func (cb *GoArgCallback[T]) DispatchCallback(
   922  	targetPC uintptr, ctx *js.CallbackContext,
   923  ) {
   924  	args := ctx.Args()
   925  	if len(args) != 1+1 /* js this */ ||
   926  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
   927  		js.ThrowInvalidCallbackInvocation()
   928  	}
   929  
   930  	if ctx.Return(cb.Fn(
   931  		cb.Arg,
   932  		args[0],
   933  
   934  		args[0+1] == js.True,
   935  	)) {
   936  		return
   937  	}
   938  
   939  	js.ThrowCallbackValueNotReturned()
   940  }
   941  
   942  type InsertCSSArgCallbackFunc func(this js.Ref) js.Ref
   943  
   944  func (fn InsertCSSArgCallbackFunc) Register() js.Func[func()] {
   945  	return js.RegisterCallback[func()](
   946  		fn, abi.FuncPCABIInternal(fn),
   947  	)
   948  }
   949  
   950  func (fn InsertCSSArgCallbackFunc) DispatchCallback(
   951  	targetPC uintptr, ctx *js.CallbackContext,
   952  ) {
   953  	args := ctx.Args()
   954  	if len(args) != 0+1 /* js this */ ||
   955  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
   956  		js.ThrowInvalidCallbackInvocation()
   957  	}
   958  
   959  	if ctx.Return(fn(
   960  		args[0],
   961  	)) {
   962  		return
   963  	}
   964  
   965  	js.ThrowCallbackValueNotReturned()
   966  }
   967  
   968  type InsertCSSArgCallback[T any] struct {
   969  	Fn  func(arg T, this js.Ref) js.Ref
   970  	Arg T
   971  }
   972  
   973  func (cb *InsertCSSArgCallback[T]) Register() js.Func[func()] {
   974  	return js.RegisterCallback[func()](
   975  		cb, abi.FuncPCABIInternal(cb.Fn),
   976  	)
   977  }
   978  
   979  func (cb *InsertCSSArgCallback[T]) DispatchCallback(
   980  	targetPC uintptr, ctx *js.CallbackContext,
   981  ) {
   982  	args := ctx.Args()
   983  	if len(args) != 0+1 /* js this */ ||
   984  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
   985  		js.ThrowInvalidCallbackInvocation()
   986  	}
   987  
   988  	if ctx.Return(cb.Fn(
   989  		cb.Arg,
   990  		args[0],
   991  	)) {
   992  		return
   993  	}
   994  
   995  	js.ThrowCallbackValueNotReturned()
   996  }
   997  
   998  type IsAudioMutedArgCallbackFunc func(this js.Ref, muted bool) js.Ref
   999  
  1000  func (fn IsAudioMutedArgCallbackFunc) Register() js.Func[func(muted bool)] {
  1001  	return js.RegisterCallback[func(muted bool)](
  1002  		fn, abi.FuncPCABIInternal(fn),
  1003  	)
  1004  }
  1005  
  1006  func (fn IsAudioMutedArgCallbackFunc) DispatchCallback(
  1007  	targetPC uintptr, ctx *js.CallbackContext,
  1008  ) {
  1009  	args := ctx.Args()
  1010  	if len(args) != 1+1 /* js this */ ||
  1011  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  1012  		js.ThrowInvalidCallbackInvocation()
  1013  	}
  1014  
  1015  	if ctx.Return(fn(
  1016  		args[0],
  1017  
  1018  		args[0+1] == js.True,
  1019  	)) {
  1020  		return
  1021  	}
  1022  
  1023  	js.ThrowCallbackValueNotReturned()
  1024  }
  1025  
  1026  type IsAudioMutedArgCallback[T any] struct {
  1027  	Fn  func(arg T, this js.Ref, muted bool) js.Ref
  1028  	Arg T
  1029  }
  1030  
  1031  func (cb *IsAudioMutedArgCallback[T]) Register() js.Func[func(muted bool)] {
  1032  	return js.RegisterCallback[func(muted bool)](
  1033  		cb, abi.FuncPCABIInternal(cb.Fn),
  1034  	)
  1035  }
  1036  
  1037  func (cb *IsAudioMutedArgCallback[T]) DispatchCallback(
  1038  	targetPC uintptr, ctx *js.CallbackContext,
  1039  ) {
  1040  	args := ctx.Args()
  1041  	if len(args) != 1+1 /* js this */ ||
  1042  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  1043  		js.ThrowInvalidCallbackInvocation()
  1044  	}
  1045  
  1046  	if ctx.Return(cb.Fn(
  1047  		cb.Arg,
  1048  		args[0],
  1049  
  1050  		args[0+1] == js.True,
  1051  	)) {
  1052  		return
  1053  	}
  1054  
  1055  	js.ThrowCallbackValueNotReturned()
  1056  }
  1057  
  1058  type IsSpatialNavigationEnabledArgCallbackFunc func(this js.Ref, spatialNavEnabled bool) js.Ref
  1059  
  1060  func (fn IsSpatialNavigationEnabledArgCallbackFunc) Register() js.Func[func(spatialNavEnabled bool)] {
  1061  	return js.RegisterCallback[func(spatialNavEnabled bool)](
  1062  		fn, abi.FuncPCABIInternal(fn),
  1063  	)
  1064  }
  1065  
  1066  func (fn IsSpatialNavigationEnabledArgCallbackFunc) DispatchCallback(
  1067  	targetPC uintptr, ctx *js.CallbackContext,
  1068  ) {
  1069  	args := ctx.Args()
  1070  	if len(args) != 1+1 /* js this */ ||
  1071  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  1072  		js.ThrowInvalidCallbackInvocation()
  1073  	}
  1074  
  1075  	if ctx.Return(fn(
  1076  		args[0],
  1077  
  1078  		args[0+1] == js.True,
  1079  	)) {
  1080  		return
  1081  	}
  1082  
  1083  	js.ThrowCallbackValueNotReturned()
  1084  }
  1085  
  1086  type IsSpatialNavigationEnabledArgCallback[T any] struct {
  1087  	Fn  func(arg T, this js.Ref, spatialNavEnabled bool) js.Ref
  1088  	Arg T
  1089  }
  1090  
  1091  func (cb *IsSpatialNavigationEnabledArgCallback[T]) Register() js.Func[func(spatialNavEnabled bool)] {
  1092  	return js.RegisterCallback[func(spatialNavEnabled bool)](
  1093  		cb, abi.FuncPCABIInternal(cb.Fn),
  1094  	)
  1095  }
  1096  
  1097  func (cb *IsSpatialNavigationEnabledArgCallback[T]) DispatchCallback(
  1098  	targetPC uintptr, ctx *js.CallbackContext,
  1099  ) {
  1100  	args := ctx.Args()
  1101  	if len(args) != 1+1 /* js this */ ||
  1102  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  1103  		js.ThrowInvalidCallbackInvocation()
  1104  	}
  1105  
  1106  	if ctx.Return(cb.Fn(
  1107  		cb.Arg,
  1108  		args[0],
  1109  
  1110  		args[0+1] == js.True,
  1111  	)) {
  1112  		return
  1113  	}
  1114  
  1115  	js.ThrowCallbackValueNotReturned()
  1116  }
  1117  
  1118  type LoadDataWithBaseUrlArgCallbackFunc func(this js.Ref) js.Ref
  1119  
  1120  func (fn LoadDataWithBaseUrlArgCallbackFunc) Register() js.Func[func()] {
  1121  	return js.RegisterCallback[func()](
  1122  		fn, abi.FuncPCABIInternal(fn),
  1123  	)
  1124  }
  1125  
  1126  func (fn LoadDataWithBaseUrlArgCallbackFunc) DispatchCallback(
  1127  	targetPC uintptr, ctx *js.CallbackContext,
  1128  ) {
  1129  	args := ctx.Args()
  1130  	if len(args) != 0+1 /* js this */ ||
  1131  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  1132  		js.ThrowInvalidCallbackInvocation()
  1133  	}
  1134  
  1135  	if ctx.Return(fn(
  1136  		args[0],
  1137  	)) {
  1138  		return
  1139  	}
  1140  
  1141  	js.ThrowCallbackValueNotReturned()
  1142  }
  1143  
  1144  type LoadDataWithBaseUrlArgCallback[T any] struct {
  1145  	Fn  func(arg T, this js.Ref) js.Ref
  1146  	Arg T
  1147  }
  1148  
  1149  func (cb *LoadDataWithBaseUrlArgCallback[T]) Register() js.Func[func()] {
  1150  	return js.RegisterCallback[func()](
  1151  		cb, abi.FuncPCABIInternal(cb.Fn),
  1152  	)
  1153  }
  1154  
  1155  func (cb *LoadDataWithBaseUrlArgCallback[T]) DispatchCallback(
  1156  	targetPC uintptr, ctx *js.CallbackContext,
  1157  ) {
  1158  	args := ctx.Args()
  1159  	if len(args) != 0+1 /* js this */ ||
  1160  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  1161  		js.ThrowInvalidCallbackInvocation()
  1162  	}
  1163  
  1164  	if ctx.Return(cb.Fn(
  1165  		cb.Arg,
  1166  		args[0],
  1167  	)) {
  1168  		return
  1169  	}
  1170  
  1171  	js.ThrowCallbackValueNotReturned()
  1172  }
  1173  
  1174  // MAX_CAPTURE_VISIBLE_REGION_CALLS_PER_SECOND returns the value of property "WEBEXT.webViewInternal.MAX_CAPTURE_VISIBLE_REGION_CALLS_PER_SECOND".
  1175  //
  1176  // The returned bool will be false if there is no such property.
  1177  func MAX_CAPTURE_VISIBLE_REGION_CALLS_PER_SECOND() (ret js.String, ok bool) {
  1178  	ok = js.True == bindings.GetMAX_CAPTURE_VISIBLE_REGION_CALLS_PER_SECOND(
  1179  		js.Pointer(&ret),
  1180  	)
  1181  
  1182  	return
  1183  }
  1184  
  1185  // SetMAX_CAPTURE_VISIBLE_REGION_CALLS_PER_SECOND sets the value of property "WEBEXT.webViewInternal.MAX_CAPTURE_VISIBLE_REGION_CALLS_PER_SECOND" to val.
  1186  //
  1187  // It returns false if the property cannot be set.
  1188  func SetMAX_CAPTURE_VISIBLE_REGION_CALLS_PER_SECOND(val js.String) bool {
  1189  	return js.True == bindings.SetMAX_CAPTURE_VISIBLE_REGION_CALLS_PER_SECOND(
  1190  		val.Ref())
  1191  }
  1192  
  1193  type RemovalOptions struct {
  1194  	// Since is "RemovalOptions.since"
  1195  	//
  1196  	// Optional
  1197  	//
  1198  	// NOTE: FFI_USE_Since MUST be set to true to make this field effective.
  1199  	Since float64
  1200  
  1201  	FFI_USE_Since bool // for Since.
  1202  
  1203  	FFI_USE bool
  1204  }
  1205  
  1206  // FromRef calls UpdateFrom and returns a RemovalOptions with all fields set.
  1207  func (p RemovalOptions) FromRef(ref js.Ref) RemovalOptions {
  1208  	p.UpdateFrom(ref)
  1209  	return p
  1210  }
  1211  
  1212  // New creates a new RemovalOptions in the application heap.
  1213  func (p RemovalOptions) New() js.Ref {
  1214  	return bindings.RemovalOptionsJSLoad(
  1215  		js.Pointer(&p), js.True, 0,
  1216  	)
  1217  }
  1218  
  1219  // UpdateFrom copies value of all fields of the heap object to p.
  1220  func (p *RemovalOptions) UpdateFrom(ref js.Ref) {
  1221  	bindings.RemovalOptionsJSStore(
  1222  		js.Pointer(p), ref,
  1223  	)
  1224  }
  1225  
  1226  // Update writes all fields of the p to the heap object referenced by ref.
  1227  func (p *RemovalOptions) Update(ref js.Ref) {
  1228  	bindings.RemovalOptionsJSLoad(
  1229  		js.Pointer(p), js.False, ref,
  1230  	)
  1231  }
  1232  
  1233  // FreeMembers frees fields with heap reference, if recursive is true
  1234  // free all heap references reachable from p.
  1235  func (p *RemovalOptions) FreeMembers(recursive bool) {
  1236  }
  1237  
  1238  type SetPermissionAction uint32
  1239  
  1240  const (
  1241  	_ SetPermissionAction = iota
  1242  
  1243  	SetPermissionAction_ALLOW
  1244  	SetPermissionAction_DENY
  1245  	SetPermissionAction_DEFAULT
  1246  )
  1247  
  1248  func (SetPermissionAction) FromRef(str js.Ref) SetPermissionAction {
  1249  	return SetPermissionAction(bindings.ConstOfSetPermissionAction(str))
  1250  }
  1251  
  1252  func (x SetPermissionAction) String() (string, bool) {
  1253  	switch x {
  1254  	case SetPermissionAction_ALLOW:
  1255  		return "allow", true
  1256  	case SetPermissionAction_DENY:
  1257  		return "deny", true
  1258  	case SetPermissionAction_DEFAULT:
  1259  		return "default", true
  1260  	default:
  1261  		return "", false
  1262  	}
  1263  }
  1264  
  1265  type SetPermissionArgCallbackFunc func(this js.Ref, allowed bool) js.Ref
  1266  
  1267  func (fn SetPermissionArgCallbackFunc) Register() js.Func[func(allowed bool)] {
  1268  	return js.RegisterCallback[func(allowed bool)](
  1269  		fn, abi.FuncPCABIInternal(fn),
  1270  	)
  1271  }
  1272  
  1273  func (fn SetPermissionArgCallbackFunc) DispatchCallback(
  1274  	targetPC uintptr, ctx *js.CallbackContext,
  1275  ) {
  1276  	args := ctx.Args()
  1277  	if len(args) != 1+1 /* js this */ ||
  1278  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  1279  		js.ThrowInvalidCallbackInvocation()
  1280  	}
  1281  
  1282  	if ctx.Return(fn(
  1283  		args[0],
  1284  
  1285  		args[0+1] == js.True,
  1286  	)) {
  1287  		return
  1288  	}
  1289  
  1290  	js.ThrowCallbackValueNotReturned()
  1291  }
  1292  
  1293  type SetPermissionArgCallback[T any] struct {
  1294  	Fn  func(arg T, this js.Ref, allowed bool) js.Ref
  1295  	Arg T
  1296  }
  1297  
  1298  func (cb *SetPermissionArgCallback[T]) Register() js.Func[func(allowed bool)] {
  1299  	return js.RegisterCallback[func(allowed bool)](
  1300  		cb, abi.FuncPCABIInternal(cb.Fn),
  1301  	)
  1302  }
  1303  
  1304  func (cb *SetPermissionArgCallback[T]) DispatchCallback(
  1305  	targetPC uintptr, ctx *js.CallbackContext,
  1306  ) {
  1307  	args := ctx.Args()
  1308  	if len(args) != 1+1 /* js this */ ||
  1309  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  1310  		js.ThrowInvalidCallbackInvocation()
  1311  	}
  1312  
  1313  	if ctx.Return(cb.Fn(
  1314  		cb.Arg,
  1315  		args[0],
  1316  
  1317  		args[0+1] == js.True,
  1318  	)) {
  1319  		return
  1320  	}
  1321  
  1322  	js.ThrowCallbackValueNotReturned()
  1323  }
  1324  
  1325  type SetZoomArgCallbackFunc func(this js.Ref) js.Ref
  1326  
  1327  func (fn SetZoomArgCallbackFunc) Register() js.Func[func()] {
  1328  	return js.RegisterCallback[func()](
  1329  		fn, abi.FuncPCABIInternal(fn),
  1330  	)
  1331  }
  1332  
  1333  func (fn SetZoomArgCallbackFunc) DispatchCallback(
  1334  	targetPC uintptr, ctx *js.CallbackContext,
  1335  ) {
  1336  	args := ctx.Args()
  1337  	if len(args) != 0+1 /* js this */ ||
  1338  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  1339  		js.ThrowInvalidCallbackInvocation()
  1340  	}
  1341  
  1342  	if ctx.Return(fn(
  1343  		args[0],
  1344  	)) {
  1345  		return
  1346  	}
  1347  
  1348  	js.ThrowCallbackValueNotReturned()
  1349  }
  1350  
  1351  type SetZoomArgCallback[T any] struct {
  1352  	Fn  func(arg T, this js.Ref) js.Ref
  1353  	Arg T
  1354  }
  1355  
  1356  func (cb *SetZoomArgCallback[T]) Register() js.Func[func()] {
  1357  	return js.RegisterCallback[func()](
  1358  		cb, abi.FuncPCABIInternal(cb.Fn),
  1359  	)
  1360  }
  1361  
  1362  func (cb *SetZoomArgCallback[T]) DispatchCallback(
  1363  	targetPC uintptr, ctx *js.CallbackContext,
  1364  ) {
  1365  	args := ctx.Args()
  1366  	if len(args) != 0+1 /* js this */ ||
  1367  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  1368  		js.ThrowInvalidCallbackInvocation()
  1369  	}
  1370  
  1371  	if ctx.Return(cb.Fn(
  1372  		cb.Arg,
  1373  		args[0],
  1374  	)) {
  1375  		return
  1376  	}
  1377  
  1378  	js.ThrowCallbackValueNotReturned()
  1379  }
  1380  
  1381  type SetZoomModeArgCallbackFunc func(this js.Ref) js.Ref
  1382  
  1383  func (fn SetZoomModeArgCallbackFunc) Register() js.Func[func()] {
  1384  	return js.RegisterCallback[func()](
  1385  		fn, abi.FuncPCABIInternal(fn),
  1386  	)
  1387  }
  1388  
  1389  func (fn SetZoomModeArgCallbackFunc) DispatchCallback(
  1390  	targetPC uintptr, ctx *js.CallbackContext,
  1391  ) {
  1392  	args := ctx.Args()
  1393  	if len(args) != 0+1 /* js this */ ||
  1394  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  1395  		js.ThrowInvalidCallbackInvocation()
  1396  	}
  1397  
  1398  	if ctx.Return(fn(
  1399  		args[0],
  1400  	)) {
  1401  		return
  1402  	}
  1403  
  1404  	js.ThrowCallbackValueNotReturned()
  1405  }
  1406  
  1407  type SetZoomModeArgCallback[T any] struct {
  1408  	Fn  func(arg T, this js.Ref) js.Ref
  1409  	Arg T
  1410  }
  1411  
  1412  func (cb *SetZoomModeArgCallback[T]) Register() js.Func[func()] {
  1413  	return js.RegisterCallback[func()](
  1414  		cb, abi.FuncPCABIInternal(cb.Fn),
  1415  	)
  1416  }
  1417  
  1418  func (cb *SetZoomModeArgCallback[T]) DispatchCallback(
  1419  	targetPC uintptr, ctx *js.CallbackContext,
  1420  ) {
  1421  	args := ctx.Args()
  1422  	if len(args) != 0+1 /* js this */ ||
  1423  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  1424  		js.ThrowInvalidCallbackInvocation()
  1425  	}
  1426  
  1427  	if ctx.Return(cb.Fn(
  1428  		cb.Arg,
  1429  		args[0],
  1430  	)) {
  1431  		return
  1432  	}
  1433  
  1434  	js.ThrowCallbackValueNotReturned()
  1435  }
  1436  
  1437  type StopFindingAction uint32
  1438  
  1439  const (
  1440  	_ StopFindingAction = iota
  1441  
  1442  	StopFindingAction_CLEAR
  1443  	StopFindingAction_KEEP
  1444  	StopFindingAction_ACTIVATE
  1445  )
  1446  
  1447  func (StopFindingAction) FromRef(str js.Ref) StopFindingAction {
  1448  	return StopFindingAction(bindings.ConstOfStopFindingAction(str))
  1449  }
  1450  
  1451  func (x StopFindingAction) String() (string, bool) {
  1452  	switch x {
  1453  	case StopFindingAction_CLEAR:
  1454  		return "clear", true
  1455  	case StopFindingAction_KEEP:
  1456  		return "keep", true
  1457  	case StopFindingAction_ACTIVATE:
  1458  		return "activate", true
  1459  	default:
  1460  		return "", false
  1461  	}
  1462  }
  1463  
  1464  // HasFuncAddContentScripts returns true if the function "WEBEXT.webViewInternal.addContentScripts" exists.
  1465  func HasFuncAddContentScripts() bool {
  1466  	return js.True == bindings.HasFuncAddContentScripts()
  1467  }
  1468  
  1469  // FuncAddContentScripts returns the function "WEBEXT.webViewInternal.addContentScripts".
  1470  func FuncAddContentScripts() (fn js.Func[func(instanceId int64, contentScriptList js.Array[ContentScriptDetails])]) {
  1471  	bindings.FuncAddContentScripts(
  1472  		js.Pointer(&fn),
  1473  	)
  1474  	return
  1475  }
  1476  
  1477  // AddContentScripts calls the function "WEBEXT.webViewInternal.addContentScripts" directly.
  1478  func AddContentScripts(instanceId int64, contentScriptList js.Array[ContentScriptDetails]) (ret js.Void) {
  1479  	bindings.CallAddContentScripts(
  1480  		js.Pointer(&ret),
  1481  		float64(instanceId),
  1482  		contentScriptList.Ref(),
  1483  	)
  1484  
  1485  	return
  1486  }
  1487  
  1488  // TryAddContentScripts calls the function "WEBEXT.webViewInternal.addContentScripts"
  1489  // in a try/catch block and returns (_, err, ok = false) when it went through
  1490  // the catch clause.
  1491  func TryAddContentScripts(instanceId int64, contentScriptList js.Array[ContentScriptDetails]) (ret js.Void, exception js.Any, ok bool) {
  1492  	ok = js.True == bindings.TryAddContentScripts(
  1493  		js.Pointer(&ret), js.Pointer(&exception),
  1494  		float64(instanceId),
  1495  		contentScriptList.Ref(),
  1496  	)
  1497  
  1498  	return
  1499  }
  1500  
  1501  // HasFuncCaptureVisibleRegion returns true if the function "WEBEXT.webViewInternal.captureVisibleRegion" exists.
  1502  func HasFuncCaptureVisibleRegion() bool {
  1503  	return js.True == bindings.HasFuncCaptureVisibleRegion()
  1504  }
  1505  
  1506  // FuncCaptureVisibleRegion returns the function "WEBEXT.webViewInternal.captureVisibleRegion".
  1507  func FuncCaptureVisibleRegion() (fn js.Func[func(instanceId int64, options extensiontypes.ImageDetails, callback js.Func[func(dataUrl js.String)])]) {
  1508  	bindings.FuncCaptureVisibleRegion(
  1509  		js.Pointer(&fn),
  1510  	)
  1511  	return
  1512  }
  1513  
  1514  // CaptureVisibleRegion calls the function "WEBEXT.webViewInternal.captureVisibleRegion" directly.
  1515  func CaptureVisibleRegion(instanceId int64, options extensiontypes.ImageDetails, callback js.Func[func(dataUrl js.String)]) (ret js.Void) {
  1516  	bindings.CallCaptureVisibleRegion(
  1517  		js.Pointer(&ret),
  1518  		float64(instanceId),
  1519  		js.Pointer(&options),
  1520  		callback.Ref(),
  1521  	)
  1522  
  1523  	return
  1524  }
  1525  
  1526  // TryCaptureVisibleRegion calls the function "WEBEXT.webViewInternal.captureVisibleRegion"
  1527  // in a try/catch block and returns (_, err, ok = false) when it went through
  1528  // the catch clause.
  1529  func TryCaptureVisibleRegion(instanceId int64, options extensiontypes.ImageDetails, callback js.Func[func(dataUrl js.String)]) (ret js.Void, exception js.Any, ok bool) {
  1530  	ok = js.True == bindings.TryCaptureVisibleRegion(
  1531  		js.Pointer(&ret), js.Pointer(&exception),
  1532  		float64(instanceId),
  1533  		js.Pointer(&options),
  1534  		callback.Ref(),
  1535  	)
  1536  
  1537  	return
  1538  }
  1539  
  1540  // HasFuncClearData returns true if the function "WEBEXT.webViewInternal.clearData" exists.
  1541  func HasFuncClearData() bool {
  1542  	return js.True == bindings.HasFuncClearData()
  1543  }
  1544  
  1545  // FuncClearData returns the function "WEBEXT.webViewInternal.clearData".
  1546  func FuncClearData() (fn js.Func[func(instanceId int64, options RemovalOptions, dataToRemove DataTypeSet, callback js.Func[func()])]) {
  1547  	bindings.FuncClearData(
  1548  		js.Pointer(&fn),
  1549  	)
  1550  	return
  1551  }
  1552  
  1553  // ClearData calls the function "WEBEXT.webViewInternal.clearData" directly.
  1554  func ClearData(instanceId int64, options RemovalOptions, dataToRemove DataTypeSet, callback js.Func[func()]) (ret js.Void) {
  1555  	bindings.CallClearData(
  1556  		js.Pointer(&ret),
  1557  		float64(instanceId),
  1558  		js.Pointer(&options),
  1559  		js.Pointer(&dataToRemove),
  1560  		callback.Ref(),
  1561  	)
  1562  
  1563  	return
  1564  }
  1565  
  1566  // TryClearData calls the function "WEBEXT.webViewInternal.clearData"
  1567  // in a try/catch block and returns (_, err, ok = false) when it went through
  1568  // the catch clause.
  1569  func TryClearData(instanceId int64, options RemovalOptions, dataToRemove DataTypeSet, callback js.Func[func()]) (ret js.Void, exception js.Any, ok bool) {
  1570  	ok = js.True == bindings.TryClearData(
  1571  		js.Pointer(&ret), js.Pointer(&exception),
  1572  		float64(instanceId),
  1573  		js.Pointer(&options),
  1574  		js.Pointer(&dataToRemove),
  1575  		callback.Ref(),
  1576  	)
  1577  
  1578  	return
  1579  }
  1580  
  1581  // HasFuncExecuteScript returns true if the function "WEBEXT.webViewInternal.executeScript" exists.
  1582  func HasFuncExecuteScript() bool {
  1583  	return js.True == bindings.HasFuncExecuteScript()
  1584  }
  1585  
  1586  // FuncExecuteScript returns the function "WEBEXT.webViewInternal.executeScript".
  1587  func FuncExecuteScript() (fn js.Func[func(instanceId int64, src js.String, details extensiontypes.InjectDetails, callback js.Func[func(result js.Array[js.Any])])]) {
  1588  	bindings.FuncExecuteScript(
  1589  		js.Pointer(&fn),
  1590  	)
  1591  	return
  1592  }
  1593  
  1594  // ExecuteScript calls the function "WEBEXT.webViewInternal.executeScript" directly.
  1595  func ExecuteScript(instanceId int64, src js.String, details extensiontypes.InjectDetails, callback js.Func[func(result js.Array[js.Any])]) (ret js.Void) {
  1596  	bindings.CallExecuteScript(
  1597  		js.Pointer(&ret),
  1598  		float64(instanceId),
  1599  		src.Ref(),
  1600  		js.Pointer(&details),
  1601  		callback.Ref(),
  1602  	)
  1603  
  1604  	return
  1605  }
  1606  
  1607  // TryExecuteScript calls the function "WEBEXT.webViewInternal.executeScript"
  1608  // in a try/catch block and returns (_, err, ok = false) when it went through
  1609  // the catch clause.
  1610  func TryExecuteScript(instanceId int64, src js.String, details extensiontypes.InjectDetails, callback js.Func[func(result js.Array[js.Any])]) (ret js.Void, exception js.Any, ok bool) {
  1611  	ok = js.True == bindings.TryExecuteScript(
  1612  		js.Pointer(&ret), js.Pointer(&exception),
  1613  		float64(instanceId),
  1614  		src.Ref(),
  1615  		js.Pointer(&details),
  1616  		callback.Ref(),
  1617  	)
  1618  
  1619  	return
  1620  }
  1621  
  1622  // HasFuncFind returns true if the function "WEBEXT.webViewInternal.find" exists.
  1623  func HasFuncFind() bool {
  1624  	return js.True == bindings.HasFuncFind()
  1625  }
  1626  
  1627  // FuncFind returns the function "WEBEXT.webViewInternal.find".
  1628  func FuncFind() (fn js.Func[func(instanceId int64, searchText js.String, options FindArgOptions, callback js.Func[func(results *FindArgCallbackArgResults)])]) {
  1629  	bindings.FuncFind(
  1630  		js.Pointer(&fn),
  1631  	)
  1632  	return
  1633  }
  1634  
  1635  // Find calls the function "WEBEXT.webViewInternal.find" directly.
  1636  func Find(instanceId int64, searchText js.String, options FindArgOptions, callback js.Func[func(results *FindArgCallbackArgResults)]) (ret js.Void) {
  1637  	bindings.CallFind(
  1638  		js.Pointer(&ret),
  1639  		float64(instanceId),
  1640  		searchText.Ref(),
  1641  		js.Pointer(&options),
  1642  		callback.Ref(),
  1643  	)
  1644  
  1645  	return
  1646  }
  1647  
  1648  // TryFind calls the function "WEBEXT.webViewInternal.find"
  1649  // in a try/catch block and returns (_, err, ok = false) when it went through
  1650  // the catch clause.
  1651  func TryFind(instanceId int64, searchText js.String, options FindArgOptions, callback js.Func[func(results *FindArgCallbackArgResults)]) (ret js.Void, exception js.Any, ok bool) {
  1652  	ok = js.True == bindings.TryFind(
  1653  		js.Pointer(&ret), js.Pointer(&exception),
  1654  		float64(instanceId),
  1655  		searchText.Ref(),
  1656  		js.Pointer(&options),
  1657  		callback.Ref(),
  1658  	)
  1659  
  1660  	return
  1661  }
  1662  
  1663  // HasFuncGetAudioState returns true if the function "WEBEXT.webViewInternal.getAudioState" exists.
  1664  func HasFuncGetAudioState() bool {
  1665  	return js.True == bindings.HasFuncGetAudioState()
  1666  }
  1667  
  1668  // FuncGetAudioState returns the function "WEBEXT.webViewInternal.getAudioState".
  1669  func FuncGetAudioState() (fn js.Func[func(instanceId int64, callback js.Func[func(audible bool)])]) {
  1670  	bindings.FuncGetAudioState(
  1671  		js.Pointer(&fn),
  1672  	)
  1673  	return
  1674  }
  1675  
  1676  // GetAudioState calls the function "WEBEXT.webViewInternal.getAudioState" directly.
  1677  func GetAudioState(instanceId int64, callback js.Func[func(audible bool)]) (ret js.Void) {
  1678  	bindings.CallGetAudioState(
  1679  		js.Pointer(&ret),
  1680  		float64(instanceId),
  1681  		callback.Ref(),
  1682  	)
  1683  
  1684  	return
  1685  }
  1686  
  1687  // TryGetAudioState calls the function "WEBEXT.webViewInternal.getAudioState"
  1688  // in a try/catch block and returns (_, err, ok = false) when it went through
  1689  // the catch clause.
  1690  func TryGetAudioState(instanceId int64, callback js.Func[func(audible bool)]) (ret js.Void, exception js.Any, ok bool) {
  1691  	ok = js.True == bindings.TryGetAudioState(
  1692  		js.Pointer(&ret), js.Pointer(&exception),
  1693  		float64(instanceId),
  1694  		callback.Ref(),
  1695  	)
  1696  
  1697  	return
  1698  }
  1699  
  1700  // HasFuncGetZoom returns true if the function "WEBEXT.webViewInternal.getZoom" exists.
  1701  func HasFuncGetZoom() bool {
  1702  	return js.True == bindings.HasFuncGetZoom()
  1703  }
  1704  
  1705  // FuncGetZoom returns the function "WEBEXT.webViewInternal.getZoom".
  1706  func FuncGetZoom() (fn js.Func[func(instanceId int64, callback js.Func[func(zoomFactor float64)])]) {
  1707  	bindings.FuncGetZoom(
  1708  		js.Pointer(&fn),
  1709  	)
  1710  	return
  1711  }
  1712  
  1713  // GetZoom calls the function "WEBEXT.webViewInternal.getZoom" directly.
  1714  func GetZoom(instanceId int64, callback js.Func[func(zoomFactor float64)]) (ret js.Void) {
  1715  	bindings.CallGetZoom(
  1716  		js.Pointer(&ret),
  1717  		float64(instanceId),
  1718  		callback.Ref(),
  1719  	)
  1720  
  1721  	return
  1722  }
  1723  
  1724  // TryGetZoom calls the function "WEBEXT.webViewInternal.getZoom"
  1725  // in a try/catch block and returns (_, err, ok = false) when it went through
  1726  // the catch clause.
  1727  func TryGetZoom(instanceId int64, callback js.Func[func(zoomFactor float64)]) (ret js.Void, exception js.Any, ok bool) {
  1728  	ok = js.True == bindings.TryGetZoom(
  1729  		js.Pointer(&ret), js.Pointer(&exception),
  1730  		float64(instanceId),
  1731  		callback.Ref(),
  1732  	)
  1733  
  1734  	return
  1735  }
  1736  
  1737  // HasFuncGetZoomMode returns true if the function "WEBEXT.webViewInternal.getZoomMode" exists.
  1738  func HasFuncGetZoomMode() bool {
  1739  	return js.True == bindings.HasFuncGetZoomMode()
  1740  }
  1741  
  1742  // FuncGetZoomMode returns the function "WEBEXT.webViewInternal.getZoomMode".
  1743  func FuncGetZoomMode() (fn js.Func[func(instanceId int64, callback js.Func[func(ZoomMode ZoomMode)])]) {
  1744  	bindings.FuncGetZoomMode(
  1745  		js.Pointer(&fn),
  1746  	)
  1747  	return
  1748  }
  1749  
  1750  // GetZoomMode calls the function "WEBEXT.webViewInternal.getZoomMode" directly.
  1751  func GetZoomMode(instanceId int64, callback js.Func[func(ZoomMode ZoomMode)]) (ret js.Void) {
  1752  	bindings.CallGetZoomMode(
  1753  		js.Pointer(&ret),
  1754  		float64(instanceId),
  1755  		callback.Ref(),
  1756  	)
  1757  
  1758  	return
  1759  }
  1760  
  1761  // TryGetZoomMode calls the function "WEBEXT.webViewInternal.getZoomMode"
  1762  // in a try/catch block and returns (_, err, ok = false) when it went through
  1763  // the catch clause.
  1764  func TryGetZoomMode(instanceId int64, callback js.Func[func(ZoomMode ZoomMode)]) (ret js.Void, exception js.Any, ok bool) {
  1765  	ok = js.True == bindings.TryGetZoomMode(
  1766  		js.Pointer(&ret), js.Pointer(&exception),
  1767  		float64(instanceId),
  1768  		callback.Ref(),
  1769  	)
  1770  
  1771  	return
  1772  }
  1773  
  1774  // HasFuncGo returns true if the function "WEBEXT.webViewInternal.go" exists.
  1775  func HasFuncGo() bool {
  1776  	return js.True == bindings.HasFuncGo()
  1777  }
  1778  
  1779  // FuncGo returns the function "WEBEXT.webViewInternal.go".
  1780  func FuncGo() (fn js.Func[func(instanceId int64, relativeIndex int64, callback js.Func[func(success bool)])]) {
  1781  	bindings.FuncGo(
  1782  		js.Pointer(&fn),
  1783  	)
  1784  	return
  1785  }
  1786  
  1787  // Go calls the function "WEBEXT.webViewInternal.go" directly.
  1788  func Go(instanceId int64, relativeIndex int64, callback js.Func[func(success bool)]) (ret js.Void) {
  1789  	bindings.CallGo(
  1790  		js.Pointer(&ret),
  1791  		float64(instanceId),
  1792  		float64(relativeIndex),
  1793  		callback.Ref(),
  1794  	)
  1795  
  1796  	return
  1797  }
  1798  
  1799  // TryGo calls the function "WEBEXT.webViewInternal.go"
  1800  // in a try/catch block and returns (_, err, ok = false) when it went through
  1801  // the catch clause.
  1802  func TryGo(instanceId int64, relativeIndex int64, callback js.Func[func(success bool)]) (ret js.Void, exception js.Any, ok bool) {
  1803  	ok = js.True == bindings.TryGo(
  1804  		js.Pointer(&ret), js.Pointer(&exception),
  1805  		float64(instanceId),
  1806  		float64(relativeIndex),
  1807  		callback.Ref(),
  1808  	)
  1809  
  1810  	return
  1811  }
  1812  
  1813  // HasFuncInsertCSS returns true if the function "WEBEXT.webViewInternal.insertCSS" exists.
  1814  func HasFuncInsertCSS() bool {
  1815  	return js.True == bindings.HasFuncInsertCSS()
  1816  }
  1817  
  1818  // FuncInsertCSS returns the function "WEBEXT.webViewInternal.insertCSS".
  1819  func FuncInsertCSS() (fn js.Func[func(instanceId int64, src js.String, details extensiontypes.InjectDetails, callback js.Func[func()])]) {
  1820  	bindings.FuncInsertCSS(
  1821  		js.Pointer(&fn),
  1822  	)
  1823  	return
  1824  }
  1825  
  1826  // InsertCSS calls the function "WEBEXT.webViewInternal.insertCSS" directly.
  1827  func InsertCSS(instanceId int64, src js.String, details extensiontypes.InjectDetails, callback js.Func[func()]) (ret js.Void) {
  1828  	bindings.CallInsertCSS(
  1829  		js.Pointer(&ret),
  1830  		float64(instanceId),
  1831  		src.Ref(),
  1832  		js.Pointer(&details),
  1833  		callback.Ref(),
  1834  	)
  1835  
  1836  	return
  1837  }
  1838  
  1839  // TryInsertCSS calls the function "WEBEXT.webViewInternal.insertCSS"
  1840  // in a try/catch block and returns (_, err, ok = false) when it went through
  1841  // the catch clause.
  1842  func TryInsertCSS(instanceId int64, src js.String, details extensiontypes.InjectDetails, callback js.Func[func()]) (ret js.Void, exception js.Any, ok bool) {
  1843  	ok = js.True == bindings.TryInsertCSS(
  1844  		js.Pointer(&ret), js.Pointer(&exception),
  1845  		float64(instanceId),
  1846  		src.Ref(),
  1847  		js.Pointer(&details),
  1848  		callback.Ref(),
  1849  	)
  1850  
  1851  	return
  1852  }
  1853  
  1854  // HasFuncIsAudioMuted returns true if the function "WEBEXT.webViewInternal.isAudioMuted" exists.
  1855  func HasFuncIsAudioMuted() bool {
  1856  	return js.True == bindings.HasFuncIsAudioMuted()
  1857  }
  1858  
  1859  // FuncIsAudioMuted returns the function "WEBEXT.webViewInternal.isAudioMuted".
  1860  func FuncIsAudioMuted() (fn js.Func[func(instanceId int64, callback js.Func[func(muted bool)])]) {
  1861  	bindings.FuncIsAudioMuted(
  1862  		js.Pointer(&fn),
  1863  	)
  1864  	return
  1865  }
  1866  
  1867  // IsAudioMuted calls the function "WEBEXT.webViewInternal.isAudioMuted" directly.
  1868  func IsAudioMuted(instanceId int64, callback js.Func[func(muted bool)]) (ret js.Void) {
  1869  	bindings.CallIsAudioMuted(
  1870  		js.Pointer(&ret),
  1871  		float64(instanceId),
  1872  		callback.Ref(),
  1873  	)
  1874  
  1875  	return
  1876  }
  1877  
  1878  // TryIsAudioMuted calls the function "WEBEXT.webViewInternal.isAudioMuted"
  1879  // in a try/catch block and returns (_, err, ok = false) when it went through
  1880  // the catch clause.
  1881  func TryIsAudioMuted(instanceId int64, callback js.Func[func(muted bool)]) (ret js.Void, exception js.Any, ok bool) {
  1882  	ok = js.True == bindings.TryIsAudioMuted(
  1883  		js.Pointer(&ret), js.Pointer(&exception),
  1884  		float64(instanceId),
  1885  		callback.Ref(),
  1886  	)
  1887  
  1888  	return
  1889  }
  1890  
  1891  // HasFuncIsSpatialNavigationEnabled returns true if the function "WEBEXT.webViewInternal.isSpatialNavigationEnabled" exists.
  1892  func HasFuncIsSpatialNavigationEnabled() bool {
  1893  	return js.True == bindings.HasFuncIsSpatialNavigationEnabled()
  1894  }
  1895  
  1896  // FuncIsSpatialNavigationEnabled returns the function "WEBEXT.webViewInternal.isSpatialNavigationEnabled".
  1897  func FuncIsSpatialNavigationEnabled() (fn js.Func[func(instanceId int64, callback js.Func[func(spatialNavEnabled bool)])]) {
  1898  	bindings.FuncIsSpatialNavigationEnabled(
  1899  		js.Pointer(&fn),
  1900  	)
  1901  	return
  1902  }
  1903  
  1904  // IsSpatialNavigationEnabled calls the function "WEBEXT.webViewInternal.isSpatialNavigationEnabled" directly.
  1905  func IsSpatialNavigationEnabled(instanceId int64, callback js.Func[func(spatialNavEnabled bool)]) (ret js.Void) {
  1906  	bindings.CallIsSpatialNavigationEnabled(
  1907  		js.Pointer(&ret),
  1908  		float64(instanceId),
  1909  		callback.Ref(),
  1910  	)
  1911  
  1912  	return
  1913  }
  1914  
  1915  // TryIsSpatialNavigationEnabled calls the function "WEBEXT.webViewInternal.isSpatialNavigationEnabled"
  1916  // in a try/catch block and returns (_, err, ok = false) when it went through
  1917  // the catch clause.
  1918  func TryIsSpatialNavigationEnabled(instanceId int64, callback js.Func[func(spatialNavEnabled bool)]) (ret js.Void, exception js.Any, ok bool) {
  1919  	ok = js.True == bindings.TryIsSpatialNavigationEnabled(
  1920  		js.Pointer(&ret), js.Pointer(&exception),
  1921  		float64(instanceId),
  1922  		callback.Ref(),
  1923  	)
  1924  
  1925  	return
  1926  }
  1927  
  1928  // HasFuncLoadDataWithBaseUrl returns true if the function "WEBEXT.webViewInternal.loadDataWithBaseUrl" exists.
  1929  func HasFuncLoadDataWithBaseUrl() bool {
  1930  	return js.True == bindings.HasFuncLoadDataWithBaseUrl()
  1931  }
  1932  
  1933  // FuncLoadDataWithBaseUrl returns the function "WEBEXT.webViewInternal.loadDataWithBaseUrl".
  1934  func FuncLoadDataWithBaseUrl() (fn js.Func[func(instanceId int64, dataUrl js.String, baseUrl js.String, virtualUrl js.String, callback js.Func[func()])]) {
  1935  	bindings.FuncLoadDataWithBaseUrl(
  1936  		js.Pointer(&fn),
  1937  	)
  1938  	return
  1939  }
  1940  
  1941  // LoadDataWithBaseUrl calls the function "WEBEXT.webViewInternal.loadDataWithBaseUrl" directly.
  1942  func LoadDataWithBaseUrl(instanceId int64, dataUrl js.String, baseUrl js.String, virtualUrl js.String, callback js.Func[func()]) (ret js.Void) {
  1943  	bindings.CallLoadDataWithBaseUrl(
  1944  		js.Pointer(&ret),
  1945  		float64(instanceId),
  1946  		dataUrl.Ref(),
  1947  		baseUrl.Ref(),
  1948  		virtualUrl.Ref(),
  1949  		callback.Ref(),
  1950  	)
  1951  
  1952  	return
  1953  }
  1954  
  1955  // TryLoadDataWithBaseUrl calls the function "WEBEXT.webViewInternal.loadDataWithBaseUrl"
  1956  // in a try/catch block and returns (_, err, ok = false) when it went through
  1957  // the catch clause.
  1958  func TryLoadDataWithBaseUrl(instanceId int64, dataUrl js.String, baseUrl js.String, virtualUrl js.String, callback js.Func[func()]) (ret js.Void, exception js.Any, ok bool) {
  1959  	ok = js.True == bindings.TryLoadDataWithBaseUrl(
  1960  		js.Pointer(&ret), js.Pointer(&exception),
  1961  		float64(instanceId),
  1962  		dataUrl.Ref(),
  1963  		baseUrl.Ref(),
  1964  		virtualUrl.Ref(),
  1965  		callback.Ref(),
  1966  	)
  1967  
  1968  	return
  1969  }
  1970  
  1971  // HasFuncNavigate returns true if the function "WEBEXT.webViewInternal.navigate" exists.
  1972  func HasFuncNavigate() bool {
  1973  	return js.True == bindings.HasFuncNavigate()
  1974  }
  1975  
  1976  // FuncNavigate returns the function "WEBEXT.webViewInternal.navigate".
  1977  func FuncNavigate() (fn js.Func[func(instanceId int64, src js.String)]) {
  1978  	bindings.FuncNavigate(
  1979  		js.Pointer(&fn),
  1980  	)
  1981  	return
  1982  }
  1983  
  1984  // Navigate calls the function "WEBEXT.webViewInternal.navigate" directly.
  1985  func Navigate(instanceId int64, src js.String) (ret js.Void) {
  1986  	bindings.CallNavigate(
  1987  		js.Pointer(&ret),
  1988  		float64(instanceId),
  1989  		src.Ref(),
  1990  	)
  1991  
  1992  	return
  1993  }
  1994  
  1995  // TryNavigate calls the function "WEBEXT.webViewInternal.navigate"
  1996  // in a try/catch block and returns (_, err, ok = false) when it went through
  1997  // the catch clause.
  1998  func TryNavigate(instanceId int64, src js.String) (ret js.Void, exception js.Any, ok bool) {
  1999  	ok = js.True == bindings.TryNavigate(
  2000  		js.Pointer(&ret), js.Pointer(&exception),
  2001  		float64(instanceId),
  2002  		src.Ref(),
  2003  	)
  2004  
  2005  	return
  2006  }
  2007  
  2008  // HasFuncOverrideUserAgent returns true if the function "WEBEXT.webViewInternal.overrideUserAgent" exists.
  2009  func HasFuncOverrideUserAgent() bool {
  2010  	return js.True == bindings.HasFuncOverrideUserAgent()
  2011  }
  2012  
  2013  // FuncOverrideUserAgent returns the function "WEBEXT.webViewInternal.overrideUserAgent".
  2014  func FuncOverrideUserAgent() (fn js.Func[func(instanceId int64, userAgentOverride js.String)]) {
  2015  	bindings.FuncOverrideUserAgent(
  2016  		js.Pointer(&fn),
  2017  	)
  2018  	return
  2019  }
  2020  
  2021  // OverrideUserAgent calls the function "WEBEXT.webViewInternal.overrideUserAgent" directly.
  2022  func OverrideUserAgent(instanceId int64, userAgentOverride js.String) (ret js.Void) {
  2023  	bindings.CallOverrideUserAgent(
  2024  		js.Pointer(&ret),
  2025  		float64(instanceId),
  2026  		userAgentOverride.Ref(),
  2027  	)
  2028  
  2029  	return
  2030  }
  2031  
  2032  // TryOverrideUserAgent calls the function "WEBEXT.webViewInternal.overrideUserAgent"
  2033  // in a try/catch block and returns (_, err, ok = false) when it went through
  2034  // the catch clause.
  2035  func TryOverrideUserAgent(instanceId int64, userAgentOverride js.String) (ret js.Void, exception js.Any, ok bool) {
  2036  	ok = js.True == bindings.TryOverrideUserAgent(
  2037  		js.Pointer(&ret), js.Pointer(&exception),
  2038  		float64(instanceId),
  2039  		userAgentOverride.Ref(),
  2040  	)
  2041  
  2042  	return
  2043  }
  2044  
  2045  // HasFuncReload returns true if the function "WEBEXT.webViewInternal.reload" exists.
  2046  func HasFuncReload() bool {
  2047  	return js.True == bindings.HasFuncReload()
  2048  }
  2049  
  2050  // FuncReload returns the function "WEBEXT.webViewInternal.reload".
  2051  func FuncReload() (fn js.Func[func(instanceId int64)]) {
  2052  	bindings.FuncReload(
  2053  		js.Pointer(&fn),
  2054  	)
  2055  	return
  2056  }
  2057  
  2058  // Reload calls the function "WEBEXT.webViewInternal.reload" directly.
  2059  func Reload(instanceId int64) (ret js.Void) {
  2060  	bindings.CallReload(
  2061  		js.Pointer(&ret),
  2062  		float64(instanceId),
  2063  	)
  2064  
  2065  	return
  2066  }
  2067  
  2068  // TryReload calls the function "WEBEXT.webViewInternal.reload"
  2069  // in a try/catch block and returns (_, err, ok = false) when it went through
  2070  // the catch clause.
  2071  func TryReload(instanceId int64) (ret js.Void, exception js.Any, ok bool) {
  2072  	ok = js.True == bindings.TryReload(
  2073  		js.Pointer(&ret), js.Pointer(&exception),
  2074  		float64(instanceId),
  2075  	)
  2076  
  2077  	return
  2078  }
  2079  
  2080  // HasFuncRemoveContentScripts returns true if the function "WEBEXT.webViewInternal.removeContentScripts" exists.
  2081  func HasFuncRemoveContentScripts() bool {
  2082  	return js.True == bindings.HasFuncRemoveContentScripts()
  2083  }
  2084  
  2085  // FuncRemoveContentScripts returns the function "WEBEXT.webViewInternal.removeContentScripts".
  2086  func FuncRemoveContentScripts() (fn js.Func[func(instanceId int64, scriptNameList js.Array[js.String])]) {
  2087  	bindings.FuncRemoveContentScripts(
  2088  		js.Pointer(&fn),
  2089  	)
  2090  	return
  2091  }
  2092  
  2093  // RemoveContentScripts calls the function "WEBEXT.webViewInternal.removeContentScripts" directly.
  2094  func RemoveContentScripts(instanceId int64, scriptNameList js.Array[js.String]) (ret js.Void) {
  2095  	bindings.CallRemoveContentScripts(
  2096  		js.Pointer(&ret),
  2097  		float64(instanceId),
  2098  		scriptNameList.Ref(),
  2099  	)
  2100  
  2101  	return
  2102  }
  2103  
  2104  // TryRemoveContentScripts calls the function "WEBEXT.webViewInternal.removeContentScripts"
  2105  // in a try/catch block and returns (_, err, ok = false) when it went through
  2106  // the catch clause.
  2107  func TryRemoveContentScripts(instanceId int64, scriptNameList js.Array[js.String]) (ret js.Void, exception js.Any, ok bool) {
  2108  	ok = js.True == bindings.TryRemoveContentScripts(
  2109  		js.Pointer(&ret), js.Pointer(&exception),
  2110  		float64(instanceId),
  2111  		scriptNameList.Ref(),
  2112  	)
  2113  
  2114  	return
  2115  }
  2116  
  2117  // HasFuncSetAllowScaling returns true if the function "WEBEXT.webViewInternal.setAllowScaling" exists.
  2118  func HasFuncSetAllowScaling() bool {
  2119  	return js.True == bindings.HasFuncSetAllowScaling()
  2120  }
  2121  
  2122  // FuncSetAllowScaling returns the function "WEBEXT.webViewInternal.setAllowScaling".
  2123  func FuncSetAllowScaling() (fn js.Func[func(instanceId int64, allow bool)]) {
  2124  	bindings.FuncSetAllowScaling(
  2125  		js.Pointer(&fn),
  2126  	)
  2127  	return
  2128  }
  2129  
  2130  // SetAllowScaling calls the function "WEBEXT.webViewInternal.setAllowScaling" directly.
  2131  func SetAllowScaling(instanceId int64, allow bool) (ret js.Void) {
  2132  	bindings.CallSetAllowScaling(
  2133  		js.Pointer(&ret),
  2134  		float64(instanceId),
  2135  		js.Bool(bool(allow)),
  2136  	)
  2137  
  2138  	return
  2139  }
  2140  
  2141  // TrySetAllowScaling calls the function "WEBEXT.webViewInternal.setAllowScaling"
  2142  // in a try/catch block and returns (_, err, ok = false) when it went through
  2143  // the catch clause.
  2144  func TrySetAllowScaling(instanceId int64, allow bool) (ret js.Void, exception js.Any, ok bool) {
  2145  	ok = js.True == bindings.TrySetAllowScaling(
  2146  		js.Pointer(&ret), js.Pointer(&exception),
  2147  		float64(instanceId),
  2148  		js.Bool(bool(allow)),
  2149  	)
  2150  
  2151  	return
  2152  }
  2153  
  2154  // HasFuncSetAllowTransparency returns true if the function "WEBEXT.webViewInternal.setAllowTransparency" exists.
  2155  func HasFuncSetAllowTransparency() bool {
  2156  	return js.True == bindings.HasFuncSetAllowTransparency()
  2157  }
  2158  
  2159  // FuncSetAllowTransparency returns the function "WEBEXT.webViewInternal.setAllowTransparency".
  2160  func FuncSetAllowTransparency() (fn js.Func[func(instanceId int64, allow bool)]) {
  2161  	bindings.FuncSetAllowTransparency(
  2162  		js.Pointer(&fn),
  2163  	)
  2164  	return
  2165  }
  2166  
  2167  // SetAllowTransparency calls the function "WEBEXT.webViewInternal.setAllowTransparency" directly.
  2168  func SetAllowTransparency(instanceId int64, allow bool) (ret js.Void) {
  2169  	bindings.CallSetAllowTransparency(
  2170  		js.Pointer(&ret),
  2171  		float64(instanceId),
  2172  		js.Bool(bool(allow)),
  2173  	)
  2174  
  2175  	return
  2176  }
  2177  
  2178  // TrySetAllowTransparency calls the function "WEBEXT.webViewInternal.setAllowTransparency"
  2179  // in a try/catch block and returns (_, err, ok = false) when it went through
  2180  // the catch clause.
  2181  func TrySetAllowTransparency(instanceId int64, allow bool) (ret js.Void, exception js.Any, ok bool) {
  2182  	ok = js.True == bindings.TrySetAllowTransparency(
  2183  		js.Pointer(&ret), js.Pointer(&exception),
  2184  		float64(instanceId),
  2185  		js.Bool(bool(allow)),
  2186  	)
  2187  
  2188  	return
  2189  }
  2190  
  2191  // HasFuncSetAudioMuted returns true if the function "WEBEXT.webViewInternal.setAudioMuted" exists.
  2192  func HasFuncSetAudioMuted() bool {
  2193  	return js.True == bindings.HasFuncSetAudioMuted()
  2194  }
  2195  
  2196  // FuncSetAudioMuted returns the function "WEBEXT.webViewInternal.setAudioMuted".
  2197  func FuncSetAudioMuted() (fn js.Func[func(instanceId int64, mute bool)]) {
  2198  	bindings.FuncSetAudioMuted(
  2199  		js.Pointer(&fn),
  2200  	)
  2201  	return
  2202  }
  2203  
  2204  // SetAudioMuted calls the function "WEBEXT.webViewInternal.setAudioMuted" directly.
  2205  func SetAudioMuted(instanceId int64, mute bool) (ret js.Void) {
  2206  	bindings.CallSetAudioMuted(
  2207  		js.Pointer(&ret),
  2208  		float64(instanceId),
  2209  		js.Bool(bool(mute)),
  2210  	)
  2211  
  2212  	return
  2213  }
  2214  
  2215  // TrySetAudioMuted calls the function "WEBEXT.webViewInternal.setAudioMuted"
  2216  // in a try/catch block and returns (_, err, ok = false) when it went through
  2217  // the catch clause.
  2218  func TrySetAudioMuted(instanceId int64, mute bool) (ret js.Void, exception js.Any, ok bool) {
  2219  	ok = js.True == bindings.TrySetAudioMuted(
  2220  		js.Pointer(&ret), js.Pointer(&exception),
  2221  		float64(instanceId),
  2222  		js.Bool(bool(mute)),
  2223  	)
  2224  
  2225  	return
  2226  }
  2227  
  2228  // HasFuncSetName returns true if the function "WEBEXT.webViewInternal.setName" exists.
  2229  func HasFuncSetName() bool {
  2230  	return js.True == bindings.HasFuncSetName()
  2231  }
  2232  
  2233  // FuncSetName returns the function "WEBEXT.webViewInternal.setName".
  2234  func FuncSetName() (fn js.Func[func(instanceId int64, frameName js.String)]) {
  2235  	bindings.FuncSetName(
  2236  		js.Pointer(&fn),
  2237  	)
  2238  	return
  2239  }
  2240  
  2241  // SetName calls the function "WEBEXT.webViewInternal.setName" directly.
  2242  func SetName(instanceId int64, frameName js.String) (ret js.Void) {
  2243  	bindings.CallSetName(
  2244  		js.Pointer(&ret),
  2245  		float64(instanceId),
  2246  		frameName.Ref(),
  2247  	)
  2248  
  2249  	return
  2250  }
  2251  
  2252  // TrySetName calls the function "WEBEXT.webViewInternal.setName"
  2253  // in a try/catch block and returns (_, err, ok = false) when it went through
  2254  // the catch clause.
  2255  func TrySetName(instanceId int64, frameName js.String) (ret js.Void, exception js.Any, ok bool) {
  2256  	ok = js.True == bindings.TrySetName(
  2257  		js.Pointer(&ret), js.Pointer(&exception),
  2258  		float64(instanceId),
  2259  		frameName.Ref(),
  2260  	)
  2261  
  2262  	return
  2263  }
  2264  
  2265  // HasFuncSetPermission returns true if the function "WEBEXT.webViewInternal.setPermission" exists.
  2266  func HasFuncSetPermission() bool {
  2267  	return js.True == bindings.HasFuncSetPermission()
  2268  }
  2269  
  2270  // FuncSetPermission returns the function "WEBEXT.webViewInternal.setPermission".
  2271  func FuncSetPermission() (fn js.Func[func(instanceId int64, requestId int64, action SetPermissionAction, userInput js.String, callback js.Func[func(allowed bool)])]) {
  2272  	bindings.FuncSetPermission(
  2273  		js.Pointer(&fn),
  2274  	)
  2275  	return
  2276  }
  2277  
  2278  // SetPermission calls the function "WEBEXT.webViewInternal.setPermission" directly.
  2279  func SetPermission(instanceId int64, requestId int64, action SetPermissionAction, userInput js.String, callback js.Func[func(allowed bool)]) (ret js.Void) {
  2280  	bindings.CallSetPermission(
  2281  		js.Pointer(&ret),
  2282  		float64(instanceId),
  2283  		float64(requestId),
  2284  		uint32(action),
  2285  		userInput.Ref(),
  2286  		callback.Ref(),
  2287  	)
  2288  
  2289  	return
  2290  }
  2291  
  2292  // TrySetPermission calls the function "WEBEXT.webViewInternal.setPermission"
  2293  // in a try/catch block and returns (_, err, ok = false) when it went through
  2294  // the catch clause.
  2295  func TrySetPermission(instanceId int64, requestId int64, action SetPermissionAction, userInput js.String, callback js.Func[func(allowed bool)]) (ret js.Void, exception js.Any, ok bool) {
  2296  	ok = js.True == bindings.TrySetPermission(
  2297  		js.Pointer(&ret), js.Pointer(&exception),
  2298  		float64(instanceId),
  2299  		float64(requestId),
  2300  		uint32(action),
  2301  		userInput.Ref(),
  2302  		callback.Ref(),
  2303  	)
  2304  
  2305  	return
  2306  }
  2307  
  2308  // HasFuncSetSpatialNavigationEnabled returns true if the function "WEBEXT.webViewInternal.setSpatialNavigationEnabled" exists.
  2309  func HasFuncSetSpatialNavigationEnabled() bool {
  2310  	return js.True == bindings.HasFuncSetSpatialNavigationEnabled()
  2311  }
  2312  
  2313  // FuncSetSpatialNavigationEnabled returns the function "WEBEXT.webViewInternal.setSpatialNavigationEnabled".
  2314  func FuncSetSpatialNavigationEnabled() (fn js.Func[func(instanceId int64, spatialNavEnabled bool)]) {
  2315  	bindings.FuncSetSpatialNavigationEnabled(
  2316  		js.Pointer(&fn),
  2317  	)
  2318  	return
  2319  }
  2320  
  2321  // SetSpatialNavigationEnabled calls the function "WEBEXT.webViewInternal.setSpatialNavigationEnabled" directly.
  2322  func SetSpatialNavigationEnabled(instanceId int64, spatialNavEnabled bool) (ret js.Void) {
  2323  	bindings.CallSetSpatialNavigationEnabled(
  2324  		js.Pointer(&ret),
  2325  		float64(instanceId),
  2326  		js.Bool(bool(spatialNavEnabled)),
  2327  	)
  2328  
  2329  	return
  2330  }
  2331  
  2332  // TrySetSpatialNavigationEnabled calls the function "WEBEXT.webViewInternal.setSpatialNavigationEnabled"
  2333  // in a try/catch block and returns (_, err, ok = false) when it went through
  2334  // the catch clause.
  2335  func TrySetSpatialNavigationEnabled(instanceId int64, spatialNavEnabled bool) (ret js.Void, exception js.Any, ok bool) {
  2336  	ok = js.True == bindings.TrySetSpatialNavigationEnabled(
  2337  		js.Pointer(&ret), js.Pointer(&exception),
  2338  		float64(instanceId),
  2339  		js.Bool(bool(spatialNavEnabled)),
  2340  	)
  2341  
  2342  	return
  2343  }
  2344  
  2345  // HasFuncSetZoom returns true if the function "WEBEXT.webViewInternal.setZoom" exists.
  2346  func HasFuncSetZoom() bool {
  2347  	return js.True == bindings.HasFuncSetZoom()
  2348  }
  2349  
  2350  // FuncSetZoom returns the function "WEBEXT.webViewInternal.setZoom".
  2351  func FuncSetZoom() (fn js.Func[func(instanceId int64, zoomFactor float64, callback js.Func[func()])]) {
  2352  	bindings.FuncSetZoom(
  2353  		js.Pointer(&fn),
  2354  	)
  2355  	return
  2356  }
  2357  
  2358  // SetZoom calls the function "WEBEXT.webViewInternal.setZoom" directly.
  2359  func SetZoom(instanceId int64, zoomFactor float64, callback js.Func[func()]) (ret js.Void) {
  2360  	bindings.CallSetZoom(
  2361  		js.Pointer(&ret),
  2362  		float64(instanceId),
  2363  		float64(zoomFactor),
  2364  		callback.Ref(),
  2365  	)
  2366  
  2367  	return
  2368  }
  2369  
  2370  // TrySetZoom calls the function "WEBEXT.webViewInternal.setZoom"
  2371  // in a try/catch block and returns (_, err, ok = false) when it went through
  2372  // the catch clause.
  2373  func TrySetZoom(instanceId int64, zoomFactor float64, callback js.Func[func()]) (ret js.Void, exception js.Any, ok bool) {
  2374  	ok = js.True == bindings.TrySetZoom(
  2375  		js.Pointer(&ret), js.Pointer(&exception),
  2376  		float64(instanceId),
  2377  		float64(zoomFactor),
  2378  		callback.Ref(),
  2379  	)
  2380  
  2381  	return
  2382  }
  2383  
  2384  // HasFuncSetZoomMode returns true if the function "WEBEXT.webViewInternal.setZoomMode" exists.
  2385  func HasFuncSetZoomMode() bool {
  2386  	return js.True == bindings.HasFuncSetZoomMode()
  2387  }
  2388  
  2389  // FuncSetZoomMode returns the function "WEBEXT.webViewInternal.setZoomMode".
  2390  func FuncSetZoomMode() (fn js.Func[func(instanceId int64, ZoomMode ZoomMode, callback js.Func[func()])]) {
  2391  	bindings.FuncSetZoomMode(
  2392  		js.Pointer(&fn),
  2393  	)
  2394  	return
  2395  }
  2396  
  2397  // SetZoomMode calls the function "WEBEXT.webViewInternal.setZoomMode" directly.
  2398  func SetZoomMode(instanceId int64, ZoomMode ZoomMode, callback js.Func[func()]) (ret js.Void) {
  2399  	bindings.CallSetZoomMode(
  2400  		js.Pointer(&ret),
  2401  		float64(instanceId),
  2402  		uint32(ZoomMode),
  2403  		callback.Ref(),
  2404  	)
  2405  
  2406  	return
  2407  }
  2408  
  2409  // TrySetZoomMode calls the function "WEBEXT.webViewInternal.setZoomMode"
  2410  // in a try/catch block and returns (_, err, ok = false) when it went through
  2411  // the catch clause.
  2412  func TrySetZoomMode(instanceId int64, ZoomMode ZoomMode, callback js.Func[func()]) (ret js.Void, exception js.Any, ok bool) {
  2413  	ok = js.True == bindings.TrySetZoomMode(
  2414  		js.Pointer(&ret), js.Pointer(&exception),
  2415  		float64(instanceId),
  2416  		uint32(ZoomMode),
  2417  		callback.Ref(),
  2418  	)
  2419  
  2420  	return
  2421  }
  2422  
  2423  // HasFuncStop returns true if the function "WEBEXT.webViewInternal.stop" exists.
  2424  func HasFuncStop() bool {
  2425  	return js.True == bindings.HasFuncStop()
  2426  }
  2427  
  2428  // FuncStop returns the function "WEBEXT.webViewInternal.stop".
  2429  func FuncStop() (fn js.Func[func(instanceId int64)]) {
  2430  	bindings.FuncStop(
  2431  		js.Pointer(&fn),
  2432  	)
  2433  	return
  2434  }
  2435  
  2436  // Stop calls the function "WEBEXT.webViewInternal.stop" directly.
  2437  func Stop(instanceId int64) (ret js.Void) {
  2438  	bindings.CallStop(
  2439  		js.Pointer(&ret),
  2440  		float64(instanceId),
  2441  	)
  2442  
  2443  	return
  2444  }
  2445  
  2446  // TryStop calls the function "WEBEXT.webViewInternal.stop"
  2447  // in a try/catch block and returns (_, err, ok = false) when it went through
  2448  // the catch clause.
  2449  func TryStop(instanceId int64) (ret js.Void, exception js.Any, ok bool) {
  2450  	ok = js.True == bindings.TryStop(
  2451  		js.Pointer(&ret), js.Pointer(&exception),
  2452  		float64(instanceId),
  2453  	)
  2454  
  2455  	return
  2456  }
  2457  
  2458  // HasFuncStopFinding returns true if the function "WEBEXT.webViewInternal.stopFinding" exists.
  2459  func HasFuncStopFinding() bool {
  2460  	return js.True == bindings.HasFuncStopFinding()
  2461  }
  2462  
  2463  // FuncStopFinding returns the function "WEBEXT.webViewInternal.stopFinding".
  2464  func FuncStopFinding() (fn js.Func[func(instanceId int64, action StopFindingAction)]) {
  2465  	bindings.FuncStopFinding(
  2466  		js.Pointer(&fn),
  2467  	)
  2468  	return
  2469  }
  2470  
  2471  // StopFinding calls the function "WEBEXT.webViewInternal.stopFinding" directly.
  2472  func StopFinding(instanceId int64, action StopFindingAction) (ret js.Void) {
  2473  	bindings.CallStopFinding(
  2474  		js.Pointer(&ret),
  2475  		float64(instanceId),
  2476  		uint32(action),
  2477  	)
  2478  
  2479  	return
  2480  }
  2481  
  2482  // TryStopFinding calls the function "WEBEXT.webViewInternal.stopFinding"
  2483  // in a try/catch block and returns (_, err, ok = false) when it went through
  2484  // the catch clause.
  2485  func TryStopFinding(instanceId int64, action StopFindingAction) (ret js.Void, exception js.Any, ok bool) {
  2486  	ok = js.True == bindings.TryStopFinding(
  2487  		js.Pointer(&ret), js.Pointer(&exception),
  2488  		float64(instanceId),
  2489  		uint32(action),
  2490  	)
  2491  
  2492  	return
  2493  }
  2494  
  2495  // HasFuncTerminate returns true if the function "WEBEXT.webViewInternal.terminate" exists.
  2496  func HasFuncTerminate() bool {
  2497  	return js.True == bindings.HasFuncTerminate()
  2498  }
  2499  
  2500  // FuncTerminate returns the function "WEBEXT.webViewInternal.terminate".
  2501  func FuncTerminate() (fn js.Func[func(instanceId int64)]) {
  2502  	bindings.FuncTerminate(
  2503  		js.Pointer(&fn),
  2504  	)
  2505  	return
  2506  }
  2507  
  2508  // Terminate calls the function "WEBEXT.webViewInternal.terminate" directly.
  2509  func Terminate(instanceId int64) (ret js.Void) {
  2510  	bindings.CallTerminate(
  2511  		js.Pointer(&ret),
  2512  		float64(instanceId),
  2513  	)
  2514  
  2515  	return
  2516  }
  2517  
  2518  // TryTerminate calls the function "WEBEXT.webViewInternal.terminate"
  2519  // in a try/catch block and returns (_, err, ok = false) when it went through
  2520  // the catch clause.
  2521  func TryTerminate(instanceId int64) (ret js.Void, exception js.Any, ok bool) {
  2522  	ok = js.True == bindings.TryTerminate(
  2523  		js.Pointer(&ret), js.Pointer(&exception),
  2524  		float64(instanceId),
  2525  	)
  2526  
  2527  	return
  2528  }