ECB Menu For SharePoint or Custom action menu is available for user access at different locations in SharePoint. It can be an icon/text, which can be used to implement functionality such as navigating to a landing page, starting a Workflow on an item or any custom action inside SharePoint.
By default SharePoint provides the default custom action like edit, delete and view item options.
Here we will be adding new ECB Menu as “Custom Edit Page” as shown in the below image.

On click of the Cusom Edit Link, it will be redirected to my custom edit page which I have created under list form.

Also, I am passing the ID of current list item as well as Source page URL from where it will be redirected back after performing action on redirected edit page.
It can be implemented with any list/library, however I have implemented it on list.
You can use any ScriptEditor/CEWP on your page and put all below scripts as is by just changing the list name and URL.
Full Script