Believe it or not, firearm manufacturers have been putting safety devices on their firearms for a long, long time. Did you know that the original Winchester Model 1873 incorporated a trigger interlock to prevent the rifle from being accidentally discharged before it was fully in battery?
This is a photo of the mechanism of a Model 1873 Winchester made in 1887. The front arrow points to a hammer block which prevents the trigger from being pulled if the lever has not yet been closed completely. The rear arrow points to the rear of the interlock.