wabarc / screenshot

Capture webpage and save as image using chromedp
GNU General Public License v3.0
13 stars 0 forks source link

set LocalStorage error #36

Open colinsarah opened 1 year ago

colinsarah commented 1 year ago

set localstorage before navigate url get error : DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this document

chromedp.Run(*tab.Ctx,
        RunWithTimeOut(tab.Ctx, tab.config.DomContentLoadedTimeout, chromedp.Tasks{
            dom.Enable(),
            page.Enable(),
            runtime.Enable(),
            network.Enable(),
            fetch.Enable().WithHandleAuthRequests(true),
            network.SetExtraHTTPHeaders(tab.ExtraHeaders),
            setLocalStorage(LocalStorage),
            chromedp.Navigate(tab.NavigateReq.URL.String()),
        }),

thanks for any help.

welcome[bot] commented 1 year ago

Thanks for opening this issue. We should be by to give feedback soon. In the meantime, please check out the contributing guidelines.

waybackarchiver commented 1 year ago

@colinsarah Thanks you for your reporting!

Will it work if move setLocalStorage after navigateAndWaitFor?