QupZilla / qupzilla

Cross-platform Qt web browser
http://www.qupzilla.com
GNU General Public License v3.0
1.12k stars 348 forks source link

[Feature request] Save page option for text files, python files etc? #2463

Open ghost opened 7 years ago

ghost commented 7 years ago

I am using latest appimage of qupzilla and I found this problem while saving some text and py files. For example I want to download this file http://www.textfiles.com/adventure/221baker.txt when I tried to save this text file File>Save Page as it saves the txt files in the mhtml format. The same thing happens to other programming files such as python, shell etc.

IGNNE commented 7 years ago

"Normal" page download is a built-in function of QWebEngine[1], and currently it can only do (m)html.

I have hacked together a quick and dirty PoC to do this via opening a data: url pointing to the base64 encoded page data, this forces Chromium/QWebEngine to show the regular download dialog (without any request to the server).

//Edit: There it goes: https://github.com/IGNNE/qupzilla/tree/debian9 Sorry for the new branch, master won't compile as I am running on Qt5.7 here. It is basically just v2.1.2 + OpenSSL fix + my edit

nowrep commented 6 years ago

You can do it by choosing "HTML Page (single)" and renaming the file with correct suffix.