protected Scriptable getScriptableForElement(final Object object) {
if (object instanceof Scriptable) {
return (Scriptable) object;
}
else if (object instanceof WebWindow) {
return new WindowProxy((WebWindow) object);
}
return getScriptableFor(object);
}