Javascript gives error: "DOMException: Failed to read the 'cookie' property from 'Document': Access is denied for this document."
Iv'e set all cookies to use use HttpOnly = false but it do not seem to help. The page works perfectly if I call the page without puppeteer.
I currently copy all session variables from the request I am initializing puppeteer with:
var cookies = new List<CookieParam>();
foreach (var key in request.Cookies.Keys)
{
var cookie = request.Cookies.Get(key.ToString());
cookies.Add(new CookieParam {
Name = cookie.Name,
Value = cookie.Value,
HttpOnly = false,
Domain = cookie.Domain,
Url = baseUrl,
Path = cookie.Path,
Secure = cookie.Secure
});
}
await page.SetCookieAsync(cookies.ToArray());