@open_tab
def interact_page(data, socket):
 event = json.dumps(data.get('interaction', {}))
 try:
  socket.tab.evaljs(('window.livePortiaPage.sendEvent(%s);' % event))
 except JsError as e:
  print e
 cookies(socket)

@ open_tab def interact_page ( data , socket ) : event = json . dumps ( data . get ( 'interaction' , { } ) ) try : socket . tab . evaljs ( ( 'window.livePortiaPage.sendEvent(%s);' % event ) ) except JsError as e : print e cookies ( socket )
execute js event from front end on virtual tab .