Discussion:
[chromium-discuss] On Android, can Chrome load content from content provider?
Jiajun Hu
2018-10-03 06:51:59 UTC
Permalink
Dear all,

As we know, we can load local files into WebView through content provider.
For example, if I want to load an image stored on SD card into WebView, I
can use content like url <img
src="content://myprovider/mnt/sdcard/myimage.png" /> to achieve the goal.

My question is can we do similar things in browsers such as Chrome and
Firefox? Can I prepare a content like url (like the one mentioned before)
and let Chrome load it?

If yes, can anyone tell me how to do this? If no, can anyone tell me why?

Thanks in advance.
--
--
Chromium Discussion mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
You received this message because you are subscribed to the Google Groups "Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discuss+***@chromium.org.
PhistucK
2018-10-03 07:28:22 UTC
Permalink
(Firefox is off topic :))
Regarding Chrome, did you try plain old file:// URLs?
While the behavior of file:// URLs can differ a bit from HTTP/HTTPS (and
maybe content://, no idea) URLs, it might be enough for you.

☆*PhistucK*
Post by Jiajun Hu
Dear all,
As we know, we can load local files into WebView through content provider.
For example, if I want to load an image stored on SD card into WebView, I
can use content like url <img
src="content://myprovider/mnt/sdcard/myimage.png" /> to achieve the goal.
My question is can we do similar things in browsers such as Chrome and
Firefox? Can I prepare a content like url (like the one mentioned before)
and let Chrome load it?
If yes, can anyone tell me how to do this? If no, can anyone tell me why?
Thanks in advance.
--
--
http://groups.google.com/a/chromium.org/group/chromium-discuss
---
You received this message because you are subscribed to the Google Groups
"Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
--
Chromium Discussion mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
You received this message because you are subscribed to the Google Groups "Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discuss+***@chromium.org.
Jiajun Hu
2018-10-03 07:46:46 UTC
Permalink
Yes, file:// URLs works. Content:// URLs doesn’t work. I am just wondering why WebView can load content:// URLs but Chrome cannot. There is no way for Chrome to get information from content provider?
Post by PhistucK
(Firefox is off topic :))
Regarding Chrome, did you try plain old file:// URLs?
While the behavior of file:// URLs can differ a bit from HTTP/HTTPS (and maybe content://, no idea) URLs, it might be enough for you.
☆PhistucK
Dear all,
As we know, we can load local files into WebView through content provider. For example, if I want to load an image stored on SD card into WebView, I can use content like url <img src="content://myprovider/mnt/sdcard/myimage.png" /> to achieve the goal.
My question is can we do similar things in browsers such as Chrome and Firefox? Can I prepare a content like url (like the one mentioned before) and let Chrome load it?
If yes, can anyone tell me how to do this? If no, can anyone tell me why?
Thanks in advance.
--
--
http://groups.google.com/a/chromium.org/group/chromium-discuss <http://groups.google.com/a/chromium.org/group/chromium-discuss>
---
You received this message because you are subscribed to the Google Groups "Chromium-discuss" group.
--
--
Chromium Discussion mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
You received this message because you are subscribed to the Google Groups "Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discuss+***@chromium.org.
PhistucK
2018-10-03 07:49:42 UTC
Permalink
Chrome is a generic application. What content providers would you expect it
to provide?

☆*PhistucK*
Post by Jiajun Hu
Yes, file:// URLs works. Content:// URLs doesn’t work. I am just wondering
why WebView can load content:// URLs but Chrome cannot. There is no way for
Chrome to get information from content provider?
(Firefox is off topic :))
Regarding Chrome, did you try plain old file:// URLs?
While the behavior of file:// URLs can differ a bit from HTTP/HTTPS (and
maybe content://, no idea) URLs, it might be enough for you.
☆*PhistucK*
Post by Jiajun Hu
Dear all,
As we know, we can load local files into WebView through content
provider. For example, if I want to load an image stored on SD card into
WebView, I can use content like url <img src="
content://myprovider/mnt/sdcard/myimage.png" /> to achieve the goal.
My question is can we do similar things in browsers such as Chrome and
Firefox? Can I prepare a content like url (like the one mentioned before)
and let Chrome load it?
If yes, can anyone tell me how to do this? If no, can anyone tell me why?
Thanks in advance.
--
--
http://groups.google.com/a/chromium.org/group/chromium-discuss
---
You received this message because you are subscribed to the Google Groups
"Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
--
Chromium Discussion mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
You received this message because you are subscribed to the Google Groups "Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discuss+***@chromium.org.
Torne (Richard Coles)
2018-10-03 18:16:50 UTC
Permalink
Chrome can load content: URLs, but content: is treated like file: for
security purposes - you can't include/link to content: pages from other URL
schemes. You can input a content: URL into the address bar, or send an
intent with a content: URL to chrome from another app, and it should load
the entire page from the content provider just fine, including any
subresources that are content:.
Post by PhistucK
Chrome is a generic application. What content providers would you expect
it to provide?
☆*PhistucK*
Post by Jiajun Hu
Yes, file:// URLs works. Content:// URLs doesn’t work. I am just
wondering why WebView can load content:// URLs but Chrome cannot. There is
no way for Chrome to get information from content provider?
(Firefox is off topic :))
Regarding Chrome, did you try plain old file:// URLs?
While the behavior of file:// URLs can differ a bit from HTTP/HTTPS (and
maybe content://, no idea) URLs, it might be enough for you.
☆*PhistucK*
Post by Jiajun Hu
Dear all,
As we know, we can load local files into WebView through content
provider. For example, if I want to load an image stored on SD card into
WebView, I can use content like url <img src="
content://myprovider/mnt/sdcard/myimage.png" /> to achieve the goal.
My question is can we do similar things in browsers such as Chrome and
Firefox? Can I prepare a content like url (like the one mentioned before)
and let Chrome load it?
If yes, can anyone tell me how to do this? If no, can anyone tell me why?
Thanks in advance.
--
--
http://groups.google.com/a/chromium.org/group/chromium-discuss
---
You received this message because you are subscribed to the Google
Groups "Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send
--
--
http://groups.google.com/a/chromium.org/group/chromium-discuss
--
--
Chromium Discussion mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
You received this message because you are subscribed to the Google Groups "Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discuss+***@chromium.org.
Loading...