diff --git a/src/de/tudbut/tryumph/example/FileServer.java b/src/de/tudbut/tryumph/example/FileServer.java index e292b7b..ff6903a 100644 --- a/src/de/tudbut/tryumph/example/FileServer.java +++ b/src/de/tudbut/tryumph/example/FileServer.java @@ -8,12 +8,14 @@ import org.w3c.dom.Element; import de.tudbut.async.Callback; import de.tudbut.async.ComposeCallback; +import de.tudbut.async.Task; import de.tudbut.async.TaskCallable; import de.tudbut.tryumph.config.IRequestCatcher; import de.tudbut.tryumph.config.TryConfig; import de.tudbut.tryumph.events.GET; import de.tudbut.tryumph.events.Path; import de.tudbut.tryumph.events.RequestHandler; +import de.tudbut.tryumph.server.BrowserContext; import de.tudbut.tryumph.server.Request; import de.tudbut.tryumph.server.Response; import tudbut.parsing.TCN; @@ -89,4 +91,11 @@ public class FileServer implements IRequestCatcher, RequestHandler.Listener { rej.call(error); } + @Override + public Task processBrowserContext(BrowserContext context) { + if(data.getBoolean("noscript") != null) + context.useJavaScript = !data.getBoolean("noscript"); + return IRequestCatcher.super.processBrowserContext(context); + } + }