We ran some tests using k6 browser and we got the following error multiple times:
ERRO[0009] Blocked script execution in ‘about:blank’ because the document’s frame is sandboxed and the ‘allow-scripts’ permission is not set. browser_source=security line_number=6 source=browser stacktrace=“&{ [0xc000f4dec0 0xc000f4df00 0xc000f4df40 0xc001176100 0xc001176180 0xc0011761c0 0xc001176200 0xc001176240 0xc001176280 0xc0011762c0 0xc001176340 0xc001176380 0xc001176400 0xc001176440] }” url=“https://cdn.cookielaw.org/scripttemplates/202404.1.0/otBannerSdk.js”
It is very annoying as it is difficult to follow other diagnostic logs. Is there a way to set allow-scripts permission in order to avoid it?
Thank you for your solution. However, it doesn’t work for me for some reason. I tried running the command shared by you and still getting below error:
‘Blocked script execution in ‘about:blank’ because the document’s frame is sandboxed and the ‘allow-scripts’ permission is not set.’
Is there any other insight/solution you can share please? Let me know if any information is required from my side.
Thank you in advance
Hello, thank you for replying.
I went through the article shared by you but I couldn’t understand if sandbox=“allow-scripts” need to be set on the website itself or Is there any way to modify it via our k6 code as well?
PS: I tried with the command $env:K6_BROWSER_ARGS=“allow-scripts”; k6 run script.js but still getting the same error.