Skip to content
Permalink
Browse files

Fix js profiles when the js_source parameter is unset

Before js profiles would not run if you didn't have a js_source
parameter.
  • Loading branch information...
dvdbng committed Jan 18, 2016
1 parent d17b65c commit 9f5c45bc9fc61c30a94f30f3271f0bdc846e0442
Showing with 6 additions and 3 deletions.
  1. +6 −3 splash/qtrender.py
@@ -152,19 +152,22 @@ def _loadFinishedOK(self):

def _runjs(self, js_source, js_profile):
js_output, js_console_output = None, None
if js_source:

if js_source or js_profile:
if self.console:
self.tab._jsconsole_enable()

if js_profile:
# XXX: shouldn't we keep injecting scripts after redirects?
self.tab.run_js_files(js_profile, handle_errors=False)

js_output = self.tab.evaljs(js_source, handle_errors=False)
if js_source:
js_output = self.tab.evaljs(js_source, handle_errors=False)

if self.console:
js_console_output = self.tab._jsconsole_messages()

self.tab.store_har_timing('_onCustomJsExecuted')
self.tab.store_har_timing('_onCustomJsExecuted')
return js_output, js_console_output

def _prepare_render(self):

0 comments on commit 9f5c45b

Please sign in to comment.
You can’t perform that action at this time.