   };
   var main = function() {
     console.log('poly: main start');
-    var dataElement = document.getElementById("poly-input-data");
-    var json = dataElement.innerHTML.substring("<!--".length, dataElement.innerHTML.length-"-->".length);
-    var data = JSON.parse(json);
-    console.log('poly: starting solving');
-    window.jsJobRun(data.page, data.options, cb);
-    console.log('poly: started');
+
+    getData(function(err, data) {
+      console.log('poly: starting solving');
+      window.jsJobRun(data.input, data.options, cb);
+      console.log('poly: started');
+    });
   };
   window.onload = main;
 //  main();
   """
-
-  payload = { page: page, options: options }
-  json = JSON.stringify payload, null, 4
 
   scriptTags = ("<script>#{s}</script>" for s in options.scripts).join("\n")
   body = """<!DOCTYPE html>

    }
    return obj;
  };
  var sendResponse = function(err, solution, details) {
    var xhr = new XMLHttpRequest();
    xhr.open('POST', window.location.href, true);

  .replace(/>/g, '&gt;')
  .replace(/"/g, '&quot;')

generateHtml = (filter, options) ->

  library = """
  window.jsJobEvent = function(id, payload) {
