How do they know if the browser it’s on France?
They don't.
Do all browsers need to have it?
Everything released in France, similar to how every major browser have different download binary for China.
What’s stopping them to use that as a sensoring tool for not allowing people to access our website talking s*** about the government?
Nothing, that's the real issue with oppossing this as once it's passed it will never be reverted and give the power forever (technically it can be changed, but it never happens in lowering the goverment power).
I suspect the law will fail to pass due to it being to hard to enforce, but you never know with idealogical fanatics.