Democratic lawmakers in Illinois have proposed a bill that would force gun buyers to reveal their social media accounts to police before purchasing a firearm.

State Rep. Daniel Didech, one of the bill's sponsors, told WBBM-TV that the bill's purpose was meant to identify those who may have mental health issues before they're approved to buy a gun.

"This is something my community is demanding action on," Didech told the news station.

Supporters of the bill have argued that some mass killers, such as Nikolas Cruz, who murdered 17 people at Parkland (Florida) High School nearly a year ago, post red flags on social media before they act.

"A lot of people who are having mental health issues will often post on their social media pages that they're about to hurt themselves or others," he added. "We need to give those people the help they need."

What do the bill's opponents say?

Gun rights groups, as well as and First Amendment rights groups, are opposed to the legislation.

"When people look at this, everyone who has a Facebook account or email account or Twitter account will be incensed or should be," Richard Pearson, executive director of the Illinois State Rifle Association, said.

Rebecca Glenberg of the American Civil Liberties Union of Illinois told WBBM that it opposes the measure because it could allow police bias against some citizens. She added that "a person's political beliefs, a person's religious beliefs ... should not play a part in whether someone gets a FOID card."

What else?

Didech has defended the legislation claiming it's less intrusive than a bill proposed in New York state. The New York measure, if approved, would reportedly allow law enforcement officials to review the entire browsing history of those who apply for a gun license.

"It gives Illinois State Police additional tools to make sure that dangerous weapons aren't getting into the hands of dangerous people," he told WBBM.