Hi Majid,
Thanks for writing in!
You cannot validate localhost or http://localhost as our API generator looks for a complete URL, e.g., example.com. In this case, you can map a domain such as local.dev to your localhost. This way, you can easily validate your site. For instructions on setting it up, please refer to this article: http://wesbos.com/localhost-mobile-device-testing/
After that, you should be able to install and activate extensions in your local site.
Thank you!