Yeah, those were ground attack. And IL's weren't too well armoured. The crew sat in an armoured bathtub basically, but the tail was extremely weak. The author in I think Panzer Gunner notes watching an IL-2 get shot down by MG42 fire that was directed at the tail, and basically sheered it clear off.
And yes, that story is quite accurate Theta, but he pumped all his ammo into the planes back and wings. The pilot's story noted that he was also wounded by bullets quite a few times, which went through his armoured seat, but luckily none of the 20mm's hit his seat.
The end point is, even the P-47's canopy couldn't stop bullets. There were few planes with all round armoured cockpits (Hs-129) comes to mind, but most was just plexiglass or actual glass. The few fighters with armoured cockpits only had the extra thick glass blocks on the front windscreen, to protect the pilots against enemy bomber return fire.
And yeah, Ju-87 is basically thin metal frame and plexiglass...no protection there. Attacking ground troops was difficult, and shoot downs were commonplace.