func (c *Runtime) DiscardConsoleEntries(ctx context.Context) (*gcdmessage.ChromeResponse, error) {
	return c.target.SendDefaultRequest(ctx, &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Runtime.discardConsoleEntries"})
}
Discards collected exceptions and console API calls.
package gcdapi
import (
	"context"
	"github.com/wirepair/gcd/v2/gcdmessage"
)
type RuntimeRemoteObject struct {
	Type                string                `json:"type"`                           
	Subtype             string                `json:"subtype,omitempty"`              
	ClassName           string                `json:"className,omitempty"`            
	Value               interface{}           `json:"value,omitempty"`                
	UnserializableValue string                `json:"unserializableValue,omitempty"`  
	Description         string                `json:"description,omitempty"`          
	ObjectId            string                `json:"objectId,omitempty"`             
	Preview             *RuntimeObjectPreview `json:"preview,omitempty"`              
	CustomPreview       *RuntimeCustomPreview `json:"customPreview,omitempty"`        
}
type RuntimeCustomPreview struct {
	Header       string `json:"header"`                  
	BodyGetterId string `json:"bodyGetterId,omitempty"`  
}
type RuntimeObjectPreview struct {
	Type        string                    `json:"type"`                   
	Subtype     string                    `json:"subtype,omitempty"`      
	Description string                    `json:"description,omitempty"`  
	Overflow    bool                      `json:"overflow"`               
	Properties  []*RuntimePropertyPreview `json:"properties"`             
	Entries     []*RuntimeEntryPreview    `json:"entries,omitempty"`      
}
type RuntimePropertyPreview struct {
	Name         string                `json:"name"`                    
	Type         string                `json:"type"`                    
	Value        string                `json:"value,omitempty"`         
	ValuePreview *RuntimeObjectPreview `json:"valuePreview,omitempty"`  
	Subtype      string                `json:"subtype,omitempty"`       
}
type RuntimeEntryPreview struct {
	Key   *RuntimeObjectPreview `json:"key,omitempty"`  
	Value *RuntimeObjectPreview `json:"value"`          
}
type RuntimePropertyDescriptor struct {
	Name         string               `json:"name"`                 
	Value        *RuntimeRemoteObject `json:"value,omitempty"`      
	Writable     bool                 `json:"writable,omitempty"`   
	Get          *RuntimeRemoteObject `json:"get,omitempty"`        
	Set          *RuntimeRemoteObject `json:"set,omitempty"`        
	Configurable bool                 `json:"configurable"`         
	Enumerable   bool                 `json:"enumerable"`           
	WasThrown    bool                 `json:"wasThrown,omitempty"`  
	IsOwn        bool                 `json:"isOwn,omitempty"`      
	Symbol       *RuntimeRemoteObject `json:"symbol,omitempty"`     
}
type RuntimeInternalPropertyDescriptor struct {
	Name  string               `json:"name"`             
	Value *RuntimeRemoteObject `json:"value,omitempty"`  
}
type RuntimePrivatePropertyDescriptor struct {
	Name  string               `json:"name"`             
	Value *RuntimeRemoteObject `json:"value,omitempty"`  
	Get   *RuntimeRemoteObject `json:"get,omitempty"`    
	Set   *RuntimeRemoteObject `json:"set,omitempty"`    
}
type RuntimeCallArgument struct {
	Value               interface{} `json:"value,omitempty"`                
	UnserializableValue string      `json:"unserializableValue,omitempty"`  
	ObjectId            string      `json:"objectId,omitempty"`             
}
type RuntimeExecutionContextDescription struct {
	Id       int                    `json:"id"`                 
	Origin   string                 `json:"origin"`             
	Name     string                 `json:"name"`               
	UniqueId string                 `json:"uniqueId"`           
	AuxData  map[string]interface{} `json:"auxData,omitempty"`  
}
type RuntimeExceptionDetails struct {
	ExceptionId        int                  `json:"exceptionId"`                   
	Text               string               `json:"text"`                          
	LineNumber         int                  `json:"lineNumber"`                    
	ColumnNumber       int                  `json:"columnNumber"`                  
	ScriptId           string               `json:"scriptId,omitempty"`            
	Url                string               `json:"url,omitempty"`                 
	StackTrace         *RuntimeStackTrace   `json:"stackTrace,omitempty"`          
	Exception          *RuntimeRemoteObject `json:"exception,omitempty"`           
	ExecutionContextId int                  `json:"executionContextId,omitempty"`  
}
type RuntimeCallFrame struct {
	FunctionName string `json:"functionName"`  
	ScriptId     string `json:"scriptId"`      
	Url          string `json:"url"`           
	LineNumber   int    `json:"lineNumber"`    
	ColumnNumber int    `json:"columnNumber"`  
}
type RuntimeStackTrace struct {
	Description string               `json:"description,omitempty"`  
	CallFrames  []*RuntimeCallFrame  `json:"callFrames"`             
	Parent      *RuntimeStackTrace   `json:"parent,omitempty"`       
	ParentId    *RuntimeStackTraceId `json:"parentId,omitempty"`     
}
type RuntimeStackTraceId struct {
	Id         string `json:"id"`                    
	DebuggerId string `json:"debuggerId,omitempty"`  
}
type RuntimeBindingCalledEvent struct {
	Method string `json:"method"`
	Params struct {
		Name               string `json:"name"`                
		Payload            string `json:"payload"`             
		ExecutionContextId int    `json:"executionContextId"`  
	} `json:"Params,omitempty"`
}
type RuntimeConsoleAPICalledEvent struct {
	Method string `json:"method"`
	Params struct {
		Type               string                 `json:"type"`                  
		Args               []*RuntimeRemoteObject `json:"args"`                  
		ExecutionContextId int                    `json:"executionContextId"`    
		Timestamp          float64                `json:"timestamp"`             
		StackTrace         *RuntimeStackTrace     `json:"stackTrace,omitempty"`  
		Context            string                 `json:"context,omitempty"`     
	} `json:"Params,omitempty"`
}
type RuntimeExceptionRevokedEvent struct {
	Method string `json:"method"`
	Params struct {
		Reason      string `json:"reason"`       
		ExceptionId int    `json:"exceptionId"`  
	} `json:"Params,omitempty"`
}
type RuntimeExceptionThrownEvent struct {
	Method string `json:"method"`
	Params struct {
		Timestamp        float64                  `json:"timestamp"`         
		ExceptionDetails *RuntimeExceptionDetails `json:"exceptionDetails"`  
	} `json:"Params,omitempty"`
}
type RuntimeExecutionContextCreatedEvent struct {
	Method string `json:"method"`
	Params struct {
		Context *RuntimeExecutionContextDescription `json:"context"`  
	} `json:"Params,omitempty"`
}
type RuntimeExecutionContextDestroyedEvent struct {
	Method string `json:"method"`
	Params struct {
		ExecutionContextId int `json:"executionContextId"`  
	} `json:"Params,omitempty"`
}
type RuntimeInspectRequestedEvent struct {
	Method string `json:"method"`
	Params struct {
		Object *RuntimeRemoteObject   `json:"object"`  
		Hints  map[string]interface{} `json:"hints"`   
	} `json:"Params,omitempty"`
}
type Runtime struct {
	target gcdmessage.ChromeTargeter
}
func NewRuntime(target gcdmessage.ChromeTargeter) *Runtime {
	c := &Runtime{target: target}
	return c
}
type RuntimeAwaitPromiseParams struct {
	PromiseObjectId string `json:"promiseObjectId"`
	ReturnByValue bool `json:"returnByValue,omitempty"`
	GeneratePreview bool `json:"generatePreview,omitempty"`
}
func (c *Runtime) AwaitPromiseWithParams(ctx context.Context, v *RuntimeAwaitPromiseParams) (*RuntimeRemoteObject, *RuntimeExceptionDetails, error) {
	resp, err := c.target.SendCustomReturn(ctx, &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Runtime.awaitPromise", Params: v})
	if err != nil {
		return nil, nil, err
	}
	var chromeData struct {
		Result struct {
			Result           *RuntimeRemoteObject
			ExceptionDetails *RuntimeExceptionDetails
		}
	}
	if resp == nil {
		return nil, nil, &gcdmessage.ChromeEmptyResponseErr{}
	}
	cerr := &gcdmessage.ChromeErrorResponse{}
	json.Unmarshal(resp.Data, cerr)
	if cerr != nil && cerr.Error != nil {
		return nil, nil, &gcdmessage.ChromeRequestErr{Resp: cerr}
	}
	if err := json.Unmarshal(resp.Data, &chromeData); err != nil {
		return nil, nil, err
	}
	return chromeData.Result.Result, chromeData.Result.ExceptionDetails, nil
}
func (c *Runtime) AwaitPromise(ctx context.Context, promiseObjectId string, returnByValue bool, generatePreview bool) (*RuntimeRemoteObject, *RuntimeExceptionDetails, error) {
	var v RuntimeAwaitPromiseParams
	v.PromiseObjectId = promiseObjectId
	v.ReturnByValue = returnByValue
	v.GeneratePreview = generatePreview
	return c.AwaitPromiseWithParams(ctx, &v)
}
type RuntimeCallFunctionOnParams struct {
	FunctionDeclaration string `json:"functionDeclaration"`
	ObjectId string `json:"objectId,omitempty"`
	Arguments []*RuntimeCallArgument `json:"arguments,omitempty"`
	Silent bool `json:"silent,omitempty"`
	ReturnByValue bool `json:"returnByValue,omitempty"`
	GeneratePreview bool `json:"generatePreview,omitempty"`
	UserGesture bool `json:"userGesture,omitempty"`
	AwaitPromise bool `json:"awaitPromise,omitempty"`
	ExecutionContextId int `json:"executionContextId,omitempty"`
	ObjectGroup string `json:"objectGroup,omitempty"`
}
func (c *Runtime) CallFunctionOnWithParams(ctx context.Context, v *RuntimeCallFunctionOnParams) (*RuntimeRemoteObject, *RuntimeExceptionDetails, error) {
	resp, err := c.target.SendCustomReturn(ctx, &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Runtime.callFunctionOn", Params: v})
	if err != nil {
		return nil, nil, err
	}
	var chromeData struct {
		Result struct {
			Result           *RuntimeRemoteObject
			ExceptionDetails *RuntimeExceptionDetails
		}
	}
	if resp == nil {
		return nil, nil, &gcdmessage.ChromeEmptyResponseErr{}
	}
	cerr := &gcdmessage.ChromeErrorResponse{}
	json.Unmarshal(resp.Data, cerr)
	if cerr != nil && cerr.Error != nil {
		return nil, nil, &gcdmessage.ChromeRequestErr{Resp: cerr}
	}
	if err := json.Unmarshal(resp.Data, &chromeData); err != nil {
		return nil, nil, err
	}
	return chromeData.Result.Result, chromeData.Result.ExceptionDetails, nil
}
func (c *Runtime) CallFunctionOn(ctx context.Context, functionDeclaration string, objectId string, arguments []*RuntimeCallArgument, silent bool, returnByValue bool, generatePreview bool, userGesture bool, awaitPromise bool, executionContextId int, objectGroup string) (*RuntimeRemoteObject, *RuntimeExceptionDetails, error) {
	var v RuntimeCallFunctionOnParams
	v.FunctionDeclaration = functionDeclaration
	v.ObjectId = objectId
	v.Arguments = arguments
	v.Silent = silent
	v.ReturnByValue = returnByValue
	v.GeneratePreview = generatePreview
	v.UserGesture = userGesture
	v.AwaitPromise = awaitPromise
	v.ExecutionContextId = executionContextId
	v.ObjectGroup = objectGroup
	return c.CallFunctionOnWithParams(ctx, &v)
}
type RuntimeCompileScriptParams struct {
	Expression string `json:"expression"`
	SourceURL string `json:"sourceURL"`
	PersistScript bool `json:"persistScript"`
	ExecutionContextId int `json:"executionContextId,omitempty"`
}
func (c *Runtime) CompileScriptWithParams(ctx context.Context, v *RuntimeCompileScriptParams) (string, *RuntimeExceptionDetails, error) {
	resp, err := c.target.SendCustomReturn(ctx, &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Runtime.compileScript", Params: v})
	if err != nil {
		return "", nil, err
	}
	var chromeData struct {
		Result struct {
			ScriptId         string
			ExceptionDetails *RuntimeExceptionDetails
		}
	}
	if resp == nil {
		return "", nil, &gcdmessage.ChromeEmptyResponseErr{}
	}
	cerr := &gcdmessage.ChromeErrorResponse{}
	json.Unmarshal(resp.Data, cerr)
	if cerr != nil && cerr.Error != nil {
		return "", nil, &gcdmessage.ChromeRequestErr{Resp: cerr}
	}
	if err := json.Unmarshal(resp.Data, &chromeData); err != nil {
		return "", nil, err
	}
	return chromeData.Result.ScriptId, chromeData.Result.ExceptionDetails, nil
}
func (c *Runtime) CompileScript(ctx context.Context, expression string, sourceURL string, persistScript bool, executionContextId int) (string, *RuntimeExceptionDetails, error) {
	var v RuntimeCompileScriptParams
	v.Expression = expression
	v.SourceURL = sourceURL
	v.PersistScript = persistScript
	v.ExecutionContextId = executionContextId
	return c.CompileScriptWithParams(ctx, &v)
}
func (c *Runtime) Disable(ctx context.Context) (*gcdmessage.ChromeResponse, error) {
	return c.target.SendDefaultRequest(ctx, &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Runtime.disable"})
}