-
Notifications
You must be signed in to change notification settings - Fork 803
Comparing changes
Open a pull request
base repository: chromedp/chromedp
base: v0.3.1
head repository: chromedp/chromedp
compare: v0.4.0
Commits on May 22, 2019
-
increase timeout when waiting for new page targets
We'll remove this code eventually, but for now, 50ms is turning out to not be nearly enough when the machine is slow or under load. Double each of the sleeps and multiply the retries by ten, meaning that we wait for up to a full second. This should be enough for practically all scenarios for now. Fixes #352.
Configuration menu - View commit details
-
Copy full SHA for 2fdc82b - Browse repository at this point
Copy the full SHA 2fdc82bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 193fc5e - Browse repository at this point
Copy the full SHA 193fc5eView commit details
Commits on May 24, 2019
-
add an option to gather a browser's stdout and stderr
This shouldn't affect users who don't need to grab the output. Also add a simple test.
Configuration menu - View commit details
-
Copy full SHA for a78e034 - Browse repository at this point
Copy the full SHA a78e034View commit details -
We don't need a new file for it; allocate_test.go is enough. Also, we can search for the "devtools listening on" line in a much simpler way. Finally, we can use consolespam.html to check that stdout/stderr printed after we grab the websocket line is still received.
Configuration menu - View commit details
-
Copy full SHA for 872f981 - Browse repository at this point
Copy the full SHA 872f981View commit details -
reimplement CombinedOutput without TeeReader
All we need is a thin io.Writer wrapper. The code is perhaps more verbose, but there are less moving pieces, and we don't have to worry about never draining the TeeReader fully.
Configuration menu - View commit details
-
Copy full SHA for 08a984e - Browse repository at this point
Copy the full SHA 08a984eView commit details -
make TestCombinedOutput non-racy
I was forgetting that we can't fetch the output while it's still being written to. On top of that, cancelling the target didn't wait for the io.Copy, which was also caught by test -race.
Configuration menu - View commit details
-
Copy full SHA for ec59ca1 - Browse repository at this point
Copy the full SHA ec59ca1View commit details -
don't hang in Navigate if the context is cancelled
The waiting for the frameStoppedLoading event was a simple channel receive, meaning that it was possible to block forever. This can happen if the context is cancelled after the navigation takes place but before the event is processed. Fix the bug across nav.go, and add a test. Fixes #357.
Configuration menu - View commit details
-
Copy full SHA for e781ec0 - Browse repository at this point
Copy the full SHA e781ec0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1ca7072 - Browse repository at this point
Copy the full SHA 1ca7072View commit details
Commits on May 25, 2019
-
make DefaultExecAllocatorOptions an array
I've seen multiple users append directly into this global, which is wrong and can lead to races. We can't make the slice read-only, so the next best option is to make it an array.
1Configuration menu - View commit details
-
Copy full SHA for 8f09f7b - Browse repository at this point
Copy the full SHA 8f09f7bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 41c9bbc - Browse repository at this point
Copy the full SHA 41c9bbcView commit details
Commits on May 28, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 4545100 - Browse repository at this point
Copy the full SHA 4545100View commit details -
Configuration menu - View commit details
-
Copy full SHA for f9d93e9 - Browse repository at this point
Copy the full SHA f9d93e9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5f7896d - Browse repository at this point
Copy the full SHA 5f7896dView commit details -
all: remove commented out code
This has all been unused since 2017, and isn't particularly necessary right now. It's always on git if we need it again.
Configuration menu - View commit details
-
Copy full SHA for 720d3d7 - Browse repository at this point
Copy the full SHA 720d3d7View commit details -
clarify the use of DefaultExecAllocatorOptions
And simplify the uses in the tests and examples.
Configuration menu - View commit details
-
Copy full SHA for 644ff8f - Browse repository at this point
Copy the full SHA 644ff8fView commit details
Commits on May 31, 2019
-
forceIP: don't remove the three-character prefix twice
The first three characters are separated from the host varible, twice so "ws://localhost:9222/..." becomes "alhost:9222/...", and net.ResolveIPAddr almost always errors.
Configuration menu - View commit details
-
Copy full SHA for eae62c3 - Browse repository at this point
Copy the full SHA eae62c3View commit details -
don't defer node.RUnlock in a loop in AttributesAll
If the number of nodes is large, this can mean keeping lots of nodes locked for no reason. Spotted in #361, though the author closed the PR.
Configuration menu - View commit details
-
Copy full SHA for 791b99b - Browse repository at this point
Copy the full SHA 791b99bView commit details -
rewrite forceIP to not be string-based
Using the net and net/url packages is more robust. Perhaps it adds a couple of allocations, but this isn't code that will run often, and having it behave correctly is more important. For example, I was seeing errors before, as it didn't handle IPv6 hostnames. That's fixed now, though it didn't affect any tests.
Configuration menu - View commit details
-
Copy full SHA for f564cd8 - Browse repository at this point
Copy the full SHA f564cd8View commit details -
The docker test is flaky, so this might help us see what's going on.
Configuration menu - View commit details
-
Copy full SHA for 84c39da - Browse repository at this point
Copy the full SHA 84c39daView commit details -
Configuration menu - View commit details
-
Copy full SHA for c57954f - Browse repository at this point
Copy the full SHA c57954fView commit details
Commits on Jun 1, 2019
-
Means that this common use case can be solved with just five lines of simple Go code, as opposed to somewhat more complex dozen lines before. WaitNewTarget also handles the edge cases nicely, such as listening on both Created and InfoChanged events, ignoring attached targets, and cancelling the listener once the function matches. While at it, enforce module mode, which wasn't on due to its "auto" default and Travis's GOPATH setup. Fixes #371.
Configuration menu - View commit details
-
Copy full SHA for 3e490a6 - Browse repository at this point
Copy the full SHA 3e490a6View commit details
Commits on Jun 3, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 5ece318 - Browse repository at this point
Copy the full SHA 5ece318View commit details -
stop running wait funcs synchronously
This worked for most programs, but had one major pitfall. If a large query was run on a large page, this could trigger thousands of DOM events, filling up all internal buffered channels. This would in turn block the query forever, as it would never see its response message. Add a test to reproduce the hang, and fix it. For now, this means adding a mutex. We might get rid of it at some point. Fixes #375.
Configuration menu - View commit details
-
Copy full SHA for 8e13c55 - Browse repository at this point
Copy the full SHA 8e13c55View commit details -
disable ExampleRetrieveHTML for the time being
See the TODO. The race was making CI fail more often than not.
Configuration menu - View commit details
-
Copy full SHA for c3d5f0f - Browse repository at this point
Copy the full SHA c3d5f0fView commit details -
Configuration menu - View commit details
-
Copy full SHA for e657155 - Browse repository at this point
Copy the full SHA e657155View commit details
Commits on Jun 10, 2019
-
remove response body code from Example_retrieveHTML
We'll add a higher level API for this in #370. For now, just leave it with OuterHTML.
Configuration menu - View commit details
-
Copy full SHA for 5b47e1d - Browse repository at this point
Copy the full SHA 5b47e1dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5249736 - Browse repository at this point
Copy the full SHA 5249736View commit details -
revert back to using one goroutine per selector
The point of using a single ticker per browser and a func channel was so that the wait funcs could run synchronously with the target handler. On paper, this had several advantages: * Less use of mutexes * Fewer goroutines * Better scheduling, as the target handler sees the incoming events However, none of those turned out to be true in practice. For example, less mutexes and goroutines don't matter, because in practice there are usually only one or two selectors per target at a time. More importantly, this synchronous design was more complex and expensive. It requires a ticker and one channel per target, which are used even if there are no running selectors at the moment. This could mean that the CPU would be spinning a bit, which is more noticeable on small computers. While at it, move the goroutine outside of Selector.run, so that the code doesn't need the extra level of indentation. Updates #380.
Configuration menu - View commit details
-
Copy full SHA for 04230ee - Browse repository at this point
Copy the full SHA 04230eeView commit details -
kb: fix generator and update keyboard consts
Adds additional keyboard consts taken from the chromium source, and fixes a minor problem in the kb/gen.go introduced during the various code refactors.
Configuration menu - View commit details
-
Copy full SHA for 2ed53ba - Browse repository at this point
Copy the full SHA 2ed53baView commit details -
stop polling when grabbing a new browser's tab
Fix the TODO by instead waiting for the right Target.targetCreated event.
Configuration menu - View commit details
-
Copy full SHA for 1f6cf99 - Browse repository at this point
Copy the full SHA 1f6cf99View commit details -
Configuration menu - View commit details
-
Copy full SHA for 14df773 - Browse repository at this point
Copy the full SHA 14df773View commit details
Commits on Jun 11, 2019
-
load the top frame when attaching to an existing page
See the added comment for the reasoning behind this. This is easy to reproduce with TestWaitNewTarget, as it loads files from disk. These load so fast, that most of the time the events get fired before we attach to the new page.
Configuration menu - View commit details
-
Copy full SHA for 4f9ab67 - Browse repository at this point
Copy the full SHA 4f9ab67View commit details -
also capture targetInfoChanged for a browser's first tab
We were seeing flakes when allocating new browsers, particularly with headless-shell. We were never seeing the target ID for the blank page that a browser opens up with. This was because we were only capturing targetCreated events. For example, if the page is created first, and then its info is changed to "about:blank", we wouldn't catch it. What we need is an almost exact copy of the code we have in WaitNewTarget. Not exactly the same code, though, so a bit of copy pasting is fine. There isn't a regression test for this one, as I haven't been able to reproduce it reliably with regular chromium. However, headless-shell reproduced it via 'go test' most of the time, and CI already caught that.
Configuration menu - View commit details
-
Copy full SHA for f22e621 - Browse repository at this point
Copy the full SHA f22e621View commit details
Commits on Jun 12, 2019
-
Fixes some documentation in README.md, and a single comment on the Query action.
Configuration menu - View commit details
-
Copy full SHA for d3f11fb - Browse repository at this point
Copy the full SHA d3f11fbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1835a75 - Browse repository at this point
Copy the full SHA 1835a75View commit details -
Configuration menu - View commit details
-
Copy full SHA for 600d5bf - Browse repository at this point
Copy the full SHA 600d5bfView commit details -
Run no longer calls Targets, as we refactored newTarget to use events instead of polling to wait for the first blank tab. In particular, we don't want to copy-paste the code that allocates a browser, as we might want to tweak it later on.
Configuration menu - View commit details
-
Copy full SHA for 90f60cf - Browse repository at this point
Copy the full SHA 90f60cfView commit details -
fix parallel subtest race in TestCloseDialog
We forgot to do the 'test := test' trick here. We were just testing the first test case a bunch of times.
Configuration menu - View commit details
-
Copy full SHA for 69b0a09 - Browse repository at this point
Copy the full SHA 69b0a09View commit details -
add a test to cover NewContext's logging options
Bumps coverage up by 0.9%.
Configuration menu - View commit details
-
Copy full SHA for 19134ed - Browse repository at this point
Copy the full SHA 19134edView commit details -
simplify ReceivedMessageFromTarget decoding
We implement our own UnmarshalEasyJSON, as we decode lots of these and we want to avoid allocs. However, the message is never null, so we can simplify the code.
Configuration menu - View commit details
-
Copy full SHA for 8490434 - Browse repository at this point
Copy the full SHA 8490434View commit details
Commits on Jun 14, 2019
-
Adds ByJSPath as an option, along with accompanying unit test. Fixes #376.
Configuration menu - View commit details
-
Copy full SHA for 35b6128 - Browse repository at this point
Copy the full SHA 35b6128View commit details -
actions: Add high-level device emulation action
Adds two high-level actions, EmulateViewport and ResetViewport that wrap the Emulation.setDeviceMetricsOverride and Emulation.setTouchEmulationEnabled commands. Additionally, modifies the two locations where the device viewport was being changed modified in the unit tests.
Configuration menu - View commit details
-
Copy full SHA for 238eb62 - Browse repository at this point
Copy the full SHA 238eb62View commit details -
replace "chan bool" with struct{} where possible
Accomplishes the same, and it's a bit smaller and more idiomatic. Perhaps not as quick to write, which is why I initially went with bool.
Configuration menu - View commit details
-
Copy full SHA for 10c6011 - Browse repository at this point
Copy the full SHA 10c6011View commit details
Commits on Jun 17, 2019
-
rethink the device emulation API a bit
First, we don't need named func types for all the options. A type alias is enough for our needs, and makes everything much simpler for the users. For example, in emulate.go and device/device.go we had to use explicit types and copy slices, because the device package can't depend on the parent package's named type. However, if the type is an alias, the device package can declare the alias too, fixing both issues. Second, split ViewportParams into UserAgent and Viewport. The old method returned parameters for two actions, even though it was documented as only returning parameters for EmulateViewport. Splitting UserAgent makes sense in this context, and keeps the signature simpler and shorter. Rename the remaining method to Viewport too, as the "Params" bit is a bit redundant. Third, make the zero value Device be invalid, to avoid people using BlackberryPlayBook by default via "var dev device.Device" and such. This also makes the generated code a bit nicer, as the first real device line isn't any different from the others. Add a test, too. Finally, both Emulate and EmulateViewport can return a complex action via Tasks; there's no need for the extra complexity of an ActionFunc.
Configuration menu - View commit details
-
Copy full SHA for 275a364 - Browse repository at this point
Copy the full SHA 275a364View commit details -
Further changes to the emulate actions in chromedp.
Configuration menu - View commit details
-
Copy full SHA for d55cf90 - Browse repository at this point
Copy the full SHA d55cf90View commit details
Commits on Jun 19, 2019
-
Kenneth Shaw committed
Jun 19, 2019 Configuration menu - View commit details
-
Copy full SHA for f2d356e - Browse repository at this point
Copy the full SHA f2d356eView commit details -
emulate: additional proposed API changes
Refactors out the Device interface, and decouples device package from cdproto. Also rename the device.Device struct type to device.Info, to reduce stutter and remove the ambiguity with chromedp.Device.
Configuration menu - View commit details
-
Copy full SHA for fd957a4 - Browse repository at this point
Copy the full SHA fd957a4View commit details
Commits on Jun 26, 2019
-
don't make ExampleEmulate a runnable example
It requires an internet connection, so it was making 'go test' either painfully slow or just fail while I was working on a spotty connection. If we want it as a runnable example in this repo, it should be rewritten to visit a local html file instead. Otherwise, it can stay as-is, or be moved to chromedp/examples.
Configuration menu - View commit details
-
Copy full SHA for 5cab578 - Browse repository at this point
Copy the full SHA 5cab578View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0157080 - Browse repository at this point
Copy the full SHA 0157080View commit details
Commits on Jun 27, 2019
-
don't panic on selectors if the frame isn't loaded
This is possible if one uses page.Navigate directly, as it doesn't wait for the load to happen. panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0xb8 pc=0x890d17] goroutine 779 [running]: sync.(*RWMutex).RLock(...) /home/mvdan/tip/src/sync/rwmutex.go:48 github.com/chromedp/chromedp.(*Selector).run(0xc0005a8c00, 0xaa5d80, 0xc0004888a0, 0xc0006b86c0, 0xc000fb4420) /home/mvdan/src/chromedp/sel.go:79 +0x137 created by github.com/chromedp/chromedp.(*Selector).Do /home/mvdan/src/chromedp/sel.go:55 +0x11e While at it, remove a few unnecessary Tasks wrappings. Fixes #404.
Configuration menu - View commit details
-
Copy full SHA for e5acbe3 - Browse repository at this point
Copy the full SHA e5acbe3View commit details
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
This file was deleted.
This file was deleted.