Help with making extension for gamepad in html5

Can someone help me with native extension for gamepad in html5?
I looked at example extension by Mathias (https://github.com/defold/extension-html5) and understood almost everything there but with my lack of knowledge of html and javascript, it is too hard for me to make my own extension.
So if someone can help with making this extension it will be amazing.
I created repository for this (https://github.com/Diskaut/Gamepad_html5_extension) but there is only empty extension because I don’t even know where to start.