Failed loading page (Frame load interrupted by policy change)
produced as a PNG image from my lua script when trying to grab the content of a document. It provides the link to the document in the image instead, rather than loading the content.
function main(splash)
assert(splash:go(splash.args.url))
local get_dimensions = splash:jsfunc([[
function () {
var rect = document.querySelector('a[id="btnDataSheet"] i[class="fa fa-file-pdf-o fa-2x"]').getClientRects()[0];
return {"x": rect.left, "y": rect.top}
}
]])
splash:set_viewport_full()
splash:wait(3)
local dimensions = get_dimensions()
-- FIXME: button must be inside a viewport
splash:mouse_click(dimensions.x, dimensions.y)
-- Wait split second to allow event to propagate.
splash:wait(5)
return splash:png()
end
I'm having the following error :
produced as a PNG image from my lua script when trying to grab the content of a document. It provides the link to the document in the image instead, rather than loading the content.
Here's some reproducible code: