Call the JS add_patch function whenever a patch is read.