Commit Graph

24 Commits

Author SHA1 Message Date
Daniel Martí
c109f6ebfd use consistent context.Context var names 2019-04-01 12:18:16 +01:00
Daniel Martí
81a48280ef route all communication via the browser
Use a single websocket connection per browser, removing the need for an
extra websocket connection per target.

This is thanks to the Target.sendMessageToTarget command to send
messages to each target, and the Target.receivedMessageFromTarget event
to receive messages back.

The browser handles activity via a single worker goroutine, and the same
technique is used for each target. This means that commands and events
are dealt with in order, and we can do away with some complexity like
mutexes and extra go statements.
2019-04-01 12:18:16 +01:00
Daniel Martí
3d3bf22ccc start the chromedp v2 refactor
First, we want all of the functionality in a single package; this means
collapsing whatever is useful into the root chromedp package.

The runner package is being replaced by the Allocator interface, with a
default implementation which starts browser processes.

The client package doesn't really have a place in the new design. The
context, allocator, and browser types will handle the connection with
each browser.

Finally, the new API is context-based, hence the addition of context.go.
The tests have been modified to build and run against the new API.
2019-04-01 12:17:28 +01:00
Kenneth Shaw
f683cfc4c1 Minor code cleanup 2018-03-27 04:31:09 +07:00
Kenneth Shaw
b0c2445e67 Splitting repositories 2017-12-28 11:17:14 +07:00
Daniel Martí
335d22d376 all: simplify some error variables
There's no need to put the error variables in a larger scope, nor define
them earlier than necessary. If anything, it makes the code harder to
follow, such as figuring out when nil errors are returned.
2017-12-18 10:51:37 +07:00
Kenneth Shaw
380c95b6c0 Minor documentation cleanup from last commit 2017-12-18 10:48:40 +07:00
kotamat
07208b1cc3 Add Atributes All feature 2017-12-18 10:42:13 +07:00
Kenneth Shaw
2d46c88024 Updating to latest protocol.json 2017-07-14 10:35:11 +07:00
Kenneth Shaw
1a35cceeae Adding OuterHTML and InnerHTML actions 2017-07-01 11:53:22 +07:00
Kenneth Shaw
df490a3025 Adding SetUploadFiles and changing SendKeys behavior
Added high level action SetUploadFiles to set the upload files for a
input[type="file"] node, and modified SendKeys to recognize the nodes.

Additionally, added unit test for both, and updated the
examples/upload/main.go to use the SendKeys variant.
2017-07-01 10:14:42 +07:00
Kenneth Shaw
bf1d5ecfbc Revising ScrollIntoView Action
- Rewrote ScrollIntoView to be consistent with other query actions
2017-02-28 08:35:00 +07:00
Kenneth Shaw
4c16faa34d Minor code cleanup/maintenance on generated cdp protocol 2017-02-18 15:36:24 +07:00
Kenneth Shaw
e12e5d1f15 Fixing Clear action to properly work with textarea nodes 2017-02-18 10:39:11 +07:00
Randy Cahyana
6c5096f06a Fixing SetAttributes 2017-02-16 19:41:04 +07:00
Kenneth Shaw
3673164aef Code cleanup
- Refactored API calls to be cleaner
- Changed types that shoudn't be exported to not-exported
- Updated examples with API changes
- Added unit test for Title action
2017-02-12 14:08:40 +07:00
Kenneth Shaw
f73c429109 Renaming FrameHandler, updating to latest protocol.json, and code fixes 2017-02-12 12:50:46 +07:00
Kenneth Shaw
6769aefc5e Fixing Visible/NotVisible issues; adding new actions
- Fixed issues with ElementVisible/ElementNotVisible
- Added a few extra Javascript based actions
2017-02-08 23:01:35 +07:00
Kenneth Shaw
4137fe57cc Initial work to fix mouse actions 2017-02-08 21:35:12 +07:00
Kenneth Shaw
b57afce7e7 Fixing Evaluate and EvaluateAsDevTools actions
- Update Evaluate action to also work with []byte
- Update Evaluate documentation
- Fix EvaluateAsDevTools action
- Refactor Query actions to use EvaluateAsDevTools
2017-02-08 15:18:55 +07:00
Kenneth Shaw
465e7becad Expanding Evaluate API
- fixed issues with Evaluate
- added examples/eval
2017-02-08 14:27:39 +07:00
Kenneth Shaw
4145d8367d Addition of chromedp-proxy, fixing SendKeys, more
- Adding chromedp-proxy command to help record chrome sessions
- Changing the headless writeup to point to the knq chrome-headless
  docker image
- Fixing issues with SendKeys action (should correctly work for all
  well known keys)
- Updated to latest Chrome protocol.json and re-generated API
- Other minor fixes
2017-02-07 11:34:35 +07:00
Kenneth Shaw
58283934b9 Fixing issues with code generation 2017-01-26 14:28:34 +07:00
Kenneth Shaw
20d575fece Initial import 2017-01-24 22:09:23 +07:00