mirror of
https://github.com/tenox7/wrp.git
synced 2025-01-05 04:29:49 +00:00
revert sleep setting
This commit is contained in:
parent
878f43af75
commit
c036841c0a
3
wrp.go
3
wrp.go
@ -305,7 +305,6 @@ func (w wrpReq) capture() {
|
|||||||
var pngcap []byte
|
var pngcap []byte
|
||||||
chromedp.Run(ctx,
|
chromedp.Run(ctx,
|
||||||
emulation.SetDeviceMetricsOverride(int64(float64(w.width)/w.scale), 10, w.scale, false),
|
emulation.SetDeviceMetricsOverride(int64(float64(w.width)/w.scale), 10, w.scale, false),
|
||||||
chromedp.Sleep(time.Second*1),
|
|
||||||
chromedp.Location(&w.url),
|
chromedp.Location(&w.url),
|
||||||
chromedp.ComputedStyle("body", &styles, chromedp.ByQuery),
|
chromedp.ComputedStyle("body", &styles, chromedp.ByQuery),
|
||||||
chromedp.ActionFunc(func(ctx context.Context) error {
|
chromedp.ActionFunc(func(ctx context.Context) error {
|
||||||
@ -329,7 +328,7 @@ func (w wrpReq) capture() {
|
|||||||
chromedp.Run(ctx, emulation.SetDeviceMetricsOverride(int64(float64(w.width)/w.scale), height, w.scale, false))
|
chromedp.Run(ctx, emulation.SetDeviceMetricsOverride(int64(float64(w.width)/w.scale), height, w.scale, false))
|
||||||
// Capture screenshot...
|
// Capture screenshot...
|
||||||
err = chromedp.Run(ctx,
|
err = chromedp.Run(ctx,
|
||||||
chromedp.Sleep(time.Second*1),
|
chromedp.Sleep(time.Second*2),
|
||||||
chromedp.CaptureScreenshot(&pngcap),
|
chromedp.CaptureScreenshot(&pngcap),
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user