mirror of
https://github.com/tenox7/wrp.git
synced 2024-11-22 10:31:21 +00:00
add browser size setting
This commit is contained in:
parent
0680b4a72e
commit
5b827bffb0
4
wrp.go
4
wrp.go
@ -10,6 +10,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/chromedp/cdproto/emulation"
|
||||||
|
|
||||||
"github.com/chromedp/cdproto/cdp"
|
"github.com/chromedp/cdproto/cdp"
|
||||||
"github.com/chromedp/cdproto/dom"
|
"github.com/chromedp/cdproto/dom"
|
||||||
"github.com/chromedp/chromedp"
|
"github.com/chromedp/chromedp"
|
||||||
@ -54,7 +56,9 @@ func capture(url string, out http.ResponseWriter) {
|
|||||||
var target string
|
var target string
|
||||||
|
|
||||||
log.Printf("Caputure Request for %s\n", url)
|
log.Printf("Caputure Request for %s\n", url)
|
||||||
|
|
||||||
chromedp.Run(ctx,
|
chromedp.Run(ctx,
|
||||||
|
emulation.SetDeviceMetricsOverride(1024, 768, 1.0, false),
|
||||||
chromedp.Navigate(url),
|
chromedp.Navigate(url),
|
||||||
chromedp.Sleep(time.Second*2),
|
chromedp.Sleep(time.Second*2),
|
||||||
chromedp.CaptureScreenshot(&scrcap),
|
chromedp.CaptureScreenshot(&scrcap),
|
||||||
|
Loading…
Reference in New Issue
Block a user