Mayor Bill de Blasio and the rest of our city’s political establishment say they’re shocked and disgusted by the recent videos of abuse directed at police officers.

That leaves most police officers wondering: What, exactly, were they expecting?

What did they think would happen when they campaigned on the promise of “reining in” the police, when they legitimized and then ceded the streets to the most extreme voices, the ones who proclaim “all cops are bad”?

What did they think would happen when they enacted policies that all but erased prohibitions on disorderly and anti-social behavior, reducing the quality-of-life standards in our neighborhoods to the lowest common denominator?

What did they think would happen when they saddled police officers with layer after layer of scrutiny and second-guessing, removed critical enforcement tools from police officers, invited and entertained baseless allegations of misconduct with the potential to derail police officers’ careers and sacrificed individual cops at the altar of political expediency?

Did they think that any of this would foster respect for the law — or the women and men who enforce it?

We have warned again and again that the environment police officers face on the street has been growing increasingly hostile, that the most basic interactions don’t even escalate into confrontations — they begin that way, before the first cops on the scene have even uttered a single word.

Worse, the videos of vulgar abuse, and the threats of violence or sexual assaults that have recently made headlines, are just the tip of the iceberg. Every police officer on patrol can attest that there is much more — and much worse — happening on the streets on a daily basis that isn’t being videotaped by those seemingly proud of their actions.

And the mayor’s response is to admonish the criminals and disruptive attention-seekers, warning them that their behavior is not “cute or cool,” that they should “knock it off” — or else.

Or else … what?

If the mayor, the City Council and the rest of our city leaders actually want to put a stop to this behavior, they need to immediately begin unwinding the public-safety policies that have normalized criminal behavior.

They need to send an unambiguous message that proactive policing is the No. 1 priority, that police officers should exercise their professional judgment to address disorder in all its forms, before it turns into more serious crime.

And when police officers exercise that judgment and discharge our duties in good faith, our city’s leaders need to have the courage to face down the anti-police agitators and actually back us up.

They need to do this now, not merely because police officers feel marginalized and disrespected, but because that marginalization and disrespect prevents us from protecting communities from the same abhorrent behavior.

When appropriate, police officers will continue to simply walk away from this vulgarity and abuse. When appropriate, we will issue a summons or make an arrest. But once we leave the scene or the harassers have been released with a slap on the wrist, they will remain in the community, emboldened to turn their abuse on their law-abiding neighbors.

And no matter what obscenities are hurled at us as we go about our day, that is the part that bothers us the most.

Patrick J. Lynch is president of the Patrolmen’s Benevolent Association.