an safe java to javascript bridge