fork-maintainers / iceraven-browser

Iceraven Browser
4.69k stars 222 forks source link

support for offline html files #281

Open mohibo opened 3 years ago

mohibo commented 3 years ago

What is the user problem or growth opportunity you want to see solved?

I Want the support for offline html files

How do you know that this problem exists today? Why is this important?

It's important because i can see my offline html files when im not connected on the internet

Who will benefit from it?

Everyone

interfect commented 3 years ago

This would definitely be great to have! I haven't the first clue how to do it, though.

p1usminus commented 3 years ago

I tried to approximately replicate this feature with a couple of extensions in Fennec, Iceraven (and Kiwi), as it seems like the offline capability has been completely removed!

https://addons.mozilla.org/en-GB/firefox/addon/readability-based-reader-view/ - this installs on Fennec (68.11.0) but does not add a menu item, but on desktop Firefox it adds an icon to the address bar. I am wondering if it would work in Iceraven. ('Refresh in URL bar in Android' which is part of the collection does not add anything to the address bar but does add a menu item, which surprised me.)

If it worked in Iceraven it would be a fairly simple way to save simplified pages as HTML files, but I cannot think of a way to bookmark an offline version of a page as we could on 68. You could potentially bookmark the file:/// URI of the saved file, but it's quite kludgy and I get very different paths using Fennec (from cache, which is cleared on exit in my case), and Kiwi using the same addon.

mohibo commented 3 years ago

any new update?

vehosah commented 3 years ago

umm it actually works,but you have to use file manager plus

GamerGirlandCo commented 2 years ago

so i did a bit of digging and i think i found a solution, albeit in two parts:

part 1 involves tinkering in about:config (as per this article )

part 2 involves altering the code responsible for the inability to load local files: https://github.com/mozilla-mobile/android-components/commit/67d138fe074177e51895fc191451ce64e170a29f

so i guess i could just fork the android components repository and remove the list of blocked schemes? and maybe add the following lines to user.js?

user_pref("capability.policy.policynames", "localfilelinks");
user_pref("capability.policy.localfilelinks.checkloaduri.enabled", "allAccess");

i'm relatively noobish when it comes to android development.. ^^"

serj-kzv commented 2 years ago

Simple extension to open local html files. I tested it with utf-8 encoding only.

https://addons.mozilla.org/en-US/firefox/addon/simple-open-html-file-button/

UPD. Added support of non UTF-8 html files.
See how to install any extension in Firefox Nightly for Android here

UPD2. Bug with encoding detection is fixed. Quantity of bytes to detect encoding was increased, option page was fixed. Sorry for the bug, people who installed the extension early should update it to the latest version, go to Option page and reset configuration.
If you have problems with encoding you can increase number of bytes to detect encoding or disable encoding detection at all if you use UTF-8 files only. For example SingleFile converts all HTML files to UTF-8 and thus there is no need to use encoding detection.

Sorry again for the bug, I will not use the page as a change log anymore. (:

Vandino86 commented 1 year ago

Simple extension to open local html files. I tested it with utf-8 encoding only.

https://addons.mozilla.org/en-US/firefox/addon/simple-open-html-file-button/

UPD. Added support of non UTF-8 html files.
See how to install any extension in Firefox Nightly for Android here

UPD2. Bug with encoding detection is fixed. Quantity of bytes to detect encoding was increased, option page was fixed. Sorry for the bug, people who installed the extension early should update it to the latest version, go to Option page and reset configuration.
If you have problems with encoding you can increase number of bytes to detect encoding or disable encoding detection at all if you use UTF-8 files only. For example SingleFile converts all HTML files to UTF-8 and thus there is no need to use encoding detection.

Sorry again for the bug, I will not use the page as a change log anymore. (:

Is it possible to install this in Iceraven 1.19.0? I can't seem to get it installed. Do I have to switch to Firefox Nightly?

DavidInHawawii commented 8 months ago

Well, the extension installs in Iceraven 2.14.2 on Android but no button appears and trying the "file://" protocol does nothing. Even after quitting Iceraven and restarting it, no button appears.

The only solution I've found to opening local HTML files on Android is:

  1. Use a file manager to navigate to the local file.
  2. Tap the open file. 3,. Open the file in Android Webview.
  3. Tap a link in it and choose to open that in Better Open With.
  4. Select Iceraven as the application the open the file in Better Open With.

If you don't have Better Open With, Android offers a list of applications for opening HTML files. I presume Iceraven appears as an option there, although it might not.

Thanks for trying to find ways around Mozilla's idiotic "security theater" about not opening local HTML files...For what it's worth, a malicious website could serve a booby-trapped image file as a download (calling it the "full rez version" for an image), and Mozilla would happily download it to your Downloads folder. From there, via a file manager, the user can tap the booby-trapped image and...open it in Firefox.

Vandino86 commented 8 months ago

Well, the extension installs in Iceraven 2.14.2 on Android but no button appears and trying the "file://" protocol does nothing. Even after quitting Iceraven and restarting it, no button appears.

By "button", do you mean the one that should show up in the Add-ons menu? Have you tried uninstalling and reinstalling the extension or Iceraven?

I installed simple-open-html-file-button on Iceraven a few versions ago, and it still works for me on Iceraven 2.14.2. The extension appears for me in the aforementioned Add-ons menu (three vertical dots > Add-ons > Open HTML) and when I open it, a tab appears with large text saying "Press me to Open". Tapping on the text brings up the default file manager. From there, I can open up an HTML file just fine.

Screenshot_20240122-080146_Iceraven.png

Screenshot_20240122-080456_Iceraven.png

Screenshot_20240122-080151_Iceraven.png

One issue that I still have with this method is that if you have a folder structure of HTML files in different (sub)folders and index.html (the top level one) contains links to those other local .html files, then those links won't work. Cromite has essentially the same issue.

DavidInHawawii commented 8 months ago

Thanks.

On the Iceraven home screen, going to the Add-Ons menu shows the extensions (where you can access their settings). It doesn't show an Open HTML button that lets me open an HTML file, it just shows the extension.

The only way to make the button visible is to open a regular internet website and go to the Add-Ons menu. Then the Open HTML button appears and works. After that, tapping the Press Me screen lets me load an HTML file.

Unfortunately, that's not very useful. I keep an HTML file with my collection of standard links in it. I do this because if I ever have to uninstall and reinstall Iceraven, all existing bookmarks and settings are wiped out. Makes the process very difficult! My HTML file has sections and a set of jump links at the top to get to a section. Opening the HTML file via the Open HTML button works great, but links in the file do not work at all.

I don't know if that's a limitation forced on us by Mozilla extension security policies.

Android's HTML Viewer can also open local HTML files, and links in those files work.

Ideas?