I had the same problem, so I wrote my own function for it. 
(Thanks to the guy below who had a way to do it without having to use the registry. I modified my own with this.)

The strategy is to store the url under the Vim-cursor to a variable 
```
let url = expand('<cWORD>')
``` 
and then use bash to open firefox with the url as argument:
```
call feedkeys(':!bash firefox ' . url . ' &' . "\<CR>\<ESC>" )
```
The `&` is used to open firefox in the background.


We put this into a function and then remap gx to run that function.
```
nnoremap gx :call OpenURL()<CR>
```
The `<CR>` is to actually execute the command in Vim.

In total it looks like this:

```
function! OpenURL()
    let url = expand('<cWORD>')
    call feedkeys(':!bash firefox ' . url . ' &' . "\<CR>\<ESC>" )
endfunction

nnoremap gx :call OpenURL()<CR>
```