Firstly, your safety is paramount. If any protest or protesters become violent towards you or others, including the police interacting with protesters, leave. Your safety is more important and must have a higher value than any photo you take and your safety always come first. No photo is worth you being injured or hurt.
Travelling, mainly for work, I had decided that the photos taken during my trip would be to show my family the famous sights of London with no intention of sharing, so I was surprised to stumble across a what looked like a protest, a peaceful protest, on a bridge, a famous bridge (Westminister Bridge) in London. What an opportunity!
Pushing through the crowds trying to get a feel of what the protest was about I found that there were plenty of photographic opportunities with good light and everyone seemed pretty happy, might be the whacky weed that was in the air, to have their photos taken.
Some people will struggle with my next comment, I selected Auto on my camera and started shooting. Why not? Camera companies spend millions of dollars developing incredibly small computers and sensors to work everything out so why not select auto.
Documentary and street photography are genres that I have always been attracted to, I find them to be challenging as you have little to no control of what is about to happen and how you capture those moments can be a challenge in itself. Ultimately you want people to feel connected to your images and to possibly inspire them in some small way.
Please remember, if you do decide to photograph a protest, remember your safety must come first over any photo opportunities.