File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -235,17 +235,25 @@ open_in_browser(){
235235url_handler (){
236236 cleanurl=$( _clean_url " $* " )
237237 cleanurl=${cleanurl:- $1 }
238- case " $cleanurl " in
239- ** ted.com/** |* youtube.com/watch* |* youtube.com/playlist* |* youtu.be* |* //www.twitch.tv/* |* //twitch.tv/* |* .mp4|* .mkv|* .webm|* .mp3|* .flac|* .opus|* mp3? source* |* gifv|* .m3u|* .m3u8)
240- open_video_with " $cleanurl "
241- ;;
242- * png|* jpg|* jpe|* jpeg|* gif|* .jpg\? r=* )
243- open_picture_with " $cleanurl "
244- ;;
245- * )
246- open_in_browser " $cleanurl "
247- ;;
248- esac
238+ local domain=$( echo " $cleanurl " | awk -F \/ ' {l=split($3,a,"."); print (a[l-1]=="com"?a[l-2] OFS:X) a[l-1] OFS a[l]}' OFS=" ." )
239+ if [ -f " ${NBROWSER_CONFIG_DIR} /dbangs/${domain} " ] ; then
240+ source " ${NBROWSER_CONFIG_DIR} /dbangs/${domain} "
241+ has nbrowser_dbang || _pemx " couldn't find nbrowser_dbang() function in ${NBROWSER_CONFIG_DIR} /dbangs/${domain} "
242+ shift
243+ nbrowser_dbang " $cleanurl "
244+ else
245+ case " $cleanurl " in
246+ ** ted.com/** |* youtube.com/watch* |* youtube.com/playlist* |* youtu.be* |* //www.twitch.tv/* |* //twitch.tv/* |* .mp4|* .mkv|* .webm|* .mp3|* .flac|* .opus|* mp3? source* |* gifv|* .m3u|* .m3u8)
247+ open_video_with " $cleanurl "
248+ ;;
249+ * png|* jpg|* jpe|* jpeg|* gif|* .jpg\? r=* )
250+ open_picture_with " $cleanurl "
251+ ;;
252+ * )
253+ open_in_browser " $cleanurl "
254+ ;;
255+ esac
256+ fi
249257}
250258
251259main (){
You can’t perform that action at this time.
0 commit comments