Add rendering hook catch code for foreign code.