Liquid foam is a dense dispersion of liquid bubbles in a surfactant solution. Because of its large surface area, it is an out-of-equilibrium material that evolves with space and time because of coarsening, coalescence, and liquid drainage. In many applications, it is required to control the lifetime of a foam by limiting the drainage or triggering the collapse at a specific location or a given time. We show here that applying an external electric field at the edge of the foam induces some liquid flows. Depending on the flow magnitude, it controls either gravity driven drainage, the foam stability, or the foam collapse at a specific location. Thus, applying an electric field to a liquid foam can control its stability. The experimental results are quantitatively described by a simple model taking into account first the electro-osmotic transport in such a deformable medium and second the Marangoni flows induced by heterogeneous heating due to Joule effect. More specifically, we show for the first time that electro-osmosis can be strongly enhanced due to thermal gradients generated by the applied electric field.