← Back to team overview

ubuntu-phone team mailing list archive

Re: 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 <img ...> 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.


Follow ups

References