Re: [Ubuntu-phone] viewing local HTML files
El día Tuesday, March 29, 2016 a las 09:47:40AM +0200, Olivier Tilloy escribió: > On Mon, Mar 28, 2016 at 1:43 PM,wrote: > I have in the HOME of phablet some tree with HTML (...) files: > > > > Oh, sorry, I was a bit too brief - I thought you had been down the route of > > handwritten .desktop's before. > > > > You put this in a new file here: > > ~/.local/share/application/ > > e.g., > > > > ~/.local/share/application/MyWebContainer.desktop > > > > > > Thanks for that useful tip! > > I can confirm that browsing local HTML files won’t work in the browser. > This is an unfortunate side-effect of confining the browser with > apparmor to prevent disclosing sensitive information (previously the > browser ran unconfined and one could view the contents of all files on > the filesystem). > > Putting this idea more general: can I used such a *.desktop file to launch a shell script in /home/phablet, for example one with the lines: #!/bin/sh cd /media/phablet/*/Maps nohup python3 -m http.server & Thanks matthias -- Matthias Apitz, ✉ g...@unixarea.de, ⌂ http://www.unixarea.de/ ☎ +49-176-38902045 -- Mailing list: https://launchpad.net/~ubuntu-phone Post to : ubuntu-phone@lists.launchpad.net Unsubscribe : https://launchpad.net/~ubuntu-phone More help : https://help.launchpad.net/ListHelp
Re: [Ubuntu-phone] viewing local HTML files
On Mon, Mar 28, 2016 at 1:43 PM,wrote: I have in the HOME of phablet some tree with HTML (...) files: > phablet@ubuntu-phablet:~$ ls -C1 diario2016/ diario.html enanitos/ imagenes/ (diario.html has refernces into the subdirs enanitos/ and imagenes/). How can I view this locally on the BQ? I tried something like: ubuntu-app-launch webbrowser-app file:///home/phablet/diario2016/index.html but with no luck. >>> >>> >>> A .desktop file like this works for me: >>> >>> [Desktop Entry] >>> Name=web container >>> Type=Application >>> Exec=webapp-container --enable-addressbar --enable-back-forward >>> --webappUrlPatterns=/home/phablet/* /home/phablet/ >>> Terminal=false >>> X-Ubuntu-Touch=true >>> >> >> Hello, >> >> Thanks, where should I place this file? >> >> matthias >> > > > Oh, sorry, I was a bit too brief - I thought you had been down the route of > handwritten .desktop's before. > > You put this in a new file here: > ~/.local/share/application/ > e.g., > > ~/.local/share/application/MyWebContainer.desktop > > For your purpose, I guess you will want to change the Exec= line into > something like > Exec=webapp-container --enable-addressbar --enable-back-forward > --webappUrlPatterns=/home/phablet/diario2016/* > /home/phablet/diario2016/index.html > > > I can't fully remember where I did take the information about these > parameters from, try a websearch. Or try leaving them out, the names are > quite descriptive anyway. > > > In the .desktop file might want to adjust the Name= and Icon= lines to your > liking. > > Once you have saved that file you need to pull-down-to-refresh in the > appscope and then a new launcher should show up. > > > Also, note that I'm not claiming that you /can't/ get this to work with > webbrowser-app, but simply, I had this webapp-container snippet lying around > and I /know/ that this one works for me. > > Good luck, and let us know how it goes, or if somethings unclear. Thanks for that useful tip! I can confirm that browsing local HTML files won’t work in the browser. This is an unfortunate side-effect of confining the browser with apparmor to prevent disclosing sensitive information (previously the browser ran unconfined and one could view the contents of all files on the filesystem). I’d like to find a middle-ground solution to that problem, so that users could browse and view "legitimate" files in their home folder, without compromising security. I’ve filed https://launchpad.net/bugs/1563214 to track the issue. Suggestions and ideas welcome. Cheers, Olivier -- Mailing list: https://launchpad.net/~ubuntu-phone Post to : ubuntu-phone@lists.launchpad.net Unsubscribe : https://launchpad.net/~ubuntu-phone More help : https://help.launchpad.net/ListHelp
Re: [Ubuntu-phone] viewing local HTML files
El día Monday, March 28, 2016 a las 11:43:37AM +, kaabud...@yahoo.de escribió: > Oh, sorry, I was a bit too brief - I thought you had been down the route of > handwritten .desktop's before. > I did this in the past on other Linux mobiles (the Openmoko Freerunner) and was already searching with find, where other *.desktop files are located; thanks for your clarification and it works now; I only have to look for a nice 256x256 icon.png file; I will add a chapter to my booklet about this in: https://www.gitbook.com/book/gurucubano/bq-aquaris-e-4-5-ubuntu-phone/details Thanks for you help! > You put this in a new file here: > ~/.local/share/application/ small typo: must be ~/.local/share/applications/ :-) matthias -- Matthias Apitz, ✉ g...@unixarea.de, ⌂ http://www.unixarea.de/ ☎ +49-176-38902045 -- Mailing list: https://launchpad.net/~ubuntu-phone Post to : ubuntu-phone@lists.launchpad.net Unsubscribe : https://launchpad.net/~ubuntu-phone More help : https://help.launchpad.net/ListHelp
Re: [Ubuntu-phone] viewing local HTML files
>>> I have in the HOME of phablet some tree with HTML (...) files: >>> >>> phablet@ubuntu-phablet:~$ ls -C1 diario2016/ >>> diario.html >>> enanitos/ >>> imagenes/ >>> >>> (diario.html has refernces into the subdirs enanitos/ >>> and >>> imagenes/). >>> >>> How can I view this locally on the BQ? I tried something like: >>> >>> ubuntu-app-launch webbrowser-app >>> file:///home/phablet/diario2016/index.html >>> >>> but with no luck. >>> >> >> >> A .desktop file like this works for me: >> >> [Desktop Entry] >> Name=web container >> Type=Application >> Exec=webapp-container --enable-addressbar --enable-back-forward >> --webappUrlPatterns=/home/phablet/* /home/phablet/ >> Terminal=false >> X-Ubuntu-Touch=true >> > > Hello, > > Thanks, where should I place this file? > > matthias > Oh, sorry, I was a bit too brief - I thought you had been down the route of handwritten .desktop's before. You put this in a new file here: ~/.local/share/application/ e.g., ~/.local/share/application/MyWebContainer.desktop For your purpose, I guess you will want to change the Exec= line into something like Exec=webapp-container --enable-addressbar --enable-back-forward --webappUrlPatterns=/home/phablet/diario2016/* /home/phablet/diario2016/index.html I can't fully remember where I did take the information about these parameters from, try a websearch. Or try leaving them out, the names are quite descriptive anyway. In the .desktop file might want to adjust the Name= and Icon= lines to your liking. Once you have saved that file you need to pull-down-to-refresh in the appscope and then a new launcher should show up. Also, note that I'm not claiming that you /can't/ get this to work with webbrowser-app, but simply, I had this webapp-container snippet lying around and I /know/ that this one works for me. Good luck, and let us know how it goes, or if somethings unclear. -- Mailing list: https://launchpad.net/~ubuntu-phone Post to : ubuntu-phone@lists.launchpad.net Unsubscribe : https://launchpad.net/~ubuntu-phone More help : https://help.launchpad.net/ListHelp
Re: [Ubuntu-phone] viewing local HTML files
El domingo, 27 de marzo de 2016 22:17:50 (CEST), kaabud...@yahoo.de escribió: I have in the HOME of phablet some tree with HTML (...) files: phablet@ubuntu-phablet:~$ ls -C1 diario2016/ diario.html enanitos/ imagenes/ (diario.html has refernces into the subdirs enanitos/ and imagenes/). How can I view this locally on the BQ? I tried something like: ubuntu-app-launch webbrowser-app file:///home/phablet/diario2016/index.html but with no luck. A .desktop file like this works for me: [Desktop Entry] Name=web container Type=Application Exec=webapp-container --enable-addressbar --enable-back-forward --webappUrlPatterns=/home/phablet/* /home/phablet/ Terminal=false X-Ubuntu-Touch=true Hello, Thanks, where should I place this file? matthias -- Sent from my Ubuntu phone http://www.unixarea.de/ -- Mailing list: https://launchpad.net/~ubuntu-phone Post to : ubuntu-phone@lists.launchpad.net Unsubscribe : https://launchpad.net/~ubuntu-phone More help : https://help.launchpad.net/ListHelp
Re: [Ubuntu-phone] viewing local HTML files
> I have in the HOME of phablet some tree with HTML (...) files: > > phablet@ubuntu-phablet:~$ ls -C1 diario2016/ > diario.html > enanitos/ > imagenes/ > > (diario.html has refernces into the subdirs enanitos/ and > imagenes/). > > How can I view this locally on the BQ? I tried something like: > > ubuntu-app-launch webbrowser-app file:///home/phablet/diario2016/index.html > > but with no luck. > A .desktop file like this works for me: [Desktop Entry] Name=web container Type=Application Exec=webapp-container --enable-addressbar --enable-back-forward --webappUrlPatterns=/home/phablet/* /home/phablet/ Terminal=false X-Ubuntu-Touch=true -- Mailing list: https://launchpad.net/~ubuntu-phone Post to : ubuntu-phone@lists.launchpad.net Unsubscribe : https://launchpad.net/~ubuntu-phone More help : https://help.launchpad.net/ListHelp