ScriptEngineManager mgr = new ScriptEngineManager();
final ScriptEngine engine = mgr.getEngineByName("JavaScript");
Compilable compilable = (Compilable) engine;
final CompiledScript script = compilable.compile(baos.toString());
proxy.addResponseInterceptor(new ResponseInterceptor() {
@Override
public void process(BrowserMobHttpResponse response) {
Bindings bindings = engine.createBindings();
bindings.put("response", response);
bindings.put("log", LOG);