MozillaZine

Opening files on a tablet - is it possible?

Talk about Mozilla browsers for small devices such as PDAs and cellphones.
Gwaihir
 
Posts: 58
Joined: March 23rd, 2009, 11:04 am
Location: Cambridge UK

Post Posted February 2nd, 2017, 9:35 am

On my PC I have a HTML file containing links to my most-visited sites and I've set this as my home page. Is there any way to do something similar on my Galaxy Tab A (Android 6)? I've copied the file onto the tablet and managed to open it with the default 'Internet' app but I can't see any way to open it with Firefox. I tried copying and pasting the URL from the Internet app into Firefox but it says the site cannot be found.

As a secondary question, is there any way to copy my Firefox bookmarks onto the tablet?

Thanks for any help.
Best regards,

Mike.

LIMPET235
Moderator

User avatar
 
Posts: 37443
Joined: October 19th, 2007, 1:53 am
Location: The South Coast of N.S.W. Oz.

Post Posted February 2nd, 2017, 9:43 am

Moving to the Mobile forum...
Ancient Amateur Astronomer
Win-7-HP/IntelĀ® DualCore-2.0GHz/500G HDD/4 Gig Ram/550Watt PSU/350WattUPS/Firefox-20.0-50.0/T-bird-2.0.0.24/SnagIt-v10.0.1/MWP-7.11.0.
RadioYachting. Conficker Test. (Always choose the "Custom" Install.)

JanH
 
Posts: 100
Joined: March 23rd, 2011, 1:19 pm

Post Posted February 2nd, 2017, 1:58 pm

Have you given Firefox permission to access your local storage? I think it should ask automatically when downloading files, however this might currently not work properly when opening local files, so you might need to manually grant the permission in that case. Check in Android's Settings -> Apps -> Firefox -> Permissions -> Storage.
On my phone, when I open an HTML file from ES File Explorer, Firefox gets offered as a choice for opening that file. However you're right, using the inbuilt file manager for example it doesn't work. You might want to give the Open in Browser helper app a try.

You can then copy the file URL from the address bar (Edit: see post below) and set it as your home page in Firefox's settings (Settings -> General -> Home -> Homepage, choose "custom" and paste the file URL). Note that currently the home page is only shown when you have no tabs open, so you either need to manually close all tabs or set Settings -> Advanced -> Restore tabs to "Don't restore".

Firefox 53 will also add on option for "Open tabs" under Settings -> Privacy -> Clear private data on exit (which also enables the "Quit" button in the main menu), which means you can keep the Restore tabs setting on "Always restore" (so tabs are restored automatically when Android decides to kill Firefox), but still have an easy way of closing all your tabs before exiting Firefox, so your homepage can show up the next time you start it.

As for bookmarks, that's only possible via Sync (and currently doesn't work if you've got a really large amount of bookmarks, although that'll change soon).
Last edited by JanH on February 3rd, 2017, 2:12 am, edited 1 time in total.

JanH
 
Posts: 100
Joined: March 23rd, 2011, 1:19 pm

Post Posted February 3rd, 2017, 2:11 am

JanH wrote:You can then copy the file URL from the address bar and set it as your home page in Firefox's settings (Settings -> General -> Home -> Homepage, choose "custom" and paste the file URL).
Hmm, on closer inspection it seems that at least for newer Android versions, "Open in Browser" copies the original document into its cache and then passes that URL to the browser, so not really ideal. So you still might want to check whether a different file browser offers opening HTML files directly with Firefox.

Gwaihir wrote:I tried copying and pasting the URL from the Internet app into Firefox but it says the site cannot be found.
How does that URL look like?

Gwaihir
 
Posts: 58
Joined: March 23rd, 2009, 11:04 am
Location: Cambridge UK

Post Posted February 3rd, 2017, 2:52 am

Hi JanH,

Thanks for your reply. I'll try out your suggestions later and report back. I'll also post the URL of the file.

Regarding the 'Open in browser' app, the first time I tapped on the file Android offered me the choice of Chrome or Internet to open it. I chose Internet and it opened successfully. Now each time I tap it it opens in Internet by default and I haven't found a way to change that yet. Would 'Open in browser' override this behaviour and allow me to choose a different browser?
Best regards,

Mike.

JanH
 
Posts: 100
Joined: March 23rd, 2011, 1:19 pm

Post Posted February 3rd, 2017, 10:24 am

You can clear any default app associations by going to Settings -> Apps -> <App name> -> Open by default -> Clear defaults.

Gwaihir
 
Posts: 58
Joined: March 23rd, 2009, 11:04 am
Location: Cambridge UK

Post Posted February 3rd, 2017, 1:03 pm

Hi JanH,

Ok, the Clear defaults worked. When I tap the HTML file I am again offered a choice but that doesn't include Firefox, it's just Chrome, Internet and HTML viewer even though, as far as I can tell, Firefox is set as the default browser.

I have changed the permission for Firefox to access storage but it still reports the web page can't be found. The URL is content://0@media/external/file/192

I have tried entering that URL as a custom homepage but when I launch Firefox with no tabs open it goes to the pop-up offering the other three alternatives for opening the file.

Incidentally I think you missed out a step in your paths to get to the settings. For example I had to go: Settings -> Applications -> Application manager -> Firefox -> Permissions -> Storage.
Best regards,

Mike.

JanH
 
Posts: 100
Joined: March 23rd, 2011, 1:19 pm

Post Posted February 4th, 2017, 12:20 pm

Regarding the URL, Firefox probably wants a file:// URL with the normal file system path to the file, which is why the content:// probably doesn't work. Why Firefox doesn't get offered as a choice for opening that file even via "Open in Browser" I can't say, though. My phone runs Android 6 as well, but it's a) a Motorola and b) rooted on top - maybe Samsung does something differently here?

Assuming you've copied the file onto the internal storage, does Firefox show anything if you try navigating to file:///storage/emulated/0?

Gwaihir wrote:Incidentally I think you missed out a step in your paths to get to the settings. For example I had to go: Settings -> Applications -> Application manager -> Firefox -> Permissions -> Storage.
Not intentionally - presumably Samsung has slightly reconfigured the Settings app for its devices.

Gwaihir
 
Posts: 58
Joined: March 23rd, 2009, 11:04 am
Location: Cambridge UK

Post Posted February 5th, 2017, 6:20 am

I never thought it was intentional. :)

As an experiment I tried replacing content:// with file:// but it made no difference.

I must admit, as a relative newcomer to Android devices, I'm surprised and disappointed that none of the default browsers, or Firefox, offer the option to open a local HTML file.
Best regards,

Mike.

chaanakya

User avatar
 
Posts: 18
Joined: June 15th, 2017, 9:40 pm

Post Posted June 15th, 2017, 10:52 pm

As JanH suggested, do you see anything if you type file:///storage/emulated/0 into the location bar?

Return to Mobile


Who is online

Users browsing this forum: No registered users and 2 guests