16 year-seven students from School 3 were placed in an advanced algebra course over the summer and then went on to pass the Regents Algebra Exam.Justin Murphy and Erica Bryant and Virginia Butler

Moments before he opened fire in a Pittsburgh synagogue in October, Robert Bowers posted his last in a long series of anti-Semitic messages on social media.

ďHIAS (Hebrew Immigrant Aid Society) likes to bring invaders in that kill our people. I canít sit by and watch my people get slaughtered. Screw your optics. Iím going in,Ē he wrote.

Bowers had legally purchased over many years the four guns he used to kill 11 people at the Tree of Life Congregation Synagogue and six other firearms authorities found in his home.

Though boiling with hatred, Bowers didnít fall into any category of person barred from gun ownership under federal law. He wasnít a felon or a domestic abuser or dishonorably discharged from the military. He wasnít declared mentally ill.

But itís not hard to imagine how anyone in a position to grant Bowers the permits he may have needed to build his arsenal might have thought twice about doing so had the extent of his anti-Semitic screeds online been known.

Thatís what a new bill in the state Senate seeks to do, by requiring anyone applying for a pistol permit or renewing one to consent to an investigation of their social media accounts and online search history by police.

More:†Gun permit seekers would see social media searched under New York bill

Under the measure, police would be empowered to scour three years of an applicantís social media activity on four websites or apps (Facebook, Instagram, Twitter and Snapchat) and a yearís worth of searches on Google, Yahoo and Bing.†

To ensure unfettered police access, the measure demands that applicants hand over their passwords and log-in information.

Police would be required to look for evidence the applicant searched for or used racist or discriminatory language, threatened the safety of another person, inquired about or alluded to an act of terrorism, and, finally, ďany other issue deemed necessary by the investigating officer.Ē

The bill, introduced by state Sen. Kevin Parker, a Democrat from Brooklyn, is well-meaning in that it seeks to protect the unalienable right to life that the Founding Fathers held to be self-evident in the Declaration of Independence.

In aiming to ward off mass murder, however, the measure runs roughshod over the Constitutionís right of free speech under the First Amendment, and the rights to privacy and freedom from unreasonable searches guaranteed by the Fourth Amendment.

Of course, it conflicts with the Second Amendmentís right to bear arms, too. But I donít care much about that, and neither do a lot of people who are sick and tired of mass shootings, street violence, and suicides by gun.

Sixty-one percent of Americans think there should be stricter gun laws and 21 percent want to see the Second Amendment repealed, according to an†Economist/YouGov poll†conducted earlier this year. The same survey found that nearly half of respondents, 46 percent, would be willing to modify the Second Amendment to make it easier to regulate guns.

I do care about any chiseling away at the rights to speak our minds and to privacy. (Ironically, social media enhances our ability to do the former while eroding the latter.)

With the exception of threatening another personís safety, social media posts ó even about the most heinous of topics ó arenít an indication that someone intends to go on a shooting spree.

While itís illegal to discriminate against others based on race, gender, sexual orientation and the like, and criminal to commit crimes motivated by prejudice, itís neither illegal nor criminal to be a bigot.

New Yorkís gun-permit application process is already rigorous. It takes months, involves police interviews with people who know the applicant, and has safeguards in place to keep guns out of the hands of criminals and people with a history of violence and mental illness.

One would hope police doing the vetting are already reviewing the public social media posts of applicants to glean some additional insight on them. Anyone with internet access can do that. Accessing passwords and private conversations, though, is something different.

Thatís presumably why the bill doesnít have a sponsor in the Assembly. New Yorkers Against Gun Violence wonít even commit to endorsing the bill, which was introduced two weeks ago.

The advocacy group is backing a far more effective measure to stop mass shootings, however, in whatís known as the†Extreme Risk Protection Order (ERPO) bill.

The bill enables families, household members and police officers concerned that a person might harm himself or others to petition a court directly for an order temporarily restricting that personís access to guns.

That bill passed the Assembly earlier this year but stalled in the Republican-controlled Senate. With any hope, that will change when Democrats gain control of the chamber in January.

Enabling law enforcement to intervene when gun owners or would-be gun owners are in crisis ó as opposed to subjecting all of them to an unconstitutional dragnet without probable cause or due process ó is a far superior way to stop the next Robert Bowers.

David Andreatta is a Democrat and Chronicle columnist. He can be reached at†dandreatta@gannett.com" style="color: rgb(0, 149, 221); text-decoration-line: none;">dandreatta@gannett.com.