All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad, sallallaahu`alayhi wa sallam, is His slave and Messenger.
If the person resides in a city where the Friday prayer is observed, he has to attend the Friday prayer in the Masjid, even if it (i.e., the Masjid) is so remote that he does not hear the Adhaan (i.e., the call to prayer). However, if the person is residing outside the city at a distance of more than one Farsakh (i.e., more than five kilometers), he is not obliged to attend the prayer in the Masjid. Yet, if the person lives inside the city, he has to attend the Friday prayer in the Masjid even if there is a long distance between his house and the Masjid.
Commenting on Al-Kharqee’s statement “Friday prayer is obligatory upon the person who is one Farsakh away from the Masjid,” Ibn Qudaamah said, “This ruling applies to people other than the dwellers of a city. As for the dwellers of a city, they are obliged to attend the Friday prayer in the Masjid, be it closer to/far from them. Ahmed said, 'As for the inhabitants of a city, they have to attend the Friday prayer in the Masjid, whether they heard the call to prayer or not. That is because the cities have been originally established so that Friday prayers would be observed, and thus there is no difference between being close to the Masjid or far from it.”
It is thus clear that you have to attend the Friday prayer in the Masjid if you reside inside the city; however, if you fear any danger would befall you if you walk to the Masjid – as you mentioned in your question – yet you were able to take a taxi, or someone else would give you a lift for free, you have to attend the Friday prayer in the Masjid. In Daqaa’iq O’loo An-Nuhaa, Al-Bohooti Al-Hanbali said, “Friday prayer is obligatory upon whoever can attend it on condition that no harm would befall him if he would come to it riding (over an animal) or someone else would carry him for free. It is also obligatory upon the blind if someone would lead him for free to the Masjid.” In Al-Furoo’, Ibn Muflih said, “As far as the Friday prayer is concerned, Al-Mardawi narrated, 'He has to rent an animal and ride it.”
However, if you are unable to find a means of transportation to take you to the Masjid, we hope you would be excused for not attending the Friday prayer as long as you fear that harm might befall you if you try to walk on the highway, taking into account that there is no other safe road. On that, jurists opine that "fearing any harm would befall the self" is one of the valid, legal excuses that make the Friday prayer not obligatory upon the person.
Allah knows best.