All perfect praise be to Allah, The Lord of The Worlds, and may His peace and blessings be upon our Prophet Muhammad and upon all of his family and companions.
Involuntary farts is one of the cases that permits a person of not going to Friday prayer nor to a congregational prayer, since it has the same ruling of eating onions or garlic as mentioned in the following Hadith, the Prophet (PBUH) said (What means): "He who has eaten onion or garlic or leek should not approach our mosque, because the angels are also offended by the strong smells) that offend the children of Adam." [Moslim].
Moreover, we advise everyone to maintain and to attend the Friday prayer in particular, but if the person who had the aforementioned problem was sure that he won't control his farting case while performing it, then he is excused and permitted to perform Friday prayer at home as a noon prayer. And Allah Knows Best.