As far as I know the b2BoundaryListener was part of earlier versions of Box2D and was removed since the Box2D world does not have boundaries anymore.
You could use dynamic sensors since these would also detect kinematic bodies.
If your world uses gravity you would have to fix the bodies though.
You could either do that by applying a force that counteracts the gravity or by fixing these dynamic sensor bodies to static bodies by a joint (e.g. weld joint).
Newer Box2D Javascript ports also include the setGravityScale method that will allow you to create dynamic bodies that are not influenced by gravity (e.g. JSBox2D)
But I think doing this manually in update is probably a better idea and should be pretty straight forward if you use the b2AABB class. This will remove objects when their bounding box is outside of your bounds.
You could do something like the following (untested code):
var body = world.GetBodyList();
while (body != null) {
var fixture = body.GetFixtureList();
var bodyIsInBounds = false;
while (fixture != null) {
// bounds AABB are your boundaries (as b2AABB object)
if (fixture.GetAABB().TestOverlap(boundsAABB)) {
bodyIsInBounds = true;
break;
}
fixture = fixture.GetNext();
}
if (!bodyIsInBounds) {
world.DestroyBody(body);
}
body = body.GetNext();
}
You might also have to check for b2AABB.Contains. I am not sure whether or not TestOverlap will return true if boundsAABB contains the other b2AABB object completely.