Adapt for browser

Since issue #49 has been closed by the author, I decided to do my own proposition about how to add support for native browser implementations.