Danielle Leong thought she knew what she was getting into when she settled in to watch a show about an outlaw biker gang — drugs, guns, tattoos.

She devoured episode after episode of “Sons of Anarchy” on Netflix until something happened in the show that she hadn’t foreseen: A graphic rape scene that sent the 28-year-old into the grip of anxiety.

2of 2Left to right, Chad Fegley, Sanjiv Sharma and Kerrin Arora work on a project at Coding Dojo in San Jose, Calif. on Friday, Jan. 30, 2016. The Google Chrome extension warns viewers of potentially disturbing content.Photo: James Tensuan, The Chronicle

Once a scene has been flagged, users get a visual trigger warning — a glowing bubble that pops up in the bottom right corner of the screen. It’s intended to warn viewers early enough that they can choose to look away, turn off the program or stay put and watch, Leong said.

“I didn’t want something that was going to be too distracting,” said Leong, an engineer and Oakland resident. “You’re just giving a little subtle reminder that if they want to keep watching they can, and if they don’t they should leave. It’s completely up to them so it gives the power back to the user.”

Trigger warnings have become common on the Internet, where they are attached to blog posts, news articles, videos and photos.

Amazon Prime, which also offers a streaming service, adds trigger warnings to descriptions of movies and shows that might offend certain users — though it does not tailor warnings to a specific moment or scene.

Danielle Leong reacts to a nature documentary as she presents her app Feerless at Coding Dojo in San Jose, Calif. on Friday, Jan. 30, 2016. The Google Chrome extension warns viewers of potentially disturbing content.

Photo: James Tensuan, The Chronicle

Many have attributed the rise of trigger warnings to two key cultural shifts: More veterans than ever are returning from war with diagnosed PTSD, and the traumatic effects of sexual assault have become more widely discussed and accepted.

Trauma is not limited to those who have been to war or suffered sexual abuse.

PTSD can stem from any traumatic incident, according to the National Institutes of Health, including natural disasters, terrorism, car accidents, train wrecks, plane crashes and being mugged, raped, tortured, kidnapped or abused.

Most people who experience a traumatic event will recover in a few weeks or months, according to the NIH, but for others, PTSD can linger.

The problem for those who may relapse is that triggers can be hard to predict.

It might be a noise, a smell, a person, a news article or a scene in a film.

“For me, this is about mental health,” Leong said. “The primary purpose of this app, for instance, is to make sure they can live a life that is as close to normal as they can get without the anxiety of wondering when the other shoe will drop or when something will happen that might trigger you.”

Cultural commentators have written essays blasting trigger warnings for shielding people unnecessarily and creating a generation of sensitive and emotionally stunted Americans.

Chad Fegley works on a project at Coding Dojo in San Jose, Calif. on Friday, Jan. 30, 2016. The Google Chrome extension warns viewers of potentially disturbing content.

Photo: James Tensuan, The Chronicle

“The internet has shrunk the distance between p.c. culture and mainstream liberal politics, and the two are now hopelessly entangled,” wrote Jonathan Chait in an essay titled “Not a very PC thing to say.”

Leong’s program, which she founded during her time at Coding Dojo’s developer bootcamp, relies on the judgment of viewers, who can flag content with possible triggers.

“You don’t have to be someone who’s suffering from PTSD to use this app,” she said. “Anyone who wants to be an ally can help us flag things that they see.”

The app is free to download in Google Chrome, the only browser in which it works. All flagged media will automatically be slapped with a warning, but Leong hopes eventually to institute a kind of review process and expand beyond Netflix to other streaming services. The app could be used for parents, too, she said, to flag content that might be inappropriate for kids in the midst of an otherwise tame show or movie.

If it takes off, she said, she will work to tailor Feerless more specifically to people’s needs by building different categories — a sort of checklist of trauma — that would show only relevant trigger warnings based on a person’s sensitivities.

“There’s still stigma attached to mental illness and PTSD, and I think that people still might not think it’s an OK thing to talk about,” Leong said. “So my hope is that with this app it helps people say, ‘You know what? I went through something traumatic, and it’s OK to have these reactions, and it’s also OK to ask for help.’”

Marissa Lang covers the intersection of technology and culture for the San Francisco Chronicle, focusing on how the tech industry and technology itself influence and reshape the Bay Area, its people and communities. She covers Twitter, Facebook and the influence of social media, diversity in tech, and the rise of fake news. Marissa joined the Chronicle in 2015. Previously, she covered City Hall for the Sacramento Bee, criminal justice and same-sex marriage for the Salt Lake Tribune and breaking news for the Tampa Bay Times. Born and raised in New York City, Marissa feels the most comfortable in bustling metropolises and is interested in issues of diversity and social justice. Se habla español.