本文整理汇总了Golang中github.com/wirepair/gcd/gcdmessage.SendDefaultRequest函数的典型用法代码示例。如果您正苦于以下问题:Golang SendDefaultRequest函数的具体用法?Golang SendDefaultRequest怎么用?Golang SendDefaultRequest使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SendDefaultRequest函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: SetEffectivePropertyValueForNode
// SetEffectivePropertyValueForNode - Find a rule with the given active property for the given node and set the new value for this property
// nodeId - The element id for which to set property.
// propertyName -
// value -
func (c *CSS) SetEffectivePropertyValueForNode(nodeId int, propertyName string, value string) (*gcdmessage.ChromeResponse, error) {
paramRequest := make(map[string]interface{}, 3)
paramRequest["nodeId"] = nodeId
paramRequest["propertyName"] = propertyName
paramRequest["value"] = value
return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "CSS.setEffectivePropertyValueForNode", Params: paramRequest})
}
示例2: DeliverPushMessage
// DeliverPushMessage -
// origin -
// registrationId -
// data -
func (c *ServiceWorker) DeliverPushMessage(origin string, registrationId string, data string) (*gcdmessage.ChromeResponse, error) {
paramRequest := make(map[string]interface{}, 3)
paramRequest["origin"] = origin
paramRequest["registrationId"] = registrationId
paramRequest["data"] = data
return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "ServiceWorker.deliverPushMessage", Params: paramRequest})
}
示例3: SetDeviceOrientationOverride
// SetDeviceOrientationOverride - Overrides the Device Orientation.
// alpha - Mock alpha
// beta - Mock beta
// gamma - Mock gamma
func (c *Page) SetDeviceOrientationOverride(alpha float64, beta float64, gamma float64) (*gcdmessage.ChromeResponse, error) {
paramRequest := make(map[string]interface{}, 3)
paramRequest["alpha"] = alpha
paramRequest["beta"] = beta
paramRequest["gamma"] = gamma
return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Page.setDeviceOrientationOverride", Params: paramRequest})
}
示例4: SetGeolocationOverride
// SetGeolocationOverride - Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position unavailable.
// latitude - Mock latitude
// longitude - Mock longitude
// accuracy - Mock accuracy
func (c *Page) SetGeolocationOverride(latitude float64, longitude float64, accuracy float64) (*gcdmessage.ChromeResponse, error) {
paramRequest := make(map[string]interface{}, 3)
paramRequest["latitude"] = latitude
paramRequest["longitude"] = longitude
paramRequest["accuracy"] = accuracy
return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Page.setGeolocationOverride", Params: paramRequest})
}
示例5: HighlightFrame
// HighlightFrame - Highlights owner element of the frame with given id.
// frameId - Identifier of the frame to highlight.
// contentColor - The content box highlight fill color (default: transparent).
// contentOutlineColor - The content box highlight outline color (default: transparent).
func (c *DOM) HighlightFrame(frameId string, contentColor *DOMRGBA, contentOutlineColor *DOMRGBA) (*gcdmessage.ChromeResponse, error) {
paramRequest := make(map[string]interface{}, 3)
paramRequest["frameId"] = frameId
paramRequest["contentColor"] = contentColor
paramRequest["contentOutlineColor"] = contentOutlineColor
return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "DOM.highlightFrame", Params: paramRequest})
}
示例6: HighlightQuad
// HighlightQuad - Highlights given quad. Coordinates are absolute with respect to the main frame viewport.
// quad - Quad to highlight
// color - The highlight fill color (default: transparent).
// outlineColor - The highlight outline color (default: transparent).
func (c *DOM) HighlightQuad(quad float64, color *DOMRGBA, outlineColor *DOMRGBA) (*gcdmessage.ChromeResponse, error) {
paramRequest := make(map[string]interface{}, 3)
paramRequest["quad"] = quad
paramRequest["color"] = color
paramRequest["outlineColor"] = outlineColor
return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "DOM.highlightQuad", Params: paramRequest})
}
示例7: ClearObjectStore
// ClearObjectStore - Clears all entries from an object store.
// securityOrigin - Security origin.
// databaseName - Database name.
// objectStoreName - Object store name.
func (c *IndexedDB) ClearObjectStore(securityOrigin string, databaseName string, objectStoreName string) (*gcdmessage.ChromeResponse, error) {
paramRequest := make(map[string]interface{}, 3)
paramRequest["securityOrigin"] = securityOrigin
paramRequest["databaseName"] = databaseName
paramRequest["objectStoreName"] = objectStoreName
return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "IndexedDB.clearObjectStore", Params: paramRequest})
}
示例8: SetAttributesAsText
// SetAttributesAsText - Sets attributes on element with given id. This method is useful when user edits some existing attribute value and types in several attribute name/value pairs.
// nodeId - Id of the element to set attributes for.
// text - Text with a number of attributes. Will parse this text using HTML parser.
// name - Attribute name to replace with new attributes derived from text in case text parsed successfully.
func (c *DOM) SetAttributesAsText(nodeId int, text string, name string) (*gcdmessage.ChromeResponse, error) {
paramRequest := make(map[string]interface{}, 3)
paramRequest["nodeId"] = nodeId
paramRequest["text"] = text
paramRequest["name"] = name
return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "DOM.setAttributesAsText", Params: paramRequest})
}
示例9: SetTiming
// SetTiming - Sets the timing of an animation node.
// playerId - AnimationPlayer id.
// duration - Duration of the animation.
// delay - Delay of the animation.
func (c *Animation) SetTiming(playerId string, duration float64, delay float64) (*gcdmessage.ChromeResponse, error) {
paramRequest := make(map[string]interface{}, 3)
paramRequest["playerId"] = playerId
paramRequest["duration"] = duration
paramRequest["delay"] = delay
return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Animation.setTiming", Params: paramRequest})
}
示例10: SetDOMStorageItem
// SetDOMStorageItem -
// storageId -
// key -
// value -
func (c *DOMStorage) SetDOMStorageItem(storageId *DOMStorageStorageId, key string, value string) (*gcdmessage.ChromeResponse, error) {
paramRequest := make(map[string]interface{}, 3)
paramRequest["storageId"] = storageId
paramRequest["key"] = key
paramRequest["value"] = value
return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "DOMStorage.setDOMStorageItem", Params: paramRequest})
}
示例11: HighlightNode
// HighlightNode - Highlights DOM node with given id or with the given JavaScript object wrapper. Either nodeId or objectId must be specified.
// highlightConfig - A descriptor for the highlight appearance.
// nodeId - Identifier of the node to highlight.
// backendNodeId - Identifier of the backend node to highlight.
// objectId - JavaScript object id of the node to be highlighted.
func (c *DOM) HighlightNode(highlightConfig *DOMHighlightConfig, nodeId int, backendNodeId int, objectId string) (*gcdmessage.ChromeResponse, error) {
paramRequest := make(map[string]interface{}, 4)
paramRequest["highlightConfig"] = highlightConfig
paramRequest["nodeId"] = nodeId
paramRequest["backendNodeId"] = backendNodeId
paramRequest["objectId"] = objectId
return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "DOM.highlightNode", Params: paramRequest})
}
示例12: Start
// Start - Start trace events collection.
// categories - Category/tag filter
// options - Tracing options
// bufferUsageReportingInterval - If set, the agent will issue bufferUsage events at this interval, specified in milliseconds
// transferMode - Whether to report trace events as series of dataCollected events or to save trace to a stream (defaults to <code>ReportEvents</code>).
func (c *Tracing) Start(categories string, options string, bufferUsageReportingInterval float64, transferMode string) (*gcdmessage.ChromeResponse, error) {
paramRequest := make(map[string]interface{}, 4)
paramRequest["categories"] = categories
paramRequest["options"] = options
paramRequest["bufferUsageReportingInterval"] = bufferUsageReportingInterval
paramRequest["transferMode"] = transferMode
return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Tracing.start", Params: paramRequest})
}
示例13: DispatchTouchEvent
// DispatchTouchEvent - Dispatches a touch event to the page.
// type - Type of the touch event.
// touchPoints - Touch points.
// modifiers - Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
// timestamp - Time at which the event occurred. Measured in UTC time in seconds since January 1, 1970 (default: current time).
func (c *Input) DispatchTouchEvent(theType string, touchPoints *InputTouchPoint, modifiers int, timestamp float64) (*gcdmessage.ChromeResponse, error) {
paramRequest := make(map[string]interface{}, 4)
paramRequest["type"] = theType
paramRequest["touchPoints"] = touchPoints
paramRequest["modifiers"] = modifiers
paramRequest["timestamp"] = timestamp
return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Input.dispatchTouchEvent", Params: paramRequest})
}
示例14: StartScreencast
// StartScreencast - Starts sending each frame using the <code>screencastFrame</code> event.
// format - Image compression format.
// quality - Compression quality from range [0..100].
// maxWidth - Maximum screenshot width.
// maxHeight - Maximum screenshot height.
func (c *Page) StartScreencast(format string, quality int, maxWidth int, maxHeight int) (*gcdmessage.ChromeResponse, error) {
paramRequest := make(map[string]interface{}, 4)
paramRequest["format"] = format
paramRequest["quality"] = quality
paramRequest["maxWidth"] = maxWidth
paramRequest["maxHeight"] = maxHeight
return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Page.startScreencast", Params: paramRequest})
}
示例15: EmulateNetworkConditions
// EmulateNetworkConditions - Activates emulation of network conditions.
// offline - True to emulate internet disconnection.
// latency - Additional latency (ms).
// downloadThroughput - Maximal aggregated download throughput.
// uploadThroughput - Maximal aggregated upload throughput.
func (c *Network) EmulateNetworkConditions(offline bool, latency float64, downloadThroughput float64, uploadThroughput float64) (*gcdmessage.ChromeResponse, error) {
paramRequest := make(map[string]interface{}, 4)
paramRequest["offline"] = offline
paramRequest["latency"] = latency
paramRequest["downloadThroughput"] = downloadThroughput
paramRequest["uploadThroughput"] = uploadThroughput
return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Network.emulateNetworkConditions", Params: paramRequest})
}