The cities of this Commonwealth be, and they are hereby, authorized to regulate or to prohibit and prevent the sale and use of fireworks, firecrackers, sparklers, and other pyrotechnics in such cities, and the unnecessary firing and discharge of firearms in or into the highways and other public places thereof, and to pass all necessary ordinances regulating or forbidding the same and prescribing penalties for their violation.
53 P.S. § 3703