gkreidl
Posts: 6125
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)

Mon Feb 04, 2019 12:36 pm

jpezz wrote:
Sun Feb 03, 2019 3:11 pm
I read the manual and did a search of this topic and I'm still confused. It appears there is only one place to have all the configuration settings (such as homepage and options set. It also appears one could start kweb with the options and homepage on the command line. What I can't find is a way to set a per-user version of all this so when I configure the kiosk user (or any other user), the settings are all read from a local file in the user's home directory customized for that user or read based on the command line or an environment variable. Right now, one must put in the admin password to make any changes and that means the changes would be the same for all users.

This browser appears to be perfect for my needs otherwise.
"Configuration" is per user (it creates a config file in the user's home directory)
"Settings" are variables used by different tools of the kweb suite (kwebhelper, ytdl-server and omxplayerGUI). The settings are global, but both the ytdl-server and omxplayerGUI can be started using a different settings file (command line option).
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

jpezz
Posts: 97
Joined: Fri Apr 26, 2013 6:14 pm
Location: North Carolina, U.S.

Re: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)

Mon Feb 04, 2019 4:33 pm

gkreidl wrote:
Mon Feb 04, 2019 12:36 pm
jpezz wrote:
Sun Feb 03, 2019 3:11 pm
I read the manual and did a search of this topic and I'm still confused. It appears there is only one place to have all the configuration settings (such as homepage and options set. It also appears one could start kweb with the options and homepage on the command line. What I can't find is a way to set a per-user version of all this so when I configure the kiosk user (or any other user), the settings are all read from a local file in the user's home directory customized for that user or read based on the command line or an environment variable. Right now, one must put in the admin password to make any changes and that means the changes would be the same for all users.

This browser appears to be perfect for my needs otherwise.
"Configuration" is per user (it creates a config file in the user's home directory)
"Settings" are variables used by different tools of the kweb suite (kwebhelper, ytdl-server and omxplayerGUI). The settings are global, but both the ytdl-server and omxplayerGUI can be started using a different settings file (command line option).
I guess I am dense.
User x is not an administrator (no entry to allow sudo). I log on as user x to set the home page of user x as well as making changes for that user to implement kiosk mode. That user id should allow settings changes but kweb wants an admin password and it doesn't work for that user id. Once it is set up and kiosk mode is turned on, it may turn out that changes need to be made. I should be able to logon as administrator and turn off kiosk mode, then log on as that user to make changes then set those changes then log back on as an administrator to lock it down again.

I don't see whee it allows a setting file to be specified - only shows a command line option setting. I can live with that as it is easier to create a file of command lines then dynamically put the contents of that file on a command line that gets executed on login. If kweb puts info into the user's home directory when making changes, I see no documentation on what that file or directory is and what it looks like.

Thanks for your helpful response, BTW.

gkreidl
Posts: 6125
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)

Mon Feb 04, 2019 6:27 pm

jpezz wrote:
Mon Feb 04, 2019 4:33 pm
I guess I am dense.
User x is not an administrator (no entry to allow sudo). I log on as user x to set the home page of user x as well as making changes for that user to implement kiosk mode. That user id should allow settings changes but kweb wants an admin password and it doesn't work for that user id. Once it is set up and kiosk mode is turned on, it may turn out that changes need to be made. I should be able to logon as administrator and turn off kiosk mode, then log on as that user to make changes then set those changes then log back on as an administrator to lock it down again.

I don't see whee it allows a setting file to be specified - only shows a command line option setting. I can live with that as it is easier to create a file of command lines then dynamically put the contents of that file on a command line that gets executed on login. If kweb puts info into the user's home directory when making changes, I see no documentation on what that file or directory is and what it looks like.

Thanks for your helpful response, BTW.
Settings commands require root access (sudo).
Configuration (browser) does not require root rights.
The file is ".kweb.conf" inside the user's home directory.
To create it from the menu page, copy kweb_about_c.html from /usr/local/share/kweb into the home/userx directory.
You can also create .kweb.conf manually:
first line: configuration string
second line: URL (start page).
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

jpezz
Posts: 97
Joined: Fri Apr 26, 2013 6:14 pm
Location: North Carolina, U.S.

Re: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)

Mon Feb 04, 2019 8:16 pm

gkreidl wrote:
Mon Feb 04, 2019 6:27 pm

Settings commands require root access (sudo).
Configuration (browser) does not require root rights.
The file is ".kweb.conf" inside the user's home directory.
To create it from the menu page, copy kweb_about_c.html from /usr/local/share/kweb into the home/userx directory.
You can also create .kweb.conf manually:
first line: configuration string
second line: URL (start page).
Aha! I found it by accident and was about to post it when I saw your response. "The file is ".kweb.conf" inside the user's home directory.". I do not see it anywhere in the documentation of kweb. THAT is the thing I was looking for. The critical missing information.

Thanks.

I got it working except I want the forward/back page arrows showing and I'll try and figure what settings I need. If I can't figure it out, I'll be back.

Edit: I can't see any option to show the forward/back buttons (but not any other items on the toolbar). Also, I have been using mkiosk add-on with Firefox ESR and it has a cool option that auto resets to home page when idle for a (presettable) time. What would be the easiest way to implement that?

gkreidl
Posts: 6125
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)

Tue Feb 05, 2019 8:23 am

jpezz wrote:
Mon Feb 04, 2019 8:16 pm

Aha! I found it by accident and was about to post it when I saw your response. "The file is ".kweb.conf" inside the user's home directory.". I do not see it anywhere in the documentation of kweb. THAT is the thing I was looking for. The critical missing information.

Thanks.

I got it working except I want the forward/back page arrows showing and I'll try and figure what settings I need. If I can't figure it out, I'll be back.

Edit: I can't see any option to show the forward/back buttons (but not any other items on the toolbar). Also, I have been using mkiosk add-on with Firefox ESR and it has a cool option that auto resets to home page when idle for a (presettable) time. What would be the easiest way to implement that?
You can either hide the complete toolbar (kiosk mode) or show it.
Back/forward could be done in Javascript. In local HTML files you can als use keyboard command links.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

jpezz
Posts: 97
Joined: Fri Apr 26, 2013 6:14 pm
Location: North Carolina, U.S.

Re: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)

Tue Feb 05, 2019 10:17 pm

gkreidl wrote:
Tue Feb 05, 2019 8:23 am

You can either hide the complete toolbar (kiosk mode) or show it.
Back/forward could be done in Javascript. In local HTML files you can als use keyboard command links.
Thanks again for your reply. However, the first alternative - no toolbar or no arrows is not what I need. Is there any way to remove all the toolbar EXCEPT the arrows for a particular user? At least a hint as to how for this kweb newbie would help.

As to javascript, I have never used it. There are over 150 pages including the ability for the user to click on any image and see it in full size. Every one of those needs a forward-back button. I have never written javascript and while it appears that kweb can automatically add this to each page, I am just a volunteer helping out a non-profit museum. While I retired (17 years ago) as a unix security consultant and once knew it like the back of my hand, this is only one undertaking for this small museum and I'm trying but I'm looking for some more help if possible. This has taken hundreds of hours of my time since August as each page has different pictures (and the number and layout varies) and I write paragraphs of information for each page as they each describe a different artifact.

The files are all indeed local with internet disabled for security reasons and no local apache server. No keyboard is attached when the runtime user is running - just an inexpensive touch screen that looks like the click of a left mouse. I attach a keyboard and mouse to upload a new version of the web pages as they grow (and I expect about 100 more I will add) then reboot. At boot time, the user is notified to run as a specific name that requires no password and has a limited (lowercase letters only) onscreen keyboard until logged in when the keyboard is removed and the user has a kiosk mode browser opened. I have been using mkiosk on firefox ESR but kweb offers lots of future capability if I can get it to do what I want and what I hope to eventually do. Simultaneously with this system, I have just started developing a very similar system to provide the user the ability to learn about morse code and try to practice as well as complete a simple test of correctly entering a short phrase in the best time. This latter system will require more capability than the firefox will allow me so that's what made me turn to kweb. Yes, it may involve some javascript I'll have to learn to write sometime this year but if I can't use kweb now without learning java or going through a lot of hoops, it could be a big time sink and I'll end up not being able to finish the first project which is near completion much less get anywhere on the second.

Thanks again for understanding my issue. I apologize for not providing the background info up front but I underestimated the kweb interpretation of kiosk mode compared to my experiences with mkiosk which makes the present use easy but the future need almost impossible due to its limitations and the fact that it is obsolete.

gkreidl
Posts: 6125
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)

Wed Feb 06, 2019 3:51 am

jpezz wrote:
Tue Feb 05, 2019 10:17 pm
gkreidl wrote:
Tue Feb 05, 2019 8:23 am

You can either hide the complete toolbar (kiosk mode) or show it.
Back/forward could be done in Javascript. In local HTML files you can als use keyboard command links.
Thanks again for your reply. However, the first alternative - no toolbar or no arrows is not what I need. Is there any way to remove all the toolbar EXCEPT the arrows for a particular user? At least a hint as to how for this kweb newbie would help.

As to javascript, I have never used it. There are over 150 pages including the ability for the user to click on any image and see it in full size. Every one of those needs a forward-back button. I have never written javascript and while it appears that kweb can automatically add this to each page, I am just a volunteer helping out a non-profit museum. While I retired (17 years ago) as a unix security consultant and once knew it like the back of my hand, this is only one undertaking for this small museum and I'm trying but I'm looking for some more help if possible. This has taken hundreds of hours of my time since August as each page has different pictures (and the number and layout varies) and I write paragraphs of information for each page as they each describe a different artifact.

The files are all indeed local with internet disabled for security reasons and no local apache server. No keyboard is attached when the runtime user is running - just an inexpensive touch screen that looks like the click of a left mouse. I attach a keyboard and mouse to upload a new version of the web pages as they grow (and I expect about 100 more I will add) then reboot. At boot time, the user is notified to run as a specific name that requires no password and has a limited (lowercase letters only) onscreen keyboard until logged in when the keyboard is removed and the user has a kiosk mode browser opened. I have been using mkiosk on firefox ESR but kweb offers lots of future capability if I can get it to do what I want and what I hope to eventually do. Simultaneously with this system, I have just started developing a very similar system to provide the user the ability to learn about morse code and try to practice as well as complete a simple test of correctly entering a short phrase in the best time. This latter system will require more capability than the firefox will allow me so that's what made me turn to kweb. Yes, it may involve some javascript I'll have to learn to write sometime this year but if I can't use kweb now without learning java or going through a lot of hoops, it could be a big time sink and I'll end up not being able to finish the first project which is near completion much less get anywhere on the second.

Thanks again for understanding my issue. I apologize for not providing the background info up front but I underestimated the kweb interpretation of kiosk mode compared to my experiences with mkiosk which makes the present use easy but the future need almost impossible due to its limitations and the fact that it is obsolete.
1) There is no forward arrow in the toolbar, only a back button.
2) A back button using Javascript is really simple, e. g.:
<a href="javascript:history.back()"><button>Back</button></a>
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

jpezz
Posts: 97
Joined: Fri Apr 26, 2013 6:14 pm
Location: North Carolina, U.S.

Re: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)

Wed Feb 06, 2019 9:15 pm

gkreidl wrote:
Wed Feb 06, 2019 3:51 am

1) There is no forward arrow in the toolbar, only a back button.
2) A back button using Javascript is really simple, e. g.:
<a href="javascript:history.back()"><button>Back</button></a>
Aha! GREAT HELP! Not only did that do what I wanted but it allowed me to do an intelligent search for a way to go forward to a (static) web page and to understand how I could put the word I wanted "More" as well as the page name in a script. It works on my home firefox system. Now I'll try it on my target kweb one.

Thanks a million. You saved me a lot of time.

A few more things I need to work on:
1) Logging the page name to a file. I'll write a background script that will see if the page change has changed i x amount of time (name of page not the start page and file mod time >2 minutes) and if it has not, I can kill and restart the kiosk to reset to main page. Will also allow me to see if kweb has been sitting on the start page for five minutes (or multiple of) and then output audio inviting visitors to check out the system. I understand I can incorporate javascript to execute every time every page is loaded without having to put the script on each page. This will not only do the timeout feature of mkiosk on firefox but allow almost any action.

2) Certain pages will need to start a python script when the page starts and I will have to put that in the appropriate pages.

3) Right now there is no ability to log out in kiosk mode with mkiosk without a keyboard or real mouse (with a right click). The only choice is to powercycle the Pi. I'll need to incorporate one page that has a hidden place where touching it will activate logout and/or shutdown.

One strange issue I have is that one page I have shows up differently in firefox and kweb in that the table elements are different in size. I'll figure it out but I am surprised that the two are different.

I really like the implementation of kweb!.

jpezz
Posts: 97
Joined: Fri Apr 26, 2013 6:14 pm
Location: North Carolina, U.S.

Re: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)

Thu Feb 07, 2019 1:52 am

jpezz wrote:
Wed Feb 06, 2019 9:15 pm


3) Right now there is no ability to log out in kiosk mode with mkiosk without a keyboard or real mouse (with a right click). The only choice is to powercycle the Pi. I'll need to incorporate one page that has a hidden place where touching it will activate logout and/or shutdown.
I should mention I know that the ALT-q works on kweb. Like it but it does require a keyboard. I'm interested in being able to have a museum person log out before cutting power w/o having to attach a keyboard.

gkreidl
Posts: 6125
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)

Thu Feb 07, 2019 5:38 am

jpezz wrote:
Thu Feb 07, 2019 1:52 am
jpezz wrote:
Wed Feb 06, 2019 9:15 pm


3) Right now there is no ability to log out in kiosk mode with mkiosk without a keyboard or real mouse (with a right click). The only choice is to powercycle the Pi. I'll need to incorporate one page that has a hidden place where touching it will activate logout and/or shutdown.
I should mention I know that the ALT-q works on kweb. Like it but it does require a keyboard. I'm interested in being able to have a museum person log out before cutting power w/o having to attach a keyboard.
All keyboard commands can be executed by clicking on special links. Check the manual for details.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

jpezz
Posts: 97
Joined: Fri Apr 26, 2013 6:14 pm
Location: North Carolina, U.S.

Re: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)

Thu Feb 07, 2019 1:57 pm

gkreidl wrote:
Thu Feb 07, 2019 5:38 am
jpezz wrote:
Thu Feb 07, 2019 1:52 am
jpezz wrote:
Wed Feb 06, 2019 9:15 pm


3) Right now there is no ability to log out in kiosk mode with mkiosk without a keyboard or real mouse (with a right click). The only choice is to powercycle the Pi. I'll need to incorporate one page that has a hidden place where touching it will activate logout and/or shutdown.
I should mention I know that the ALT-q works on kweb. Like it but it does require a keyboard. I'm interested in being able to have a museum person log out before cutting power w/o having to attach a keyboard.
All keyboard commands can be executed by clicking on special links. Check the manual for details.
I have read the manual multiple times. I still don't understand exactly how to accomplish my task. That was the same problem I had with the Javascript. Once shown the back button script, it didn't take me long to figure out the forward button and a button to go to the main page.Right now I'm trying to figure out how to have a hidden command in each page (without editing each of them ) to execute "date>lastpage.log" along with the name of the page that logged it. I can probably figure it out myself but this is a side issue eating up a lot of my time in trying to set it, trying to test it then incorporating it in the run-time login. Once I get a simple command like that working, I can move on to other, more complicated tasks like executing a program then picking up its output to display on the page.
I understand it can be done but to me, the manual is confusing even when I go back and re-read it. For example, if I create a local file for a particular user with kweb_edit, what makes kweb pick up that file name (instead of the one in /usr/local/share and can that local file have any name?

gkreidl
Posts: 6125
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)

Thu Feb 07, 2019 4:36 pm

jpezz wrote:
Thu Feb 07, 2019 1:57 pm
I have read the manual multiple times. I still don't understand exactly how to accomplish my task. That was the same problem I had with the Javascript. Once shown the back button script, it didn't take me long to figure out the forward button and a button to go to the main page.Right now I'm trying to figure out how to have a hidden command in each page (without editing each of them ) to execute "date>lastpage.log" along with the name of the page that logged it. I can probably figure it out myself but this is a side issue eating up a lot of my time in trying to set it, trying to test it then incorporating it in the run-time login. Once I get a simple command like that working, I can move on to other, more complicated tasks like executing a program then picking up its output to display on the page.
I understand it can be done but to me, the manual is confusing even when I go back and re-read it. For example, if I create a local file for a particular user with kweb_edit, what makes kweb pick up that file name (instead of the one in /usr/local/share and can that local file have any name?
kweb_edit.py can create a file anywhere, e. g.
kweb_edit.py /home/pi/myfile.txt
The resulting HTML file will be /home/pi/myfile.html.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

jpezz
Posts: 97
Joined: Fri Apr 26, 2013 6:14 pm
Location: North Carolina, U.S.

Re: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)

Thu Feb 07, 2019 9:38 pm

gkreidl wrote:
Thu Feb 07, 2019 4:36 pm
jpezz wrote:
Thu Feb 07, 2019 1:57 pm
I have read the manual multiple times. I still don't understand exactly how to accomplish my task. That was the same problem I had with the Javascript. Once shown the back button script, it didn't take me long to figure out the forward button and a button to go to the main page.Right now I'm trying to figure out how to have a hidden command in each page (without editing each of them ) to execute "date>lastpage.log" along with the name of the page that logged it. I can probably figure it out myself but this is a side issue eating up a lot of my time in trying to set it, trying to test it then incorporating it in the run-time login. Once I get a simple command like that working, I can move on to other, more complicated tasks like executing a program then picking up its output to display on the page.
I understand it can be done but to me, the manual is confusing even when I go back and re-read it. For example, if I create a local file for a particular user with kweb_edit, what makes kweb pick up that file name (instead of the one in /usr/local/share and can that local file have any name?
kweb_edit.py can create a file anywhere, e. g.
kweb_edit.py /home/pi/myfile.txt
The resulting HTML file will be /home/pi/myfile.html.
But what makes kweb use that file?
I would like to put a hidden command in that file and want it executed every time every page loads. Will that work?
How would I grab the name of the page I loaded and output that name to a file so I know what page was just loaded?

I must be really slow!

gkreidl
Posts: 6125
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)

Mon Feb 11, 2019 9:04 am

jpezz wrote:
Thu Feb 07, 2019 9:38 pm
But what makes kweb use that file?
I would like to put a hidden command in that file and want it executed every time every page loads. Will that work?
How would I grab the name of the page I loaded and output that name to a file so I know what page was just loaded?

I must be really slow!
No, that won't work.
You have to add the hidden command to each of your HTML files, a small invisible iframe (0x0, border width =0) whose src attribute contains the command link. You can also use JavaScript to set the src at load time.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

jpezz
Posts: 97
Joined: Fri Apr 26, 2013 6:14 pm
Location: North Carolina, U.S.

Re: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)

Mon Feb 11, 2019 9:02 pm

gkreidl wrote:
Mon Feb 11, 2019 9:04 am
jpezz wrote:
Thu Feb 07, 2019 9:38 pm
But what makes kweb use that file?
I would like to put a hidden command in that file and want it executed every time every page loads. Will that work?
How would I grab the name of the page I loaded and output that name to a file so I know what page was just loaded?

I must be really slow!
No, that won't work.
You have to add the hidden command to each of your HTML files, a small invisible iframe (0x0, border width =0) whose src attribute contains the command link. You can also use JavaScript to set the src at load time.
So the code would look like this to add a command in each page to put the current date/time in to a file called "Date_of_Command"?

<body lang="en-US" link="#0563c1" vlink="#954f72" dir="ltr"> <------------------ Existing "body" to start html.

<iframe src="cmd=date>~/Date_of_Command" width="2" height="2"
name=""></iframe>

or does it have to have the filename in it like this?

<iframe src="file:///each_page_name_here.html?cmd=date>~/Date_of_Command" width="2" height="2"
name=""></iframe>

which would require some javascript like
var title = document.getElementsByTagName("title")[0].innerHTML;

then incorporate that into the iframe command.

gkreidl
Posts: 6125
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)

Mon Feb 11, 2019 10:16 pm

jpezz wrote:
Mon Feb 11, 2019 9:02 pm
gkreidl wrote:
Mon Feb 11, 2019 9:04 am
jpezz wrote:
Thu Feb 07, 2019 9:38 pm
But what makes kweb use that file?
I would like to put a hidden command in that file and want it executed every time every page loads. Will that work?
How would I grab the name of the page I loaded and output that name to a file so I know what page was just loaded?

I must be really slow!
No, that won't work.
You have to add the hidden command to each of your HTML files, a small invisible iframe (0x0, border width =0) whose src attribute contains the command link. You can also use JavaScript to set the src at load time.
So the code would look like this to add a command in each page to put the current date/time in to a file called "Date_of_Command"?

<body lang="en-US" link="#0563c1" vlink="#954f72" dir="ltr"> <------------------ Existing "body" to start html.

<iframe src="cmd=date>~/Date_of_Command" width="2" height="2"
name=""></iframe>

or does it have to have the filename in it like this?

<iframe src="file:///each_page_name_here.html?cmd=date>~/Date_of_Command" width="2" height="2"
name=""></iframe>

which would require some javascript like
var title = document.getElementsByTagName("title")[0].innerHTML;

then incorporate that into the iframe command.
No.
<iframe src="file:///homepage.html?cmd=command%20arg" width="0" height="0"
name="anything"></iframe>
"command" script should be in /usr/local/bin, or you must include the full path: cmd=%2Fpath%2Fcommand%20arg
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

jpezz
Posts: 97
Joined: Fri Apr 26, 2013 6:14 pm
Location: North Carolina, U.S.

Re: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)

Mon Feb 11, 2019 11:38 pm

gkreidl wrote:
Mon Feb 11, 2019 10:16 pm
jpezz wrote:
Mon Feb 11, 2019 9:02 pm
gkreidl wrote:
Mon Feb 11, 2019 9:04 am

No, that won't work.
You have to add the hidden command to each of your HTML files, a small invisible iframe (0x0, border width =0) whose src attribute contains the command link. You can also use JavaScript to set the src at load time.
So the code would look like this to add a command in each page to put the current date/time in to a file called "Date_of_Command"?

<body lang="en-US" link="#0563c1" vlink="#954f72" dir="ltr"> <------------------ Existing "body" to start html.

<iframe src="cmd=date>~/Date_of_Command" width="2" height="2"
name=""></iframe>

or does it have to have the filename in it like this?

<iframe src="file:///each_page_name_here.html?cmd=date>~/Date_of_Command" width="2" height="2"
name=""></iframe>

which would require some javascript like
var title = document.getElementsByTagName("title")[0].innerHTML;

then incorporate that into the iframe command.
No.
<iframe src="file:///homepage.html?cmd=command%20arg" width="0" height="0"
name="anything"></iframe>
"command" script should be in /usr/local/bin, or you must include the full path: cmd=%2Fpath%2Fcommand%20arg
So this should work? But it doesn't.

Code: Select all

<iframe src="file:///homepage.html?cmd=/bin/date%3E/home/admin/telegraph/Date_of_Command" width="0" height="0" name="getaccessdate"></iframe>
In kiosk mode, nothing happens. W/o kiosk mode (i.i. "K" removed), I get a terminal window whose name is "Date_of_Command", the output file name for the date command.
This is the .kweb.conf file in the target user's home directory:
-JKHCA+-zbhrqfpoklgtjJeduwxyavcsmi#?!.,
file:///home/admin/telegraph/Web_Page/Main.html


So what did I do wrong?

It is also not clear as to the meaning of homepage.html since this file does not exist and I want this code in every file. Is it just something that kweb uses internally?

And please note, I have read that manual so many times, I think have it memorized.

gkreidl
Posts: 6125
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)

Tue Feb 12, 2019 7:24 am

jpezz wrote:
Mon Feb 11, 2019 11:38 pm


So this should work? But it doesn't.

Code: Select all

<iframe src="file:///homepage.html?cmd=/bin/date%3E/home/admin/telegraph/Date_of_Command" width="0" height="0" name="getaccessdate"></iframe>
In kiosk mode, nothing happens. W/o kiosk mode (i.i. "K" removed), I get a terminal window whose name is "Date_of_Command", the output file name for the date command.
This is the .kweb.conf file in the target user's home directory:
-JKHCA+-zbhrqfpoklgtjJeduwxyavcsmi#?!.,
file:///home/admin/telegraph/Web_Page/Main.html


So what did I do wrong?

It is also not clear as to the meaning of homepage.html since this file does not exist and I want this code in every file. Is it just something that kweb uses internally?

And please note, I have read that manual so many times, I think have it memorized.
1) the "file:///homepage.html?...." is a dummy link used to execute commands (3 different ways)
2) Command execution must be enabled. It cannot be enabled by the config file! For security reasons, commands are disabled, when you start the browser with a start page inside the unprotected user directory. 2 possible solutions: Start the browser with an options string or put your start page in the root part (e. g. /usr/local/share/kweb).
3) Some characters must be escaped in the cmd uri (e. g. spaces, slashes, quotes). Use the command editor to create a dummy file or add your command to the application page first. The editor will create the right link for you.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

jpezz
Posts: 97
Joined: Fri Apr 26, 2013 6:14 pm
Location: North Carolina, U.S.

Re: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)

Tue Feb 12, 2019 4:20 pm

gkreidl wrote:
Tue Feb 12, 2019 7:24 am
jpezz wrote:
Mon Feb 11, 2019 11:38 pm


So this should work? But it doesn't.

Code: Select all

<iframe src="file:///homepage.html?cmd=/bin/date%3E/home/admin/telegraph/Date_of_Command" width="0" height="0" name="getaccessdate"></iframe>
In kiosk mode, nothing happens. W/o kiosk mode (i.i. "K" removed), I get a terminal window whose name is "Date_of_Command", the output file name for the date command.
This is the .kweb.conf file in the target user's home directory:
-JKHCA+-zbhrqfpoklgtjJeduwxyavcsmi#?!.,
file:///home/admin/telegraph/Web_Page/Main.html


So what did I do wrong?

It is also not clear as to the meaning of homepage.html since this file does not exist and I want this code in every file. Is it just something that kweb uses internally?

And please note, I have read that manual so many times, I think have it memorized.
1) the "file:///homepage.html?...." is a dummy link used to execute commands (3 different ways)
Aha! That explains a lot. I thought that it had to be my home page.
2) Command execution must be enabled. It cannot be enabled by the config file! For security reasons, commands are disabled, when you start the browser with a start page inside the unprotected user directory. 2 possible solutions: Start the browser with an options string or put your start page in the root part (e. g. /usr/local/share/kweb).
Well that explains why it doesn't work in Kiosk mode. I changed the startup script to put the options and start page on the kweb run line.
3) Some characters must be escaped in the cmd uri (e. g. spaces, slashes, quotes). Use the command editor to create a dummy file or add your command to the application page first. The editor will create the right link for you.
Not the slashes. Not one of your examples show slashes escaped. I now changed the line to this:

Code: Select all

<iframe src="file:///homepage.html?cmd=/home/admin/telegraph/CreateDate.sh%20Main.html" width="0" height="0" name="getaccessdate"></iframe>
and it works. I use my shell script so I can pass the html file name to the script which writes both it and the date/time into a file.

Now I have to work on two things:
Javascript to put the html file name in the iframe instead of having the the name preset.
Adding the script to the commands so it doesn't create a terminal window.

Thanks again for your patience.

Edit:
I created my command as an autoconfig one so as not to have to put the full path name in the iframe as described in the manual. You need admin password to create it but it creates it in /usr/local/share/kweb as kwebautoconfig.html and kwebautoconfig.txt which means it would apply to all users. I want it only to apply to the kiosk user "key". Should I move those two files to key's home directory with the same name? should I move them there and change the names to hompage.txt and homepage.html? (I realize the .txt is not actually used except by the editor to create the .html file).

gkreidl
Posts: 6125
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)

Wed Feb 13, 2019 4:09 am

jpezz wrote:
Tue Feb 12, 2019 4:20 pm

Not the slashes. Not one of your examples show slashes escaped. I now changed the line to this:

Code: Select all

<iframe src="file:///homepage.html?cmd=/home/admin/telegraph/CreateDate.sh%20Main.html" width="0" height="0" name="getaccessdate"></iframe>
and it works. I use my shell script so I can pass the html file name to the script which writes both it and the date/time into a file.

Now I have to work on two things:
Javascript to put the html file name in the iframe instead of having the the name preset.
Adding the script to the commands so it doesn't create a terminal window.

Thanks again for your patience.

Edit:
I created my command as an autoconfig one so as not to have to put the full path name in the iframe as described in the manual. You need admin password to create it but it creates it in /usr/local/share/kweb as kwebautoconfig.html and kwebautoconfig.txt which means it would apply to all users. I want it only to apply to the kiosk user "key". Should I move those two files to key's home directory with the same name? should I move them there and change the names to hompage.txt and homepage.html? (I realize the .txt is not actually used except by the editor to create the .html file).
kwebautoconfig.html is only applied once, when the browser starts, and it must be in /usr/local/share/kweb.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

grkblood13
Posts: 7
Joined: Sat Feb 16, 2019 2:11 pm

Re: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)

Sat Feb 16, 2019 7:35 pm

Is anyone able to successfully play the demo videos on www.mediaelementjs.com? I rely heavily on this framework so any assistance with getting it to work on kweb would be appreciated.

jpezz
Posts: 97
Joined: Fri Apr 26, 2013 6:14 pm
Location: North Carolina, U.S.

Re: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)

Sun Feb 17, 2019 2:44 pm

Recommended enhancements to kweb:

Simple ability in kiosk mode to show forward/back arrows on pages.

Simple ability in kiosk mode to timeout pages when inactivity reaches preset time so browser automatically returns to home page.

By-user configuration pages in local directory so features can be enabled/disable for a single user and not for all users. Customized commands, autoconfig, etc. use local file if present, else use /usr/local/share/kweb files.

Ability to enable no-terminal script execution with option in iframe line without changing autoconfig file.

Thanks.

MaryShah
Posts: 27
Joined: Sat May 06, 2017 11:07 pm

Re: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)

Tue Feb 19, 2019 3:57 pm

is it possible to disable web security for the kweb browser so I can do a cors request from a server?
in chromium this is done using the below flag

chromium-browser --disable-web-security

looking for something similar in kweb, midori or another low footprint browser for the pi

gkreidl
Posts: 6125
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)

Tue Feb 19, 2019 5:52 pm

grkblood13 wrote:
Sat Feb 16, 2019 7:35 pm
Is anyone able to successfully play the demo videos on www.mediaelementjs.com? I rely heavily on this framework so any assistance with getting it to work on kweb would be appreciated.
It does work with most video formats but performance is bad (lots of missed frames). While performance of a normal youtube video is quite good. I think it's the combination of software decoding + framework overhead which is responsible for the bad performance.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

gkreidl
Posts: 6125
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)

Tue Feb 19, 2019 5:55 pm

MaryShah wrote:
Tue Feb 19, 2019 3:57 pm
is it possible to disable web security for the kweb browser so I can do a cors request from a server?
in chromium this is done using the below flag

chromium-browser --disable-web-security

looking for something similar in kweb, midori or another low footprint browser for the pi
"web-security" is not a clearly defined term. I have no idea what it means in this context - and I don't know what a "cors request" means.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

Return to “Raspbian”