mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 12:54:38 +03:00
Fix potential race condintion in CDP (#1536)
This commit is contained in:
@@ -15,7 +15,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/chromedp/cdproto/cdp"
|
"github.com/chromedp/cdproto/cdp"
|
||||||
"github.com/chromedp/cdproto/dom"
|
|
||||||
"github.com/chromedp/cdproto/network"
|
"github.com/chromedp/cdproto/network"
|
||||||
"github.com/chromedp/chromedp"
|
"github.com/chromedp/chromedp"
|
||||||
jsoniter "github.com/json-iterator/go"
|
jsoniter "github.com/json-iterator/go"
|
||||||
@@ -175,14 +174,7 @@ func urlFromCDP(url string, driverOptions scraperDriverOptions, globalConfig Glo
|
|||||||
chromedp.Navigate(url),
|
chromedp.Navigate(url),
|
||||||
chromedp.Sleep(sleepDuration),
|
chromedp.Sleep(sleepDuration),
|
||||||
setCDPClicks(driverOptions),
|
setCDPClicks(driverOptions),
|
||||||
chromedp.ActionFunc(func(ctx context.Context) error {
|
chromedp.OuterHTML("html", &res, chromedp.ByQuery),
|
||||||
node, err := dom.GetDocument().Do(ctx)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
res, err = dom.GetOuterHTML().WithNodeID(node.NodeID).Do(ctx)
|
|
||||||
return err
|
|
||||||
}),
|
|
||||||
printCDPCookies(driverOptions, "Cookies set"),
|
printCDPCookies(driverOptions, "Cookies set"),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user