Skip to content

Commit

Permalink
Merge pull request #28 from wirepair/fix_merge
Browse files Browse the repository at this point in the history
fix bad merge
  • Loading branch information
wirepair authored Apr 19, 2020
2 parents defeaa0 + f0e134a commit 80ce877
Show file tree
Hide file tree
Showing 17 changed files with 5 additions and 258 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Changelog (2020)

- April 19th: Fix bad merge
- April 19th: Move to go modules, remove vendor directory. Fix gcdapigen to output version properly. Updated to latest gcd / protocol.json file for 81.0.4044.113

# Changelog (2019)
Expand Down
2 changes: 1 addition & 1 deletion gcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (
"github.com/wirepair/gcd/gcdapi"
)

var GCDVERSION = "v1.0.8"
var GCDVERSION = "v1.0.9"

var (
ErrNoTabAvailable = errors.New("no available tab found")
Expand Down
40 changes: 0 additions & 40 deletions gcdapi/backgroundservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ type BackgroundServiceBackgroundServiceEvent struct {
Timestamp float64 `json:"timestamp"` // Timestamp of the event (in seconds).
Origin string `json:"origin"` // The origin this event belongs to.
ServiceWorkerRegistrationId string `json:"serviceWorkerRegistrationId"` // The Service Worker ID that initiated the event.
<<<<<<< HEAD
Service string `json:"service"` // The Background Service this event belongs to. enum values: backgroundFetch, backgroundSync, pushMessaging, notifications, paymentHandler, periodicBackgroundSync
=======
Service string `json:"service"` // The Background Service this event belongs to. enum values: backgroundFetch, backgroundSync, pushMessaging, notifications, paymentHandler
>>>>>>> master
EventName string `json:"eventName"` // A description of the event.
InstanceId string `json:"instanceId"` // An identifier that groups related events together.
EventMetadata []*BackgroundServiceEventMetadata `json:"eventMetadata"` // A list of event-specific information.
Expand All @@ -34,11 +30,7 @@ type BackgroundServiceRecordingStateChangedEvent struct {
Method string `json:"method"`
Params struct {
IsRecording bool `json:"isRecording"` //
<<<<<<< HEAD
Service string `json:"service"` // enum values: backgroundFetch, backgroundSync, pushMessaging, notifications, paymentHandler, periodicBackgroundSync
=======
Service string `json:"service"` // enum values: backgroundFetch, backgroundSync, pushMessaging, notifications, paymentHandler
>>>>>>> master
} `json:"Params,omitempty"`
}

Expand All @@ -60,11 +52,7 @@ func NewBackgroundService(target gcdmessage.ChromeTargeter) *BackgroundService {
}

type BackgroundServiceStartObservingParams struct {
<<<<<<< HEAD
// enum values: backgroundFetch, backgroundSync, pushMessaging, notifications, paymentHandler, periodicBackgroundSync
=======
// enum values: backgroundFetch, backgroundSync, pushMessaging, notifications, paymentHandler
>>>>>>> master
Service string `json:"service"`
}

Expand All @@ -74,23 +62,15 @@ func (c *BackgroundService) StartObservingWithParams(v *BackgroundServiceStartOb
}

// StartObserving - Enables event updates for the service.
<<<<<<< HEAD
// service - enum values: backgroundFetch, backgroundSync, pushMessaging, notifications, paymentHandler, periodicBackgroundSync
=======
// service - enum values: backgroundFetch, backgroundSync, pushMessaging, notifications, paymentHandler
>>>>>>> master
func (c *BackgroundService) StartObserving(service string) (*gcdmessage.ChromeResponse, error) {
var v BackgroundServiceStartObservingParams
v.Service = service
return c.StartObservingWithParams(&v)
}

type BackgroundServiceStopObservingParams struct {
<<<<<<< HEAD
// enum values: backgroundFetch, backgroundSync, pushMessaging, notifications, paymentHandler, periodicBackgroundSync
=======
// enum values: backgroundFetch, backgroundSync, pushMessaging, notifications, paymentHandler
>>>>>>> master
Service string `json:"service"`
}

Expand All @@ -100,11 +80,7 @@ func (c *BackgroundService) StopObservingWithParams(v *BackgroundServiceStopObse
}

// StopObserving - Disables event updates for the service.
<<<<<<< HEAD
// service - enum values: backgroundFetch, backgroundSync, pushMessaging, notifications, paymentHandler, periodicBackgroundSync
=======
// service - enum values: backgroundFetch, backgroundSync, pushMessaging, notifications, paymentHandler
>>>>>>> master
func (c *BackgroundService) StopObserving(service string) (*gcdmessage.ChromeResponse, error) {
var v BackgroundServiceStopObservingParams
v.Service = service
Expand All @@ -114,11 +90,7 @@ func (c *BackgroundService) StopObserving(service string) (*gcdmessage.ChromeRes
type BackgroundServiceSetRecordingParams struct {
//
ShouldRecord bool `json:"shouldRecord"`
<<<<<<< HEAD
// enum values: backgroundFetch, backgroundSync, pushMessaging, notifications, paymentHandler, periodicBackgroundSync
=======
// enum values: backgroundFetch, backgroundSync, pushMessaging, notifications, paymentHandler
>>>>>>> master
Service string `json:"service"`
}

Expand All @@ -129,11 +101,7 @@ func (c *BackgroundService) SetRecordingWithParams(v *BackgroundServiceSetRecord

// SetRecording - Set the recording state for the service.
// shouldRecord -
<<<<<<< HEAD
// service - enum values: backgroundFetch, backgroundSync, pushMessaging, notifications, paymentHandler, periodicBackgroundSync
=======
// service - enum values: backgroundFetch, backgroundSync, pushMessaging, notifications, paymentHandler
>>>>>>> master
func (c *BackgroundService) SetRecording(shouldRecord bool, service string) (*gcdmessage.ChromeResponse, error) {
var v BackgroundServiceSetRecordingParams
v.ShouldRecord = shouldRecord
Expand All @@ -142,11 +110,7 @@ func (c *BackgroundService) SetRecording(shouldRecord bool, service string) (*gc
}

type BackgroundServiceClearEventsParams struct {
<<<<<<< HEAD
// enum values: backgroundFetch, backgroundSync, pushMessaging, notifications, paymentHandler, periodicBackgroundSync
=======
// enum values: backgroundFetch, backgroundSync, pushMessaging, notifications, paymentHandler
>>>>>>> master
Service string `json:"service"`
}

Expand All @@ -156,11 +120,7 @@ func (c *BackgroundService) ClearEventsWithParams(v *BackgroundServiceClearEvent
}

// ClearEvents - Clears all stored data for the service.
<<<<<<< HEAD
// service - enum values: backgroundFetch, backgroundSync, pushMessaging, notifications, paymentHandler, periodicBackgroundSync
=======
// service - enum values: backgroundFetch, backgroundSync, pushMessaging, notifications, paymentHandler
>>>>>>> master
func (c *BackgroundService) ClearEvents(service string) (*gcdmessage.ChromeResponse, error) {
var v BackgroundServiceClearEventsParams
v.Service = service
Expand Down
11 changes: 0 additions & 11 deletions gcdapi/browser.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,7 @@ func (c *Browser) SetPermission(permission *BrowserPermissionDescriptor, setting
}

type BrowserGrantPermissionsParams struct {
<<<<<<< HEAD
// enum values: accessibilityEvents, audioCapture, backgroundSync, backgroundFetch, clipboardReadWrite, clipboardSanitizedWrite, durableStorage, flash, geolocation, midi, midiSysex, nfc, notifications, paymentHandler, periodicBackgroundSync, protectedMediaIdentifier, sensors, videoCapture, idleDetection, wakeLockScreen, wakeLockSystem
=======
//
Origin string `json:"origin"`
// enum values: accessibilityEvents, audioCapture, backgroundSync, backgroundFetch, clipboardRead, clipboardWrite, durableStorage, flash, geolocation, midi, midiSysex, notifications, paymentHandler, periodicBackgroundSync, protectedMediaIdentifier, sensors, videoCapture, idleDetection, wakeLockScreen, wakeLockSystem
>>>>>>> master
Permissions []string `json:"permissions"`
// Origin the permission applies to, all origins if not specified.
Origin string `json:"origin,omitempty"`
Expand All @@ -102,13 +96,8 @@ func (c *Browser) GrantPermissionsWithParams(v *BrowserGrantPermissionsParams) (
}

// GrantPermissions - Grant specific permissions to the given origin and reject all others.
<<<<<<< HEAD
// permissions - enum values: accessibilityEvents, audioCapture, backgroundSync, backgroundFetch, clipboardReadWrite, clipboardSanitizedWrite, durableStorage, flash, geolocation, midi, midiSysex, nfc, notifications, paymentHandler, periodicBackgroundSync, protectedMediaIdentifier, sensors, videoCapture, idleDetection, wakeLockScreen, wakeLockSystem
// origin - Origin the permission applies to, all origins if not specified.
=======
// origin -
// permissions - enum values: accessibilityEvents, audioCapture, backgroundSync, backgroundFetch, clipboardRead, clipboardWrite, durableStorage, flash, geolocation, midi, midiSysex, notifications, paymentHandler, periodicBackgroundSync, protectedMediaIdentifier, sensors, videoCapture, idleDetection, wakeLockScreen, wakeLockSystem
>>>>>>> master
// browserContextId - BrowserContext to override permissions. When omitted, default browser context is used.
func (c *Browser) GrantPermissions(permissions []string, origin string, browserContextId string) (*gcdmessage.ChromeResponse, error) {
var v BrowserGrantPermissionsParams
Expand Down
13 changes: 0 additions & 13 deletions gcdapi/dom.go
Original file line number Diff line number Diff line change
Expand Up @@ -721,13 +721,8 @@ type DOMGetNodeForLocationParams struct {
}

// GetNodeForLocationWithParams - Returns node id at given location. Depending on whether DOM domain is enabled, nodeId is either returned or not.
<<<<<<< HEAD
// Returns - backendNodeId - Resulting node. frameId - Frame this node belongs to. nodeId - Id of the node at given coordinates, only when enabled and requested document.
func (c *DOM) GetNodeForLocationWithParams(v *DOMGetNodeForLocationParams) (int, string, int, error) {
=======
// Returns - backendNodeId - Resulting node. nodeId - Id of the node at given coordinates, only when enabled and requested document.
func (c *DOM) GetNodeForLocationWithParams(v *DOMGetNodeForLocationParams) (int, int, error) {
>>>>>>> master
resp, err := gcdmessage.SendCustomReturn(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "DOM.getNodeForLocation", Params: v})
if err != nil {
return 0, "", 0, err
Expand Down Expand Up @@ -763,14 +758,9 @@ func (c *DOM) GetNodeForLocationWithParams(v *DOMGetNodeForLocationParams) (int,
// x - X coordinate.
// y - Y coordinate.
// includeUserAgentShadowDOM - False to skip to the nearest non-UA shadow root ancestor (default: false).
<<<<<<< HEAD
// ignorePointerEventsNone - Whether to ignore pointer-events: none on elements and hit test them.
// Returns - backendNodeId - Resulting node. frameId - Frame this node belongs to. nodeId - Id of the node at given coordinates, only when enabled and requested document.
func (c *DOM) GetNodeForLocation(x int, y int, includeUserAgentShadowDOM bool, ignorePointerEventsNone bool) (int, string, int, error) {
=======
// Returns - backendNodeId - Resulting node. nodeId - Id of the node at given coordinates, only when enabled and requested document.
func (c *DOM) GetNodeForLocation(x int, y int, includeUserAgentShadowDOM bool) (int, int, error) {
>>>>>>> master
var v DOMGetNodeForLocationParams
v.X = x
v.Y = y
Expand Down Expand Up @@ -1507,7 +1497,6 @@ func (c *DOM) SetFileInputFiles(files []string, nodeId int, backendNodeId int, o
return c.SetFileInputFilesWithParams(&v)
}

<<<<<<< HEAD
type DOMSetNodeStackTracesEnabledParams struct {
// Enable or disable.
Enable bool `json:"enable"`
Expand Down Expand Up @@ -1572,8 +1561,6 @@ func (c *DOM) GetNodeStackTraces(nodeId int) (*RuntimeStackTrace, error) {
return c.GetNodeStackTracesWithParams(&v)
}

=======
>>>>>>> master
type DOMGetFileInfoParams struct {
// JavaScript object id of the node wrapper.
ObjectId string `json:"objectId"`
Expand Down
17 changes: 0 additions & 17 deletions gcdapi/domsnapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,8 @@ type DOMSnapshotDocumentSnapshot struct {
TextBoxes *DOMSnapshotTextBoxSnapshot `json:"textBoxes"` // The post-layout inline text nodes.
ScrollOffsetX float64 `json:"scrollOffsetX,omitempty"` // Horizontal scroll offset.
ScrollOffsetY float64 `json:"scrollOffsetY,omitempty"` // Vertical scroll offset.
<<<<<<< HEAD
ContentWidth float64 `json:"contentWidth,omitempty"` // Document content width.
ContentHeight float64 `json:"contentHeight,omitempty"` // Document content height.
=======
>>>>>>> master
}

// Table containing nodes.
Expand Down Expand Up @@ -135,10 +132,7 @@ type DOMSnapshotLayoutTreeSnapshot struct {
Bounds []float64 `json:"bounds"` // The absolute position bounding box.
Text []int `json:"text"` // Contents of the LayoutText, if any.
StackingContexts *DOMSnapshotRareBooleanData `json:"stackingContexts"` // Stacking context information.
<<<<<<< HEAD
PaintOrders []int `json:"paintOrders,omitempty"` // Global paint order index, which is determined by the stacking order of the nodes. Nodes that are painted together will have the same index. Only provided if includePaintOrder in captureSnapshot was true.
=======
>>>>>>> master
OffsetRects []float64 `json:"offsetRects,omitempty"` // The offset rect of nodes. Only available when includeDOMRects is set to true
ScrollRects []float64 `json:"scrollRects,omitempty"` // The scroll rect of nodes. Only available when includeDOMRects is set to true
ClientRects []float64 `json:"clientRects,omitempty"` // The client rect of nodes. Only available when includeDOMRects is set to true
Expand Down Expand Up @@ -234,11 +228,8 @@ func (c *DOMSnapshot) GetSnapshot(computedStyleWhitelist []string, includeEventL
type DOMSnapshotCaptureSnapshotParams struct {
// Whitelist of computed styles to return.
ComputedStyles []string `json:"computedStyles"`
<<<<<<< HEAD
// Whether to include layout object paint orders into the snapshot.
IncludePaintOrder bool `json:"includePaintOrder,omitempty"`
=======
>>>>>>> master
// Whether to include DOM rectangles (offsetRects, clientRects, scrollRects) into the snapshot
IncludeDOMRects bool `json:"includeDOMRects,omitempty"`
}
Expand Down Expand Up @@ -278,21 +269,13 @@ func (c *DOMSnapshot) CaptureSnapshotWithParams(v *DOMSnapshotCaptureSnapshotPar

// CaptureSnapshot - Returns a document snapshot, including the full DOM tree of the root node (including iframes, template contents, and imported documents) in a flattened array, as well as layout and white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is flattened.
// computedStyles - Whitelist of computed styles to return.
<<<<<<< HEAD
// includePaintOrder - Whether to include layout object paint orders into the snapshot.
// includeDOMRects - Whether to include DOM rectangles (offsetRects, clientRects, scrollRects) into the snapshot
// Returns - documents - The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document. strings - Shared string table that all string properties refer to with indexes.
func (c *DOMSnapshot) CaptureSnapshot(computedStyles []string, includePaintOrder bool, includeDOMRects bool) ([]*DOMSnapshotDocumentSnapshot, []string, error) {
var v DOMSnapshotCaptureSnapshotParams
v.ComputedStyles = computedStyles
v.IncludePaintOrder = includePaintOrder
=======
// includeDOMRects - Whether to include DOM rectangles (offsetRects, clientRects, scrollRects) into the snapshot
// Returns - documents - The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document. strings - Shared string table that all string properties refer to with indexes.
func (c *DOMSnapshot) CaptureSnapshot(computedStyles []string, includeDOMRects bool) ([]*DOMSnapshotDocumentSnapshot, []string, error) {
var v DOMSnapshotCaptureSnapshotParams
v.ComputedStyles = computedStyles
>>>>>>> master
v.IncludeDOMRects = includeDOMRects
return c.CaptureSnapshotWithParams(&v)
}
6 changes: 0 additions & 6 deletions gcdapi/emulation.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@ type EmulationScreenOrientation struct {
Angle int `json:"angle"` // Orientation angle.
}

<<<<<<< HEAD
// No Description.
type EmulationMediaFeature struct {
Name string `json:"name"` //
Value string `json:"value"` //
}

=======
>>>>>>> master
type Emulation struct {
target gcdmessage.ChromeTargeter
}
Expand Down Expand Up @@ -458,7 +455,6 @@ func (c *Emulation) SetVirtualTimePolicy(policy string, budget float64, maxVirtu
return c.SetVirtualTimePolicyWithParams(&v)
}

<<<<<<< HEAD
type EmulationSetLocaleOverrideParams struct {
// ICU style C locale (e.g. "en_US"). If not specified or empty, disables the override and restores default host system locale.
Locale string `json:"locale,omitempty"`
Expand All @@ -477,8 +473,6 @@ func (c *Emulation) SetLocaleOverride(locale string) (*gcdmessage.ChromeResponse
return c.SetLocaleOverrideWithParams(&v)
}

=======
>>>>>>> master
type EmulationSetTimezoneOverrideParams struct {
// The timezone identifier. If empty, disables the override and restores default host system timezone.
TimezoneId string `json:"timezoneId"`
Expand Down
4 changes: 0 additions & 4 deletions gcdapi/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,7 @@ func (c *Input) DispatchMouseEventWithParams(v *InputDispatchMouseEventParams) (
// y - Y coordinate of the event relative to the main frame's viewport in CSS pixels. 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.
<<<<<<< HEAD
// button - Mouse button (default: "none"). enum values: none, left, middle, right, back, forward
=======
// button - Mouse button (default: "none").
>>>>>>> master
// buttons - A number indicating which buttons are pressed on the mouse when a mouse event is triggered. Left=1, Right=2, Middle=4, Back=8, Forward=16, None=0.
// clickCount - Number of times the mouse button was clicked (default: 0).
// deltaX - X delta in CSS pixels for mouse wheel event (default: 0).
Expand Down
Loading

0 comments on commit 80ce877

Please sign in to comment.