In 1916, Hollywood megastar Douglas Fairbanks starred in The Mystery of the Leaping Fish. In it, the actor plays “scientific detective” Coke Ennyday, a parody of Sherlock Holmes. The plot, written by Tod Browning (Freaks, Dracula) and D.W. Griffith (The Birth of a Nation) with snappy intertitles by Anita Loos (Gentlemen Prefer Blondes) under the direction of her husband John Emmerson, sends Coke on the trail of an Asian opium-smuggling gang.
It becomes pretty apparent that Coke is less trying to bring the rogues to justice than nick their stash because throughout the film he takes vast quantities of cocaine and laudanum.
Wikipedia adds context:
The Mystery of Leaping Fish was released in 1916, one year before the Harrison Act was enacted. Narcotic prohibition was still a new concept in the United States, and the use of opiates and cocaine was much more socially acceptable than today. Furthermore, the censorious Hays Code would not be instituted for another fourteen years after the film’s release. With the introduction of the code, depictions of intravenous drug use were not shown in major motion pictures.
During the era of the Hays Code, films that dealt with controversial topics such as drug use were morality plays that illustrate the degradation that surrounds the use of such drugs.
Drugs were all the rage:
In Popular Culture, Crime and Social Control, Susan Boyd writes:
By 1906, Congress passed the Pure Foods And Drugs Act. It required all patent medicines and elixirs that contained opiates and cocaine to specify these ingredients on their label… Print media, moral reformers, and pharmacists, doctors, and congressmen claimed that opiates and cocaine predisposed its users to insanity and crime…. it was not until Congress passed the national Harrison Narcotics Act of 1914 that opiates and coca leaves and their derivatives were regulated and taxed for internal revenue… positive or humorous representations of drugs in films ended following the establishment of the Motion Pictures Production Code in 1930… The Code specifically banned explicit scenes of alcohol and illegal drug use and selling from Hollywood screens… only independent films outside of the Hollywood industry continued to include representation of drugs like opium and heroin…
Coke, however, was not some kind of waster. The drugs gave him powers to do good public service. And he was always on the clock:
And now for the main feature: