In WW2 the Americans used a kind of smoke/gas-bomb that they mounted under the SBD planes in naval warfare.
What was the purpose of that device and what is it called?
The ocean is featureless, floating smoke bombs were used to mark a spot on a body of water so pilots could get back to the same spot. Smoke plumes can be seen from a long distance, they also let you gauge wind direction and speed.
Smoke bombs were often used when attacking submarines, if a pilot spotted a periscope or caught a sub on the surface before it dove he could drop a smoke marker on the spot before coming around to drop a depth bomb on it. Smoke bombs were also used to mark people in the water, for instance downed pilots or sailors, so they could be rescued.