Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

You will receive a legacy which will place you above want.


comp / comp.mobile.android / Re: viewing local htm files on Android device

SubjectAuthor
* viewing local htm files on Android deviceMalone
+* Re: viewing local htm files on Android deviceCarlos E. R.
|`- Re: viewing local htm files on Android deviceArno Welzel
`- Re: viewing local htm files on Android deviceArno Welzel

1
Subject: viewing local htm files on Android device
From: Malone
Newsgroups: comp.mobile.android
Organization: To protect and to server
Date: Tue, 23 Jul 2024 05:31 UTC
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!newsfeed.bofh.team!paganini.bofh.team!not-for-mail
From: mslone@nospam.uk (Malone)
Newsgroups: comp.mobile.android
Subject: viewing local htm files on Android device
Date: Tue, 23 Jul 2024 17:31:24 +1200
Organization: To protect and to server
Message-ID: <v7nf7c$g03g$1@paganini.bofh.team>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 23 Jul 2024 05:31:24 -0000 (UTC)
Injection-Info: paganini.bofh.team; logging-data="524400"; posting-host="qop0JBtzsiygxiMEfO+tHg.user.paganini.bofh.team"; mail-complaints-to="usenet@bofh.team"; posting-account="9dIQLXBM7WM9KzA+yjdR4A";
User-Agent: Mozilla Thunderbird
Content-Language: en-NZ
X-Notice: Filtered by postfilter v. 0.9.3
View all headers

I've created a simple (just text, no script) .htm file on a Windows
computer ("testhtm.htm") and transferred it to my Android tablet.

In My Files - Downloads it then appears as "testhtm.htm". Tapping it and
it opens with Chrome (my default browser) as
"content:media/external/file/1000000383".

Long tap and select "Add to Home Screen" and an icon appears on the home
screen titled "testhtm". And when tapping this it opens in Chrome.

If I now restart (reboot) the tablet and try to open the file by tapping
its icon on the home page it doesn't open and I receive the message:
"Chrome does not have access to the requested resource."

If I then go to My Files - Downloads I find I can open it from there.
And if I then go back to the home page it will now open from there as well.

Why is this?

I have links on my home page to .htm pages located on servers on the
internet which always open with no problems. But .htm files located on
my tablet seem to become inaccessible from the home page after a reboot
until opened from within My Files - Downloads.

Can someone with a better understanding of the Android OS than me
explain what's going on?

Subject: Re: viewing local htm files on Android device
From: Dave Royal
Newsgroups: comp.mobile.android
Organization: news.eternal-september.org
Date: Thu, 1 Jan 1970 00:00 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dave@dave123royal.com (Dave Royal)
Newsgroups: comp.mobile.android
Subject: Re: viewing local htm files on Android device
Date: Wed, 24 Jul 2024 21:40:00 +0100 (GMT+01:00)
Organization: news.eternal-september.org
Lines: 46
Message-ID: <v7ror3$1t3ob$1@dont-email.me>
References: <v7nf7c$g03g$1@paganini.bofh.team>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 24 Jul 2024 22:40:04 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="79bde6cce1eacace546bc2262a80dae4";
logging-data="2002699"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+hHMHxOB4MqBv3qYTd8Wkc"
Cancel-Lock: sha1:SzOoN0QZFWiTIoid2T0jTXFROZ8=
X-Newsreader: Mod.PiaoHong.Usenet.Client:2.02.M16
View all headers

Malone <mslone@nospam.uk> Wrote in message:

>
> I've created a simple (just text, no script) .htm file on a Windows
> computer ("testhtm.htm") and transferred it to my Android tablet.
>
> In My Files - Downloads it then appears as "testhtm.htm". Tapping it and
> it opens with Chrome (my default browser) as
> "content:media/external/file/1000000383".
>
> Long tap and select "Add to Home Screen" and an icon appears on the home
> screen titled "testhtm". And when tapping this it opens in Chrome.
>
> If I now restart (reboot) the tablet and try to open the file by tapping
> its icon on the home page it doesn't open and I receive the message:
> "Chrome does not have access to the requested resource."
>
> If I then go to My Files - Downloads I find I can open it from there.
> And if I then go back to the home page it will now open from there as well.
>
> Why is this?
>
> I have links on my home page to .htm pages located on servers on the
> internet which always open with no problems. But .htm files located on
> my tablet seem to become inaccessible from the home page after a reboot
> until opened from within My Files - Downloads.
>
> Can someone with a better understanding of the Android OS than me
> explain what's going on?

In the absence of an authoritative answer, and based on some
googling (I am not a developer of Android apps), I'll offer a
guess.

I suspect that for the content URI in the shortcut (which is a
pointer to a local resource, and AFAICS not the same as a file://
URI) can only be accessed if Chrome has access to a Content
Provider and for some reason (maybe a bug) there isn't one after
a reboot. Perhaps accessing the content using My Files causes a
Content Provider to be established, which can the be used by
Chrome to access the content URI passed as a result of tapping
the shortcut.

<https://developer.android.com/guide/topics/providers/content-provider-basics>
--
Remove numerics from my email address.

Subject: Re: viewing local htm files on Android device
From: Andy Burns
Newsgroups: comp.mobile.android
Date: Wed, 24 Jul 2024 20:58 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: usenet@andyburns.uk (Andy Burns)
Newsgroups: comp.mobile.android
Subject: Re: viewing local htm files on Android device
Date: Wed, 24 Jul 2024 21:58:13 +0100
Lines: 15
Message-ID: <lgd875F2uo4U1@mid.individual.net>
References: <v7nf7c$g03g$1@paganini.bofh.team> <v7ror3$1t3ob$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net qTAog6pW82ysUej/mI3ZWAvURk2mmHHiWDIjNsbHt6RTF481Xn
Cancel-Lock: sha1:xlEIWFcL0egewQM7BDm0JowaEWg= sha256:bGUX+10yJmOPfhf21MFiIlovC1gALegVvULDgbElWug=
User-Agent: Mozilla Thunderbird
Content-Language: en-GB
In-Reply-To: <v7ror3$1t3ob$1@dont-email.me>
View all headers

Dave Royal wrote:

> In the absence of an authoritative answer, and based on some
> googling (I am not a developer of Android apps), I'll offer a
> guess.
>
> I suspect that for the content URI in the shortcut (which is a
> pointer to a local resource, and AFAICS not the same as afile://
> URI)

In a similar case, where we load a lot of documents (mixed .pdf and
..html) onto an android tablet for use in a vehicle, we ended up
installing a local web server on the tablet (and even paying the
developer for a few tweaks to it).

Subject: Re: viewing local htm files on Android device
From: Malone
Newsgroups: comp.mobile.android
Organization: To protect and to server
Date: Thu, 25 Jul 2024 19:28 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!newsfeed.bofh.team!paganini.bofh.team!not-for-mail
From: mslone@nospam.uk (Malone)
Newsgroups: comp.mobile.android
Subject: Re: viewing local htm files on Android device
Date: Fri, 26 Jul 2024 07:28:13 +1200
Organization: To protect and to server
Message-ID: <v7u90d$198qd$1@paganini.bofh.team>
References: <v7nf7c$g03g$1@paganini.bofh.team> <v7ror3$1t3ob$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 25 Jul 2024 19:28:14 -0000 (UTC)
Injection-Info: paganini.bofh.team; logging-data="1352525"; posting-host="BRsQPiL3od7507v1mf+eeA.user.paganini.bofh.team"; mail-complaints-to="usenet@bofh.team"; posting-account="9dIQLXBM7WM9KzA+yjdR4A";
User-Agent: Mozilla Thunderbird
X-Notice: Filtered by postfilter v. 0.9.3
Content-Language: en-NZ
View all headers

On Thu-25-Jul-2024 8:40 am, Dave Royal wrote:
> Malone <mslone@nospam.uk> Wrote in message:
>
>>
>> I've created a simple (just text, no script) .htm file on a Windows
>> computer ("testhtm.htm") and transferred it to my Android tablet.
>>
>> In My Files - Downloads it then appears as "testhtm.htm". Tapping it and
>> it opens with Chrome (my default browser) as
>> "content:media/external/file/1000000383".
>>
>> Long tap and select "Add to Home Screen" and an icon appears on the home
>> screen titled "testhtm". And when tapping this it opens in Chrome.
>>
>> If I now restart (reboot) the tablet and try to open the file by tapping
>> its icon on the home page it doesn't open and I receive the message:
>> "Chrome does not have access to the requested resource."
>>
>> If I then go to My Files - Downloads I find I can open it from there.
>> And if I then go back to the home page it will now open from there as well.
>>
>> Why is this?
>>
>> I have links on my home page to .htm pages located on servers on the
>> internet which always open with no problems. But .htm files located on
>> my tablet seem to become inaccessible from the home page after a reboot
>> until opened from within My Files - Downloads.
>>
>> Can someone with a better understanding of the Android OS than me
>> explain what's going on?
>
> In the absence of an authoritative answer, and based on some
> googling (I am not a developer of Android apps), I'll offer a
> guess.
>
> I suspect that for the content URI in the shortcut (which is a
> pointer to a local resource, and AFAICS not the same as a file://
> URI) can only be accessed if Chrome has access to a Content
> Provider and for some reason (maybe a bug) there isn't one after
> a reboot. Perhaps accessing the content using My Files causes a
> Content Provider to be established, which can the be used by
> Chrome to access the content URI passed as a result of tapping
> the shortcut.
>
> <https://developer.android.com/guide/topics/providers/content-provider-basics>

Thanks for that Dave. It sounds plausible to me but it seems I'm still
going to have to go to My Files to reactive the shortcut after a reboot

Subject: Re: viewing local htm files on Android device
From: Malone
Newsgroups: comp.mobile.android
Organization: To protect and to server
Date: Thu, 25 Jul 2024 19:31 UTC
References: 1 2 3
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!newsfeed.bofh.team!paganini.bofh.team!not-for-mail
From: mslone@nospam.uk (Malone)
Newsgroups: comp.mobile.android
Subject: Re: viewing local htm files on Android device
Date: Fri, 26 Jul 2024 07:31:08 +1200
Organization: To protect and to server
Message-ID: <v7u95r$198qd$2@paganini.bofh.team>
References: <v7nf7c$g03g$1@paganini.bofh.team> <v7ror3$1t3ob$1@dont-email.me>
<lgd875F2uo4U1@mid.individual.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 25 Jul 2024 19:31:08 -0000 (UTC)
Injection-Info: paganini.bofh.team; logging-data="1352525"; posting-host="BRsQPiL3od7507v1mf+eeA.user.paganini.bofh.team"; mail-complaints-to="usenet@bofh.team"; posting-account="9dIQLXBM7WM9KzA+yjdR4A";
User-Agent: Mozilla Thunderbird
X-Notice: Filtered by postfilter v. 0.9.3
Content-Language: en-NZ
View all headers

On Thu-25-Jul-2024 8:58 am, Andy Burns wrote:
> Dave Royal wrote:
>
>> In the absence of an authoritative answer, and based on some
>>   googling (I am not a developer of Android apps), I'll offer a
>>   guess.
>>
>> I suspect that for the content URI in the shortcut (which is a
>>   pointer to a local resource, and AFAICS not the same as afile://
>>   URI)
>
> In a similar case, where we load a lot of documents (mixed .pdf and
> .html) onto an android tablet for use in a vehicle, we ended up
> installing a local web server on the tablet (and even paying the
> developer for a few tweaks to it).
>

Thanks for that Andy. That sounds a great idea. Although I've installed
a web server on my Window machine, doing a bit of googling suggests that
doing something similar on an Android tablet is going to be slightly
beyond my technical competence..

Subject: Re: viewing local htm files on Android device
From: Carlos E. R.
Newsgroups: comp.mobile.android
Date: Thu, 25 Jul 2024 19:56 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: robin_listas@es.invalid (Carlos E. R.)
Newsgroups: comp.mobile.android
Subject: Re: viewing local htm files on Android device
Date: Thu, 25 Jul 2024 21:56:22 +0200
Lines: 28
Message-ID: <lgfov6FdmbdU4@mid.individual.net>
References: <v7nf7c$g03g$1@paganini.bofh.team>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net 8JmIRGeAnYEA+ZuPY8uLEwj7vMqtbNDIY4TuWPOtVncXeVW5k+
Cancel-Lock: sha1:WNfqA4QK/OzBHBCDI+OmHjRJEO0= sha256:SHBUJda3MS5bXcWeLxqKrplSzFNGIOuv5OInZgOleUw=
User-Agent: Mozilla Thunderbird
Content-Language: en-US
In-Reply-To: <v7nf7c$g03g$1@paganini.bofh.team>
View all headers

On 2024-07-23 07:31, Malone wrote:
>
> I've created a simple (just text, no script) .htm file on a Windows
> computer ("testhtm.htm") and transferred it to my Android tablet.
>
> In My Files - Downloads it then appears as "testhtm.htm". Tapping it and
> it opens with Chrome (my default browser) as
> "content:media/external/file/1000000383".
>
> Long tap and select "Add to Home Screen" and an icon appears on the home
> screen titled "testhtm". And when tapping this it opens in Chrome.
>
> If I now restart (reboot) the tablet and try to open the file by tapping
> its icon on the home page it doesn't open and I receive the message:
> "Chrome does not have access to the requested resource."
>
> If I then go to My Files - Downloads I find I can open it from there.
> And if I then go back to the home page it will now open from there as well.
>
> Why is this?

I seem to recall old bug aka feature that file:/// would not work in
Android. Re firefox, probably.

--
Cheers,
Carlos E.R.

Subject: Re: viewing local htm files on Android device
From: Dave Royal
Newsgroups: comp.mobile.android
Organization: news.eternal-september.org
Date: Thu, 1 Jan 1970 00:00 UTC
References: 1 2 3
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dave@dave123royal.com (Dave Royal)
Newsgroups: comp.mobile.android
Subject: Re: viewing local htm files on Android device
Date: Thu, 25 Jul 2024 21:31:28 +0100 (GMT+01:00)
Organization: news.eternal-september.org
Lines: 69
Message-ID: <v7ucn1$2egrh$1@dont-email.me>
References: <v7nf7c$g03g$1@paganini.bofh.team> <v7ror3$1t3ob$1@dont-email.me> <v7u90d$198qd$1@paganini.bofh.team>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 25 Jul 2024 22:31:29 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="56aa9a84aeb4e5d599c3b81fc11e697f";
logging-data="2573169"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+VRzzWtxTcd0y7LUx841l3"
Cancel-Lock: sha1:TFgRlvO4+qp8SXXzR7+2KgZicxQ=
X-Newsreader: Mod.PiaoHong.Usenet.Client:2.02.M16
View all headers

Malone <mslone@nospam.uk> Wrote in message:

> On Thu-25-Jul-2024 8:40 am, Dave Royal wrote:
>> Malone <mslone@nospam.uk> Wrote in message:
>>
>>>
>>> I've created a simple (just text, no script) .htm file on a Windows
>>> computer ("testhtm.htm") and transferred it to my Android tablet.
>>>
>>> In My Files - Downloads it then appears as "testhtm.htm". Tapping it and
>>> it opens with Chrome (my default browser) as
>>> "content:media/external/file/1000000383".
>>>
>>> Long tap and select "Add to Home Screen" and an icon appears on the home
>>> screen titled "testhtm". And when tapping this it opens in Chrome.
>>>
>>> If I now restart (reboot) the tablet and try to open the file by tapping
>>> its icon on the home page it doesn't open and I receive the message:
>>> "Chrome does not have access to the requested resource."
>>>
>>> If I then go to My Files - Downloads I find I can open it from there.
>>> And if I then go back to the home page it will now open from there as well.
>>>
>>> Why is this?
>>>
>>> I have links on my home page to .htm pages located on servers on the
>>> internet which always open with no problems. But .htm files located on
>>> my tablet seem to become inaccessible from the home page after a reboot
>>> until opened from within My Files - Downloads.
>>>
>>> Can someone with a better understanding of the Android OS than me
>>> explain what's going on?
>>
>> In the absence of an authoritative answer, and based on some
>> googling (I am not a developer of Android apps), I'll offer a
>> guess.
>>
>> I suspect that for the content URI in the shortcut (which is a
>> pointer to a local resource, and AFAICS not the same as a file://
>> URI) can only be accessed if Chrome has access to a Content
>> Provider and for some reason (maybe a bug) there isn't one after
>> a reboot. Perhaps accessing the content using My Files causes a
>> Content Provider to be established, which can the be used by
>> Chrome to access the content URI passed as a result of tapping
>> the shortcut.
>>
>> <https://developer.android.com/guide/topics/providers/content-provider-basics>
>
> Thanks for that Dave. It sounds plausible to me but it seems I'm still
> going to have to go to My Files to reactive the shortcut after a reboot

It was only a guess. I hoped an Android developer would confirm or
refute it. I would have thought that passing a usable html
shortcut to the the app that created it is the job of what in
Linux would be called a 'desktop manager': this Samsung tablet
uses 'One UI'. I've read that it's possible to use alternative
DMs on some devices - maybe you can.

On maybe you can open this file in Chrome using it's file location
(file:///Internal storage/...) Firefox doesn't allow file:// URIs
any more - does chrome?

Opening local files in apps which did not create them (though in
the case of your desktop shortcut Chrome /did/ create it) is IME
the most baffling area of Android. I often want to open files (eg
.abc music files) in editors and players which Android doesn't
think I should and it's a constant battle.
--
Remove numerics from my email address.

Subject: Re: viewing local htm files on Android device
From: Dave Royal
Newsgroups: comp.mobile.android
Organization: news.eternal-september.org
Date: Thu, 1 Jan 1970 00:00 UTC
References: 1 2 3 4
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dave@dave123royal.com (Dave Royal)
Newsgroups: comp.mobile.android
Subject: Re: viewing local htm files on Android device
Date: Thu, 25 Jul 2024 23:06:08 +0100 (GMT+01:00)
Organization: news.eternal-september.org
Lines: 91
Message-ID: <v7ui8h$2fg2t$1@dont-email.me>
References: <v7nf7c$g03g$1@paganini.bofh.team> <v7ror3$1t3ob$1@dont-email.me> <v7u90d$198qd$1@paganini.bofh.team> <v7ucn1$2egrh$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 26 Jul 2024 00:06:10 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0082ae2910dc565f4ede837f140cefa6";
logging-data="2605149"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+e5Da8DRw9rjyPvYCT5l+8"
Cancel-Lock: sha1:0VRewDttK8+FOL04Hrg5IvVE3Wo=
X-Newsreader: Mod.PiaoHong.Usenet.Client:2.02.M16
View all headers

Dave Royal <dave@dave123royal.com> Wrote in message:

> Malone <mslone@nospam.uk> Wrote in message:
>
>> On Thu-25-Jul-2024 8:40 am, Dave Royal wrote:
>>> Malone <mslone@nospam.uk> Wrote in message:
>>>
>>>>
>>>> I've created a simple (just text, no script) .htm file on a Windows
>>>> computer ("testhtm.htm") and transferred it to my Android tablet.
>>>>
>>>> In My Files - Downloads it then appears as "testhtm.htm". Tapping it and
>>>> it opens with Chrome (my default browser) as
>>>> "content:media/external/file/1000000383".
>>>>
>>>> Long tap and select "Add to Home Screen" and an icon appears on the home
>>>> screen titled "testhtm". And when tapping this it opens in Chrome.
>>>>
>>>> If I now restart (reboot) the tablet and try to open the file by tapping
>>>> its icon on the home page it doesn't open and I receive the message:
>>>> "Chrome does not have access to the requested resource."
>>>>
>>>> If I then go to My Files - Downloads I find I can open it from there.
>>>> And if I then go back to the home page it will now open from there as well.
>>>>
>>>> Why is this?
>>>>
>>>> I have links on my home page to .htm pages located on servers on the
>>>> internet which always open with no problems. But .htm files located on
>>>> my tablet seem to become inaccessible from the home page after a reboot
>>>> until opened from within My Files - Downloads.
>>>>
>>>> Can someone with a better understanding of the Android OS than me
>>>> explain what's going on?
>>>
>>> In the absence of an authoritative answer, and based on some
>>> googling (I am not a developer of Android apps), I'll offer a
>>> guess.
>>>
>>> I suspect that for the content URI in the shortcut (which is a
>>> pointer to a local resource, and AFAICS not the same as a file://
>>> URI) can only be accessed if Chrome has access to a Content
>>> Provider and for some reason (maybe a bug) there isn't one after
>>> a reboot. Perhaps accessing the content using My Files causes a
>>> Content Provider to be established, which can the be used by
>>> Chrome to access the content URI passed as a result of tapping
>>> the shortcut.
>>>
>>> <https://developer.android.com/guide/topics/providers/content-provider-basics>
>>
>> Thanks for that Dave. It sounds plausible to me but it seems I'm still
>> going to have to go to My Files to reactive the shortcut after a reboot
>
> It was only a guess. I hoped an Android developer would confirm or
> refute it. I would have thought that passing a usable html
> shortcut to the the app that created it is the job of what in
> Linux would be called a 'desktop manager': this Samsung tablet
> uses 'One UI'. I've read that it's possible to use alternative
> DMs on some devices - maybe you can.
>
> On maybe you can open this file in Chrome using it's file location
> (file:///Internal storage/...) Firefox doesn't allow file:// URIs
> any more - does chrome?
>
> Opening local files in apps which did not create them (though in
> the case of your desktop shortcut Chrome /did/ create it) is IME
> the most baffling area of Android. I often want to open files (eg
> .abc music files) in editors and players which Android doesn't
> think I should and it's a constant battle.

I tried to reproduce your case - Android 14 on a Samsung tablet.

I can send a local html file from the 'My Files' app to Chrome
(but not to Firefox) using 'Open with' and it displays as
content://media/external/file/1000015925. But I see no way to
'Add to home screen' in Chrome (which I can do for an ordinary
URL in both Chrome and Firefox).

But do see 'Add to home screen' in the 'My Files' app and the
shortcut appears with a 'My Files' sub-icon. I suppose that's
what you did. And that opens in Chrome, even though Firefox is my
default browser. So My Files owns that content, and it seems it
must open it first. I think my guess about it creating a Content
Provider is correct-ish.

Neither Firefox nor Chrome will open a file:/// URI (by design -
CVE-2015-7186).

Firefox will not open a content:// URI.
--
Remove numerics from my email address.

Subject: Re: viewing local htm files on Android device
From: Malone
Newsgroups: comp.mobile.android
Organization: To protect and to server
Date: Fri, 26 Jul 2024 02:27 UTC
References: 1 2 3 4 5
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!newsfeed.bofh.team!paganini.bofh.team!not-for-mail
From: mslone@nospam.uk (Malone)
Newsgroups: comp.mobile.android
Subject: Re: viewing local htm files on Android device
Date: Fri, 26 Jul 2024 14:27:57 +1200
Organization: To protect and to server
Message-ID: <v7v1je$1gj5q$1@paganini.bofh.team>
References: <v7nf7c$g03g$1@paganini.bofh.team> <v7ror3$1t3ob$1@dont-email.me>
<v7u90d$198qd$1@paganini.bofh.team> <v7ucn1$2egrh$1@dont-email.me>
<v7ui8h$2fg2t$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 26 Jul 2024 02:27:59 -0000 (UTC)
Injection-Info: paganini.bofh.team; logging-data="1592506"; posting-host="BRsQPiL3od7507v1mf+eeA.user.paganini.bofh.team"; mail-complaints-to="usenet@bofh.team"; posting-account="9dIQLXBM7WM9KzA+yjdR4A";
User-Agent: Mozilla Thunderbird
X-Notice: Filtered by postfilter v. 0.9.3
Content-Language: en-NZ
View all headers

On Fri-26-Jul-2024 10:06 am, Dave Royal wrote:
> Dave Royal <dave@dave123royal.com> Wrote in message:
>
>> Malone <mslone@nospam.uk> Wrote in message:
>>
>>> On Thu-25-Jul-2024 8:40 am, Dave Royal wrote:
>>>> Malone <mslone@nospam.uk> Wrote in message:
>>>>
>>>>>
>>>>> I've created a simple (just text, no script) .htm file on a Windows
>>>>> computer ("testhtm.htm") and transferred it to my Android tablet.
>>>>>
>>>>> In My Files - Downloads it then appears as "testhtm.htm". Tapping it and
>>>>> it opens with Chrome (my default browser) as
>>>>> "content:media/external/file/1000000383".
>>>>>
>>>>> Long tap and select "Add to Home Screen" and an icon appears on the home
>>>>> screen titled "testhtm". And when tapping this it opens in Chrome.
>>>>>
>>>>> If I now restart (reboot) the tablet and try to open the file by tapping
>>>>> its icon on the home page it doesn't open and I receive the message:
>>>>> "Chrome does not have access to the requested resource."
>>>>>
>>>>> If I then go to My Files - Downloads I find I can open it from there.
>>>>> And if I then go back to the home page it will now open from there as well.
>>>>>
>>>>> Why is this?
>>>>>
>>>>> I have links on my home page to .htm pages located on servers on the
>>>>> internet which always open with no problems. But .htm files located on
>>>>> my tablet seem to become inaccessible from the home page after a reboot
>>>>> until opened from within My Files - Downloads.
>>>>>
>>>>> Can someone with a better understanding of the Android OS than me
>>>>> explain what's going on?
>>>>
>>>> In the absence of an authoritative answer, and based on some
>>>> googling (I am not a developer of Android apps), I'll offer a
>>>> guess.
>>>>
>>>> I suspect that for the content URI in the shortcut (which is a
>>>> pointer to a local resource, and AFAICS not the same as a file://
>>>> URI) can only be accessed if Chrome has access to a Content
>>>> Provider and for some reason (maybe a bug) there isn't one after
>>>> a reboot. Perhaps accessing the content using My Files causes a
>>>> Content Provider to be established, which can the be used by
>>>> Chrome to access the content URI passed as a result of tapping
>>>> the shortcut.
>>>>
>>>> <https://developer.android.com/guide/topics/providers/content-provider-basics>
>>>
>>> Thanks for that Dave. It sounds plausible to me but it seems I'm still
>>> going to have to go to My Files to reactive the shortcut after a reboot
>>
>> It was only a guess. I hoped an Android developer would confirm or
>> refute it. I would have thought that passing a usable html
>> shortcut to the the app that created it is the job of what in
>> Linux would be called a 'desktop manager': this Samsung tablet
>> uses 'One UI'. I've read that it's possible to use alternative
>> DMs on some devices - maybe you can.
>>
>> On maybe you can open this file in Chrome using it's file location
>> (file:///Internal storage/...) Firefox doesn't allow file:// URIs
>> any more - does chrome?
>>
>> Opening local files in apps which did not create them (though in
>> the case of your desktop shortcut Chrome /did/ create it) is IME
>> the most baffling area of Android. I often want to open files (eg
>> .abc music files) in editors and players which Android doesn't
>> think I should and it's a constant battle.
>
> I tried to reproduce your case - Android 14 on a Samsung tablet.
>
> I can send a local html file from the 'My Files' app to Chrome
> (but not to Firefox) using 'Open with' and it displays as
> content://media/external/file/1000015925. But I see no way to
> 'Add to home screen' in Chrome (which I can do for an ordinary
> URL in both Chrome and Firefox).
>
> But do see 'Add to home screen' in the 'My Files' app and the
> shortcut appears with a 'My Files' sub-icon. I suppose that's
> what you did. And that opens in Chrome, even though Firefox is my
> default browser. So My Files owns that content, and it seems it
> must open it first. I think my guess about it creating a Content
> Provider is correct-ish.
>
> Neither Firefox nor Chrome will open a file:/// URI (by design -
> CVE-2015-7186).
>
> Firefox will not open a content:// URI.

Yes, that's all consistent with what I experience. My Windows default
browser is Firefox and at the outset I put that on my tablet. But I had
problems with it, for reasons I can't remember, so got rid of it on the
basis that Chrome was probably more Android-compatible although I
consider it spyware.

Having read your experiences I'm reassured it is not something to do
with my settings and I'll need to open the file first from within My
Files after any reboot (which isn't very often). I just find it a rather
strange "feature" of the Android operating system.

Subject: Re: Firefox on Android [was: viewing local htm files on Android device]
From: Dave Royal
Newsgroups: comp.mobile.android
Organization: news.eternal-september.org
Date: Thu, 1 Jan 1970 00:00 UTC
References: 1 2 3 4 5 6
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dave@dave123royal.com (Dave Royal)
Newsgroups: comp.mobile.android
Subject: Re: Firefox on Android [was: viewing local htm files on Android
device]
Date: Fri, 26 Jul 2024 07:37:53 +0100 (GMT+01:00)
Organization: news.eternal-september.org
Lines: 45
Message-ID: <v7vg85$2nk0f$1@dont-email.me>
References: <v7nf7c$g03g$1@paganini.bofh.team> <v7ror3$1t3ob$1@dont-email.me> <v7u90d$198qd$1@paganini.bofh.team> <v7ucn1$2egrh$1@dont-email.me> <v7ui8h$2fg2t$1@dont-email.me> <v7v1je$1gj5q$1@paganini.bofh.team>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 26 Jul 2024 08:37:58 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="f1244d205fd091b6f694b50775e6f815";
logging-data="2871311"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX180uKgegibRiBFoPCqHEoeP"
Cancel-Lock: sha1:xTJZ+IEllVwyoaMVcmt9yWohVH4=
X-Newsreader: Mod.PiaoHong.Usenet.Client:2.02.M16
View all headers

Malone <mslone@nospam.uk> Wrote in message:

> On Fri-26-Jul-2024 10:06 am, Dave Royal wrote:
>> Dave Royal <dave@dave123royal.com> Wrote in message:
>>
>> [long snip]
>>
>> I tried to reproduce your case - Android 14 on a Samsung tablet.
>>
>> I can send a local html file from the 'My Files' app to Chrome
>> (but not to Firefox) using 'Open with' and it displays as
>> content://media/external/file/1000015925. But I see no way to
>> 'Add to home screen' in Chrome (which I can do for an ordinary
>> URL in both Chrome and Firefox).
>>
>> But do see 'Add to home screen' in the 'My Files' app and the
>> shortcut appears with a 'My Files' sub-icon. I suppose that's
>> what you did. And that opens in Chrome, even though Firefox is my
>> default browser. So My Files owns that content, and it seems it
>> must open it first. I think my guess about it creating a Content
>> Provider is correct-ish.
>>
>> Neither Firefox nor Chrome will open a file:/// URI (by design -
>> CVE-2015-7186).
>>
>> Firefox will not open a content:// URI.
>
> Yes, that's all consistent with what I experience. My Windows default
> browser is Firefox and at the outset I put that on my tablet. But I had
> problems with it, for reasons I can't remember, so got rid of it on the
> basis that Chrome was probably more Android-compatible although I
> consider it spyware.

I sure you're right that Chrome is more Android-compatible, and
this case is an example of that. I use Firefox because it runs
addons, including my own, and Chrome on Android will not. [There
are some Chrome-based browsers that will but they presumably lack
Chrome's built-in advantage.]

Mozilla never gave any priority to tablets, and I've always found
the tab handling terrible. But it's going to get better in v130.
Finally the tab bar is back:
<https://www.cjoint.com/data/NGAgtfgaDws_Screenshot-20240726-071721-Firefox-Nightly.jpg>
--
Remove numerics from my email address.

Subject: Re: viewing local htm files on Android device
From: Arno Welzel
Newsgroups: comp.mobile.android
Date: Fri, 26 Jul 2024 15:50 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: usenet@arnowelzel.de (Arno Welzel)
Newsgroups: comp.mobile.android
Subject: Re: viewing local htm files on Android device
Date: Fri, 26 Jul 2024 17:50:06 +0200
Lines: 54
Message-ID: <lghutdFpls7U3@mid.individual.net>
References: <v7nf7c$g03g$1@paganini.bofh.team>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Trace: individual.net lVuUJbx0EkBboWClve03WgSOA70CAu3BEtugAbZfFZpVI1evdd
Cancel-Lock: sha1:GqYBZuohSReeaA+AGTyhIvpaTUs= sha256:Kiu0bw/AfcqcvRH+DoitxDDKkgZP0qt3Zb3M/ap5+RI=
Content-Language: de-DE
In-Reply-To: <v7nf7c$g03g$1@paganini.bofh.team>
View all headers

Malone, 2024-07-23 07:31:

>
> I've created a simple (just text, no script) .htm file on a Windows
> computer ("testhtm.htm") and transferred it to my Android tablet.
>
> In My Files - Downloads it then appears as "testhtm.htm". Tapping it and
> it opens with Chrome (my default browser) as
> "content:media/external/file/1000000383".
>
> Long tap and select "Add to Home Screen" and an icon appears on the home
> screen titled "testhtm". And when tapping this it opens in Chrome.
>
> If I now restart (reboot) the tablet and try to open the file by tapping
> its icon on the home page it doesn't open and I receive the message:
> "Chrome does not have access to the requested resource."
>
> If I then go to My Files - Downloads I find I can open it from there.
> And if I then go back to the home page it will now open from there as well.
>
> Why is this?

I think access to "content:media/external/file/1000000383" is only
granted using a temporary access token which gets lost when rebooting
the device.

I had this issue with my own app when it asked for permission to access
files using the Storage Access Framework. Technically it needs to add
Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION to the request, so the
access token is persistent and survices reboots.

Also see here:

<https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_PERSISTABLE_URI_PERMISSION>

Quote:

"When combined with FLAG_GRANT_READ_URI_PERMISSION and/or
FLAG_GRANT_WRITE_URI_PERMISSION, the URI permission grant can be
persisted across device reboots until explicitly revoked with
Context#revokeUriPermission(Uri, int)."

Without this flag, a read permission will be lost after a reboot.

So the only real solution to this would be to use a browser which
creates a permanent access token when adding the shortcut to the
launcher. Maybe it helps when you open it in Chrome first and use Chrome
to add the shortcut to the home screen and not the file manager.

--
Arno Welzel
https://arnowelzel.de

Subject: Re: viewing local htm files on Android device
From: Arno Welzel
Newsgroups: comp.mobile.android
Date: Fri, 26 Jul 2024 16:01 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: usenet@arnowelzel.de (Arno Welzel)
Newsgroups: comp.mobile.android
Subject: Re: viewing local htm files on Android device
Date: Fri, 26 Jul 2024 18:01:03 +0200
Lines: 55
Message-ID: <lghvhuFpls7U4@mid.individual.net>
References: <v7nf7c$g03g$1@paganini.bofh.team>
<lgfov6FdmbdU4@mid.individual.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Trace: individual.net +tR31rlZHYOh2ifo8kP53ALoWkTkM40jLq0g0i+l3U77lyYdvo
Cancel-Lock: sha1:ekHPHhAfcxROeXM5XZn1oV41L14= sha256:/4IsnI+P4UxQlyRKHCqfew92YGaqB+iTB0M4Miq6mTk=
Content-Language: de-DE
In-Reply-To: <lgfov6FdmbdU4@mid.individual.net>
View all headers

Carlos E. R., 2024-07-25 21:56:

> On 2024-07-23 07:31, Malone wrote:
>>
>> I've created a simple (just text, no script) .htm file on a Windows
>> computer ("testhtm.htm") and transferred it to my Android tablet.
>>
>> In My Files - Downloads it then appears as "testhtm.htm". Tapping it and
>> it opens with Chrome (my default browser) as
>> "content:media/external/file/1000000383".
>>
>> Long tap and select "Add to Home Screen" and an icon appears on the home
>> screen titled "testhtm". And when tapping this it opens in Chrome.
>>
>> If I now restart (reboot) the tablet and try to open the file by tapping
>> its icon on the home page it doesn't open and I receive the message:
>> "Chrome does not have access to the requested resource."
>>
>> If I then go to My Files - Downloads I find I can open it from there.
>> And if I then go back to the home page it will now open from there as well.
>>
>> Why is this?
>
> I seem to recall old bug aka feature that file:/// would not work in
> Android. Re firefox, probably.

No, there is no global "file:///" mechanism in current Android versions
for security reasons. The only files an app can access are the files
within the app sandbox but nowhere else. Direct file access was
discouraged in Android 4.4 and the use of the Storage Access Framework
instead if direct file access is mandatory since Android 7.

An app only sees URIs which *may* be connected to a file or folder on
the device, but technically it is just a handle to some kind of data and
which is provided by a storage provider. Apps like Google Drive,
OneDrive, Nextclud etc. install storage providers which allow to access
files on a server which don't have to stay on the device and will only
get downloaded if needed.

In addition, an app has to request permission for *every* URI it wants
to access. This permission can be granted temporary (only lasting until
the app is terminated or the device is rebootet) or it can be
persistent, so the app has only to ask once and the permission will last
as long as the app is installed on the device.

So a browser could implement some mechanism to use the Storage Access
Framework to open a "file" instead of a website and also ask to get a
persistent permission for this - but I don't know any browser which
implemented a "open a file using the storage access framework" feature.

--
Arno Welzel
https://arnowelzel.de

1

rocksolid light 0.9.8
clearnet tor