I don't know about other states, but here in Pa, they aren't allowed within 200 yards of the funeral home or the church. They must obtain a court approved permit to protest and that permit comes with VERY STRICT guidelines. For instance, it dictates the exact times that they are allowed to assemble, where they are allowed to assemble etc, etc. Any violation of the permit results in the imediate arrest of the entire group.
I was with PGR at the funeral of a murdered PGH Policeman and they showed up.They were in thier van and leaving the area after thier permit expired. One of them opened the vehicle window, yelled an obscene remark. Pa state Toopers imediately ran the van down and arrested everyone on board.