コード例 #1
0
ファイル: css.go プロジェクト: stanleyhlng/gcd
// 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
0
ファイル: serviceworker.go プロジェクト: stanleyhlng/gcd
// 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
0
ファイル: page.go プロジェクト: stanleyhlng/gcd
// 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
0
ファイル: page.go プロジェクト: stanleyhlng/gcd
// 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
0
ファイル: dom.go プロジェクト: stanleyhlng/gcd
// 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
0
ファイル: dom.go プロジェクト: stanleyhlng/gcd
// 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
0
ファイル: indexeddb.go プロジェクト: stanleyhlng/gcd
// 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
0
ファイル: dom.go プロジェクト: stanleyhlng/gcd
// 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
0
ファイル: animation.go プロジェクト: stanleyhlng/gcd
// 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
0
ファイル: domstorage.go プロジェクト: stanleyhlng/gcd
// 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
0
ファイル: dom.go プロジェクト: stanleyhlng/gcd
// 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
0
ファイル: tracing.go プロジェクト: stanleyhlng/gcd
// 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
0
ファイル: input.go プロジェクト: stanleyhlng/gcd
// 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
0
ファイル: page.go プロジェクト: stanleyhlng/gcd
// 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
0
ファイル: network.go プロジェクト: stanleyhlng/gcd
// 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})
}
コード例 #16
0
ファイル: timeline.go プロジェクト: stanleyhlng/gcd
// Start - Deprecated.
// maxCallStackDepth - Samples JavaScript stack traces up to <code>maxCallStackDepth</code>, defaults to 5.
// bufferEvents - Whether instrumentation events should be buffered and returned upon <code>stop</code> call.
// liveEvents - Coma separated event types to issue although bufferEvents is set.
// includeCounters - Whether counters data should be included into timeline events.
// includeGPUEvents - Whether events from GPU process should be collected.
func (c *Timeline) Start(maxCallStackDepth int, bufferEvents bool, liveEvents string, includeCounters bool, includeGPUEvents bool) (*gcdmessage.ChromeResponse, error) {
	paramRequest := make(map[string]interface{}, 5)
	paramRequest["maxCallStackDepth"] = maxCallStackDepth
	paramRequest["bufferEvents"] = bufferEvents
	paramRequest["liveEvents"] = liveEvents
	paramRequest["includeCounters"] = includeCounters
	paramRequest["includeGPUEvents"] = includeGPUEvents
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Timeline.start", Params: paramRequest})
}
コード例 #17
0
ファイル: debugger.go プロジェクト: stanleyhlng/gcd
// SetVariableValue - Changes value of variable in a callframe or a closure. Either callframe or function must be specified. Object-based scopes are not supported and must be mutated manually.
// scopeNumber - 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually.
// variableName - Variable name.
// newValue - New variable value.
// callFrameId - Id of callframe that holds variable.
// functionObjectId - Object id of closure (function) that holds variable.
func (c *Debugger) SetVariableValue(scopeNumber int, variableName string, newValue *RuntimeCallArgument, callFrameId string, functionObjectId string) (*gcdmessage.ChromeResponse, error) {
	paramRequest := make(map[string]interface{}, 5)
	paramRequest["scopeNumber"] = scopeNumber
	paramRequest["variableName"] = variableName
	paramRequest["newValue"] = newValue
	paramRequest["callFrameId"] = callFrameId
	paramRequest["functionObjectId"] = functionObjectId
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Debugger.setVariableValue", Params: paramRequest})
}
コード例 #18
0
ファイル: input.go プロジェクト: stanleyhlng/gcd
// SynthesizeTapGesture - Synthesizes a tap gesture over a time period by issuing appropriate touch events.
// x - X coordinate of the start of the gesture in CSS pixels.
// y - Y coordinate of the start of the gesture in CSS pixels.
// duration - Duration between touchdown and touchup events in ms (default: 50).
// tapCount - Number of times to perform the tap (e.g. 2 for double tap, default: 1).
// gestureSourceType - Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type). enum values: default, touch, mouse
func (c *Input) SynthesizeTapGesture(x int, y int, duration int, tapCount int, gestureSourceType string) (*gcdmessage.ChromeResponse, error) {
	paramRequest := make(map[string]interface{}, 5)
	paramRequest["x"] = x
	paramRequest["y"] = y
	paramRequest["duration"] = duration
	paramRequest["tapCount"] = tapCount
	paramRequest["gestureSourceType"] = gestureSourceType
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Input.synthesizeTapGesture", Params: paramRequest})
}
コード例 #19
0
ファイル: input.go プロジェクト: stanleyhlng/gcd
// SynthesizePinchGesture - Synthesizes a pinch gesture over a time period by issuing appropriate touch events.
// x - X coordinate of the start of the gesture in CSS pixels.
// y - Y coordinate of the start of the gesture in CSS pixels.
// scaleFactor - Relative scale factor after zooming (>1.0 zooms in, <1.0 zooms out).
// relativeSpeed - Relative pointer speed in pixels per second (default: 800).
// gestureSourceType - Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type). enum values: default, touch, mouse
func (c *Input) SynthesizePinchGesture(x int, y int, scaleFactor float64, relativeSpeed int, gestureSourceType string) (*gcdmessage.ChromeResponse, error) {
	paramRequest := make(map[string]interface{}, 5)
	paramRequest["x"] = x
	paramRequest["y"] = y
	paramRequest["scaleFactor"] = scaleFactor
	paramRequest["relativeSpeed"] = relativeSpeed
	paramRequest["gestureSourceType"] = gestureSourceType
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Input.synthesizePinchGesture", Params: paramRequest})
}
コード例 #20
0
ファイル: dom.go プロジェクト: stanleyhlng/gcd
// HighlightRect - Highlights given rectangle. Coordinates are absolute with respect to the main frame viewport.
// x - X coordinate
// y - Y coordinate
// width - Rectangle width
// height - Rectangle height
// color - The highlight fill color (default: transparent).
// outlineColor - The highlight outline color (default: transparent).
func (c *DOM) HighlightRect(x int, y int, width int, height int, color *DOMRGBA, outlineColor *DOMRGBA) (*gcdmessage.ChromeResponse, error) {
	paramRequest := make(map[string]interface{}, 6)
	paramRequest["x"] = x
	paramRequest["y"] = y
	paramRequest["width"] = width
	paramRequest["height"] = height
	paramRequest["color"] = color
	paramRequest["outlineColor"] = outlineColor
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "DOM.highlightRect", Params: paramRequest})
}
コード例 #21
0
ファイル: input.go プロジェクト: stanleyhlng/gcd
// DispatchMouseEvent - Dispatches a mouse event to the page.
// type - Type of the mouse event.
// x - X coordinate of the event relative to the main frame's viewport.
// y - Y coordinate of the event relative to the main frame's viewport. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport.
// 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).
// button - Mouse button (default: "none").
// clickCount - Number of times the mouse button was clicked (default: 0).
func (c *Input) DispatchMouseEvent(theType string, x int, y int, modifiers int, timestamp float64, button string, clickCount int) (*gcdmessage.ChromeResponse, error) {
	paramRequest := make(map[string]interface{}, 7)
	paramRequest["type"] = theType
	paramRequest["x"] = x
	paramRequest["y"] = y
	paramRequest["modifiers"] = modifiers
	paramRequest["timestamp"] = timestamp
	paramRequest["button"] = button
	paramRequest["clickCount"] = clickCount
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Input.dispatchMouseEvent", Params: paramRequest})
}
コード例 #22
0
ファイル: input.go プロジェクト: stanleyhlng/gcd
// SynthesizeScrollGesture - Synthesizes a scroll gesture over a time period by issuing appropriate touch events.
// x - X coordinate of the start of the gesture in CSS pixels.
// y - Y coordinate of the start of the gesture in CSS pixels.
// xDistance - The distance to scroll along the X axis (positive to scroll left).
// yDistance - The distance to scroll along the Y axis (positive to scroll up).
// xOverscroll - The number of additional pixels to scroll back along the X axis, in addition to the given distance.
// yOverscroll - The number of additional pixels to scroll back along the Y axis, in addition to the given distance.
// preventFling - Prevent fling (default: true).
// speed - Swipe speed in pixels per second (default: 800).
// gestureSourceType - Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type). enum values: default, touch, mouse
// repeatCount - The number of times to repeat the gesture (default: 0).
// repeatDelayMs - The number of milliseconds delay between each repeat. (default: 250).
// interactionMarkerName - The name of the interaction markers to generate, if not empty (default: "").
func (c *Input) SynthesizeScrollGesture(x int, y int, xDistance int, yDistance int, xOverscroll int, yOverscroll int, preventFling bool, speed int, gestureSourceType string, repeatCount int, repeatDelayMs int, interactionMarkerName string) (*gcdmessage.ChromeResponse, error) {
	paramRequest := make(map[string]interface{}, 12)
	paramRequest["x"] = x
	paramRequest["y"] = y
	paramRequest["xDistance"] = xDistance
	paramRequest["yDistance"] = yDistance
	paramRequest["xOverscroll"] = xOverscroll
	paramRequest["yOverscroll"] = yOverscroll
	paramRequest["preventFling"] = preventFling
	paramRequest["speed"] = speed
	paramRequest["gestureSourceType"] = gestureSourceType
	paramRequest["repeatCount"] = repeatCount
	paramRequest["repeatDelayMs"] = repeatDelayMs
	paramRequest["interactionMarkerName"] = interactionMarkerName
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Input.synthesizeScrollGesture", Params: paramRequest})
}
コード例 #23
0
ファイル: page.go プロジェクト: stanleyhlng/gcd
// SetDeviceMetricsOverride - Overrides the values of device screen dimensions (window.screen.width, window.screen.height, window.innerWidth, window.innerHeight, and "device-width"/"device-height"-related CSS media query results).
// width - Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.
// height - Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.
// deviceScaleFactor - Overriding device scale factor value. 0 disables the override.
// mobile - Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text autosizing and more.
// fitWindow - Whether a view that exceeds the available browser window area should be scaled down to fit.
// scale - Scale to apply to resulting view image. Ignored in |fitWindow| mode.
// offsetX - X offset to shift resulting view image by. Ignored in |fitWindow| mode.
// offsetY - Y offset to shift resulting view image by. Ignored in |fitWindow| mode.
// screenWidth - Overriding screen width value in pixels (minimum 0, maximum 10000000). Only used for |mobile==true|.
// screenHeight - Overriding screen height value in pixels (minimum 0, maximum 10000000). Only used for |mobile==true|.
// positionX - Overriding view X position on screen in pixels (minimum 0, maximum 10000000). Only used for |mobile==true|.
// positionY - Overriding view Y position on screen in pixels (minimum 0, maximum 10000000). Only used for |mobile==true|.
func (c *Page) SetDeviceMetricsOverride(width int, height int, deviceScaleFactor float64, mobile bool, fitWindow bool, scale float64, offsetX float64, offsetY float64, screenWidth int, screenHeight int, positionX int, positionY int) (*gcdmessage.ChromeResponse, error) {
	paramRequest := make(map[string]interface{}, 12)
	paramRequest["width"] = width
	paramRequest["height"] = height
	paramRequest["deviceScaleFactor"] = deviceScaleFactor
	paramRequest["mobile"] = mobile
	paramRequest["fitWindow"] = fitWindow
	paramRequest["scale"] = scale
	paramRequest["offsetX"] = offsetX
	paramRequest["offsetY"] = offsetY
	paramRequest["screenWidth"] = screenWidth
	paramRequest["screenHeight"] = screenHeight
	paramRequest["positionX"] = positionX
	paramRequest["positionY"] = positionY
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Page.setDeviceMetricsOverride", Params: paramRequest})
}
コード例 #24
0
ファイル: input.go プロジェクト: stanleyhlng/gcd
// DispatchKeyEvent - Dispatches a key event to the page.
// type - Type of the key event.
// 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).
// text - Text as generated by processing a virtual key code with a keyboard layout. Not needed for for <code>keyUp</code> and <code>rawKeyDown</code> events (default: "")
// unmodifiedText - Text that would have been generated by the keyboard if no modifiers were pressed (except for shift). Useful for shortcut (accelerator) key handling (default: "").
// keyIdentifier - Unique key identifier (e.g., 'U+0041') (default: "").
// code - Unique DOM defined string value for each physical key (e.g., 'KeyA') (default: "").
// key - Unique DOM defined string value describing the meaning of the key in the context of active modifiers, keyboard layout, etc (e.g., 'AltGr') (default: "").
// windowsVirtualKeyCode - Windows virtual key code (default: 0).
// nativeVirtualKeyCode - Native virtual key code (default: 0).
// autoRepeat - Whether the event was generated from auto repeat (default: false).
// isKeypad - Whether the event was generated from the keypad (default: false).
// isSystemKey - Whether the event was a system key event (default: false).
func (c *Input) DispatchKeyEvent(theType string, modifiers int, timestamp float64, text string, unmodifiedText string, keyIdentifier string, code string, key string, windowsVirtualKeyCode int, nativeVirtualKeyCode int, autoRepeat bool, isKeypad bool, isSystemKey bool) (*gcdmessage.ChromeResponse, error) {
	paramRequest := make(map[string]interface{}, 13)
	paramRequest["type"] = theType
	paramRequest["modifiers"] = modifiers
	paramRequest["timestamp"] = timestamp
	paramRequest["text"] = text
	paramRequest["unmodifiedText"] = unmodifiedText
	paramRequest["keyIdentifier"] = keyIdentifier
	paramRequest["code"] = code
	paramRequest["key"] = key
	paramRequest["windowsVirtualKeyCode"] = windowsVirtualKeyCode
	paramRequest["nativeVirtualKeyCode"] = nativeVirtualKeyCode
	paramRequest["autoRepeat"] = autoRepeat
	paramRequest["isKeypad"] = isKeypad
	paramRequest["isSystemKey"] = isSystemKey
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Input.dispatchKeyEvent", Params: paramRequest})
}
コード例 #25
0
ファイル: security.go プロジェクト: stanleyhlng/gcd
// Disables tracking security state changes.
func (c *Security) Disable() (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Security.disable"})
}
コード例 #26
0
ファイル: network.go プロジェクト: stanleyhlng/gcd
// ShowCertificateViewer - Displays native dialog with the certificate details.
// certificateId - Certificate id.
func (c *Network) ShowCertificateViewer(certificateId int) (*gcdmessage.ChromeResponse, error) {
	paramRequest := make(map[string]interface{}, 1)
	paramRequest["certificateId"] = certificateId
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Network.showCertificateViewer", Params: paramRequest})
}
コード例 #27
0
ファイル: network.go プロジェクト: stanleyhlng/gcd
// SetDataSizeLimitsForTest - For testing.
// maxTotalSize - Maximum total buffer size.
// maxResourceSize - Maximum per-resource size.
func (c *Network) SetDataSizeLimitsForTest(maxTotalSize int, maxResourceSize int) (*gcdmessage.ChromeResponse, error) {
	paramRequest := make(map[string]interface{}, 2)
	paramRequest["maxTotalSize"] = maxTotalSize
	paramRequest["maxResourceSize"] = maxResourceSize
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Network.setDataSizeLimitsForTest", Params: paramRequest})
}
コード例 #28
0
ファイル: network.go プロジェクト: stanleyhlng/gcd
// SetCacheDisabled - Toggles ignoring cache for each request. If <code>true</code>, cache will not be used.
// cacheDisabled - Cache disabled state.
func (c *Network) SetCacheDisabled(cacheDisabled bool) (*gcdmessage.ChromeResponse, error) {
	paramRequest := make(map[string]interface{}, 1)
	paramRequest["cacheDisabled"] = cacheDisabled
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Network.setCacheDisabled", Params: paramRequest})
}
コード例 #29
0
ファイル: network.go プロジェクト: stanleyhlng/gcd
// DeleteCookie - Deletes browser cookie with given name, domain and path.
// cookieName - Name of the cookie to remove.
// url - URL to match cooke domain and path.
func (c *Network) DeleteCookie(cookieName string, url string) (*gcdmessage.ChromeResponse, error) {
	paramRequest := make(map[string]interface{}, 2)
	paramRequest["cookieName"] = cookieName
	paramRequest["url"] = url
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Network.deleteCookie", Params: paramRequest})
}
コード例 #30
0
ファイル: network.go プロジェクト: stanleyhlng/gcd
// Clears browser cookies.
func (c *Network) ClearBrowserCookies() (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Network.clearBrowserCookies"})
}