Here is another possible cause - proteins from egg yolk, according to some, will cause oil to foam. So if there's egg in the batter or the pattie, you may get foam.
Come to think of it, that fits my experience of foamy oil as well!
http://cooking.stackexchange.com/que...ed-chicken-pan
That won't stop me from using whole eggs - love em!
But I'll stick to the pan frying and just ditch the foamy oil afterwards.