I am only able to view the JavaScript files of the website via the Script panel. How can I edit it? I tried everything like double clicking the line that i want to
There is a "Scratchpad" built into the Mozilla framework. This can be reached from within Firefox.
In the "Tools" menu under "Web Developer"->"Scratchpad".
Or...
Just right click on any element on your page. Select "inspect element" On the inspector toolbar, far to the right, there is a noteblock "Scratchpad", press it.

Now you get a Javascript editor with syntax highlightning etc.. From here you can open/save your javascript source file.

Read more bout it here.