[fr] fix JS positioning code and regex