Skip to content

Commit

Permalink
Exclude reddit.com URLs from downloading with Chrome.
Browse files Browse the repository at this point in the history
Reddit serves an error message instead of the content when downloading
with Chrome.
  • Loading branch information
xwmx committed Oct 9, 2024
1 parent 054e4d7 commit e173c5b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions nb
Original file line number Diff line number Diff line change
Expand Up @@ -10155,10 +10155,12 @@ _download_from() {

local _target_path="${2:-}"

if ((${NB_BROWSER_DOWNLOAD_ENABLED:-1})) && {
[[ "${_url}" =~ .html$ ]] ||
[[ ! "${_url}" =~ .[a-zA-Z0-9]$ ]]
}
if ((${NB_BROWSER_DOWNLOAD_ENABLED:-1})) &&
{
[[ "${_url}" =~ .html$ ]] ||
[[ ! "${_url}" =~ .[a-zA-Z0-9]$ ]]
} &&
[[ ! "${_url}" =~ ^https://www.reddit.com ]]
then
if _command_exists "google-chrome"
then
Expand Down

0 comments on commit e173c5b

Please sign in to comment.