scrapinghub / splash

Lightweight, scriptable browser as a service with an HTTP API
BSD 3-Clause "New" or "Revised" License
4.09k stars 513 forks source link

JS errors kills rendering, but the page works in all browsers #875

Open dmitriibeliakov opened 5 years ago

dmitriibeliakov commented 5 years ago

Question about rendering page https://identity.iata.org/s/login/

It works in all possible browsers, including MSIE. But it does NOT work in Safari 9 (webkit 601.7.8).

Verbosity 2 shows error: JsConsole(https://static.lightning.force.com/eu12/auraFW/javascript/IEHeIQCidkPtcWOGw_6yrg/aura_prod_compat.js:4): SyntaxError: Strict mode does not allow function declarations in a lexically nested statement. Not sure if this is the reason for the problem though.

Using Splash 3.3 (master branch), it renders an empty screen.

So, my assumption is that the Webkit version is the problem. And I wonder if it is possible to use a newer version somehow?

lucywang000 commented 5 years ago

There is a work in progress to add chromium engine suppot: https://github.com/scrapinghub/splash/pull/867

kmike commented 5 years ago

I can confirm that this script doesn't work properly:

function main(splash, args)
  splash.private_mode_enabled = false
  splash.indexeddb_enabled = true
  assert(splash:go(args.url))
  assert(splash:wait(5))
  return {
    html = splash:html(),
    png = splash:png(),
    har = splash:har(),
  }
end