Working with client’s projects get us through lots of new challenges, requirements, implementations and ultimately outperform for the successful project completion. Recently working with such a client, we got a requirement to redirect customers to the previous page from one page checkout. For implementation, we develop custom code which helped to fulfill the requirement.
Custom code to Redirect to Previous Page URL in Magento 2
jQuery("[selector]").click(function(e) { window.location.href = ''; });
If you find such an requirement ever to redirect customers to previous page URL, above code will definitely help you. Let me know in which case you implemented the solution above or give me a holler if need any assistance. I really wish to have feedback and suggestions in my comment section.