From 84aec355b85058b7d5683c77873784380accb9e2 Mon Sep 17 00:00:00 2001 From: leency Date: Tue, 25 Feb 2025 15:51:03 +0200 Subject: [PATCH] Fix #8: The "webview" web browser, started with the parameter, address with the name of the download file, downloads the same file multiple times. --- programs/cmm/browser/WebView.c | 6 ++++-- programs/cmm/browser/cache.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/programs/cmm/browser/WebView.c b/programs/cmm/browser/WebView.c index 96a9b74a2..d07b88a6d 100644 --- a/programs/cmm/browser/WebView.c +++ b/programs/cmm/browser/WebView.c @@ -222,7 +222,7 @@ void main() http.receive(); if (http_get_type==PAGE) { - CheckContentType(); + CheckContentType(); prbar.max = http.content_length; if (prbar.value != http.content_received) { prbar.value = http.content_received; @@ -946,8 +946,10 @@ void CheckContentType() StopLoading(); } else if (content_type[0] == 'a') { - EventOpenDownloader(http.cur_url); + http_get_type = FILE; StopLoading(); + if (!canvas.bufw) OpenPage(DEFAULT_URL); //Fixed: Browser was launched with file param + EventOpenDownloader(http.cur_url); } else { WB1.custom_encoding = -1; diff --git a/programs/cmm/browser/cache.h b/programs/cmm/browser/cache.h index 13729d184..cd7e77426 100644 --- a/programs/cmm/browser/cache.h +++ b/programs/cmm/browser/cache.h @@ -1,5 +1,5 @@ enum { - PAGE=1, IMG + PAGE=1, IMG, FILE }; struct _cache