Skip to content

Commit b92fba8

Browse files
committed
Add support for waterfox
Closes #1679
1 parent c4ab7d2 commit b92fba8

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

autoload/firenvim.vim

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,21 @@ function! s:get_firefox_manifest_dir_path() abort
342342
return s:build_path([$HOME, '.mozilla', 'native-messaging-hosts'])
343343
endfunction
344344

345+
function! s:waterfox_config_exists() abort
346+
let l:p = [$HOME, '.waterfox']
347+
if has('win32') || s:is_wsl
348+
let l:p = [s:get_windows_env_path('%USERPROFILE%'), '.waterfox']
349+
endif
350+
return isdirectory(s:build_path(l:p))
351+
endfunction
352+
353+
function! s:get_waterfox_manifest_dir_path() abort
354+
if has('win32') || s:is_wsl
355+
return s:get_data_dir_path()
356+
end
357+
return s:build_path([$HOME, '.waterfox', 'native-messaging-hosts'])
358+
endfunction
359+
345360
function! s:librewolf_config_exists() abort
346361
let l:p = [$HOME, '.librewolf']
347362
if has('win32') || s:is_wsl
@@ -830,6 +845,12 @@ function! s:get_browser_configuration() abort
830845
\ 'manifest_dir_path': function('s:get_librewolf_manifest_dir_path'),
831846
\ 'registry_key': 'HKCU:\Software\LibreWolf\NativeMessagingHosts\firenvim',
832847
\},
848+
\'waterfox': {
849+
\ 'has_config': s:waterfox_config_exists(),
850+
\ 'manifest_content': function('s:get_firefox_manifest'),
851+
\ 'manifest_dir_path': function('s:get_waterfox_manifest_dir_path'),
852+
\ 'registry_key': 'HKCU:\Software\Waterfox\NativeMessagingHosts\firenvim',
853+
\},
833854
\'opera': {
834855
\ 'has_config': s:opera_config_exists(),
835856
\ 'manifest_content': function('s:get_chrome_manifest'),
@@ -851,6 +872,7 @@ function! s:get_browser_configuration() abort
851872
\}
852873
if $TESTING == 1
853874
call remove(l:browsers, 'librewolf')
875+
call remove(l:browsers, 'waterfox')
854876
call remove(l:browsers, 'brave')
855877
call remove(l:browsers, 'chrome-dev')
856878
call remove(l:browsers, 'opera')

0 commit comments

Comments
 (0)