This project implements the extension for scripting inside (X)HTML documents . It introduces simple non-UI user agent which implements general scripting support and Web API for arbitrary scripting language. Basic implementation includes scripting support for JavaScript scripting language which is ensured by Rhino. In addition to that project implements also UI user agent based on SwingBox rendering component .
Status of project: (in development)
Implemented scripting engines: JavaScript
Development suite: Eclipse (Kepler Service Release 1)
- Have installed JDK 1.6 or newer - JDK 1.8 is recommended
- Have installed Maven build manager
- Have set system variable
JAVA_HOME
to directory with installed JDK and have its binary directory in the system variablePATH
- e.g. on Windows add toPATH
variable%JAVA_HOME%\bin
(more here) - Have in the system variable
PATH
the directory with Maven installation - Have cloned latest version of CSSBox, CSSParser and SwingBox repository
- Have built and installed the CSSBox, CSSParser and SwingBox packages into the local Maven repository (see guide) Note: Other dependency packages will be reached automatically from public repositories
Simply run command: mvn package
Have built library (see previous section) and have it specified on classpath
Library package contains some demos located on org.fit.cssbox.scriptbox.demo
.
List of demos:
SimpleUserAgent
- Simple web browser that have only location bar and history traversal buttonsJavaScriptTesterUserAgent
- Application that adds simple debugging components for testing the scripts
import org.fit.cssbox.scriptbox.browser.BrowsingUnit;
import org.fit.cssbox.scriptbox.browser.UserAgent;
UserAgent userAgent = new UserAgent();
BrowsingUnit browsingUnit = userAgent.openBrowsingUnit();
browsingUnit.navigate("http://cssbox.sourceforge.net/");
Project is still in phase of development and targets the experimental frame of new HTML 5.1 specification which has not been released yet, so bugs may occur in the current implementation or also in specification itself.
If you run into any bug, please report on:
https://github.com/ITman1/ScriptBox/issues
- Thrown error during
javac
build:error: annotation XYZ is missing value for the attribute <clinit>
- This error may occur if you are running Sun JDK compiler
- It is known bug: http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6857918
- Solution: use JDK 8 or use different compiler than
javac
eg. Edifact Java Compiler (EJC)
Author: Radim Loskot
gmail.com: radim.loskot (e-mail)
- Radek Burget - [email protected] (project leader)