" Tridactyl configuration
" Source this file from ~/.config/tridactyl/tridactylrc with:
"   source /path/to/this/tridactylrc

" Disable Tridactyl completely on sites that break with it
" Uses seturl with regex pattern - prevents Tridactyl from injecting anything
seturl my\.sevdesk\.de superignore true

" Smooth scrolling
set smoothscroll true

" Don't focus input fields automatically
set allowautofocus false

" Allow autofocus on HedgeDoc/CodiMD instances (detected dynamically)
autocmd DocLoad .* js if (document.title.includes('HedgeDoc') || document.title.includes('CodiMD') || document.querySelector('meta[name="application-name"][content="HedgeDoc"]')) { tri.excmds.set('allowautofocus', 'true'); }

" Remove dangerous default binding (d closes tab)
unbind d

" Enter ignore mode with Insert key (exit with Shift+Escape)
bind <Insert> mode ignore

" Show hints for input fields with ;e
bind ;e hint -t input,textarea,select

" Open current page in mpv (using mpvsafe for proper escaping)
bind gv composite get_current_url | mpvsafe

" Open current page through archive.ph
bind gA js tri.excmds.tabopen('https://archive.ph/' + document.location.href)
" Custom command to open URL via archive.ph
command archiveph js -p tri.excmds.tabopen('https://archive.ph/' + JS_ARG)
" Select a link and open it through archive.ph
bind ;gA hint -W archiveph
