SharePoint 2010 - How to add webparts to AllItems.aspx,NewForm.aspx

Sometime there could be requirement to add custom javascript code or even adding webparts to Allitems.aspx and NewForm.aspx, etc.,  The catch here is they are system files and there is not option for editing page. So how to add a webpart say for example content editor webpar with custom JavaScript code or CSS.

Here is the quicktip for editing the page-

Adding ?toolpaneview=2 to the end of the URL will do the trick -


what if NewForm.aspx open in a dialog box, just remove IsDlg=1 from the ulr (right click on the windows and click on the properties)

Before -


After -


The resultant view would look like the following screenshot -