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.
Page 29 of the Pilot's Flight Operating Instructions, Navy Model SBD-6 Airplanes, NavAer 01-40SC-I, Sept. 1, 1944, says:
The five float lights (night drift signals) are aft of the flexible gun ammunition box. These lights are principally used at night to check drift variations, but can also be used during daylight. The gunner computes the amount of drift by means of the smoke, or smoky light, which is released when the float strikes the water.