From 0c1f13135d6befd779686d500bccd595a10eb47c Mon Sep 17 00:00:00 2001 From: Brahma Date: Wed, 6 Nov 2024 09:19:48 +0545 Subject: [PATCH 1/2] Added Auto-prepend https:// to URLs without scheme in termux-open-url --- scripts/termux-open-url.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/termux-open-url.in b/scripts/termux-open-url.in index 093350e..00d9f1f 100644 --- a/scripts/termux-open-url.in +++ b/scripts/termux-open-url.in @@ -7,5 +7,11 @@ if [ $# != 1 ] && [ $# != 2 ]; then fi case "${TERMUX__USER_ID:-}" in ''|*[!0-9]*|0[0-9]*) TERMUX__USER_ID=0;; esac +# Check for https & http +if echo "$1" | grep -qE '^(http|https)://'; then + URL="$1" +else + URL="https://$1" +fi am start --user "$TERMUX__USER_ID" -a android.intent.action.VIEW -d "$@" > /dev/null From 8b8e6e6af5a21d4ce6aa6331e3021152c2e1db32 Mon Sep 17 00:00:00 2001 From: Sangharsha <67364489+noob6t5@users.noreply.github.com> Date: Wed, 4 Jun 2025 23:01:59 +0545 Subject: [PATCH 2/2] Update scripts/termux-open-url.in Co-authored-by: Twaik Yont <9674930+twaik@users.noreply.github.com> --- scripts/termux-open-url.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/termux-open-url.in b/scripts/termux-open-url.in index 00d9f1f..585a094 100644 --- a/scripts/termux-open-url.in +++ b/scripts/termux-open-url.in @@ -8,10 +8,10 @@ fi case "${TERMUX__USER_ID:-}" in ''|*[!0-9]*|0[0-9]*) TERMUX__USER_ID=0;; esac # Check for https & http -if echo "$1" | grep -qE '^(http|https)://'; then - URL="$1" -else - URL="https://$1" -fi +# Check for https & http +case "$1" in + http://*|https://*) URL="$1" ;; + *) URL="https://$1" ;; +esac am start --user "$TERMUX__USER_ID" -a android.intent.action.VIEW -d "$@" > /dev/null