keybind action to close a browser tab

If none of the more specific forums is the right place to ask

keybind action to close a browser tab

Postby lz300 » 2018-08-25 21:40

I want to create my own keyboard combination to close a tab in a browser in raspbian stretch.

I am working with modding keybinds in the lxde-pi-rc.xml file.
I am basically looking for the equivalent of ctrl-w. I need to make it more difficult to do, as this will be for public access.

I can do action name="Close", but that closes the entire browser. I wish to only close the active tab.

Anyone have any ideas ?
lz300
 
Posts: 8
Joined: 2018-08-25 21:32

Re: keybind action to close a browser tab

Postby debiman » 2018-08-26 07:50

lz300 wrote:I am basically looking for the equivalent of ctrl-w. I need to make it more difficult to do, as this will be for public access.
what? why? why isn't ctrl-w good enough?

I can do action name="Close", but that closes the entire browser. I wish to only close the active tab.
it's not possible like that.
you need to use something like xdotool issuing ctrl-w, together with a script that targets the proper window.
unless maybe some browsers have a way to close tabs via command line (send commands to a running instance). mozilla browsers don't, and neither have chromium-based. to my knowledge. but feel free to research the issue.
User avatar
debiman
 
Posts: 3008
Joined: 2013-03-12 07:18

Re: keybind action to close a browser tab

Postby TonyT » 2018-08-26 12:49

I woulds think it depends on the browser. For example, in Firefox:

Close current tab or window. Command-W to close your current tab. To close your current Firefox window, use Command-Shift-W.
TonyT
 
Posts: 548
Joined: 2006-09-04 11:57

Re: keybind action to close a browser tab

Postby lz300 » 2018-08-27 20:39

It will be for public use. I need to lock it down as much as possible. If someone can get to the desktop, then they can delete my shortcuts, access right-click menus, etc. Making it harder to exit the browser seems easier than chasing everything else down.
lz300
 
Posts: 8
Joined: 2018-08-25 21:32

Re: keybind action to close a browser tab

Postby Dai_trying » 2018-08-27 22:13

Wouldn't it make more sense to create user with very limited access to the system to prevent these things?
Dai_trying
 
Posts: 556
Joined: 2016-01-07 12:25

Re: keybind action to close a browser tab

Postby lz300 » 2018-08-27 23:19

Is is possible to lock down (or heavily restrict) right-click menus, and prevent the ability to delete anything ? If so, then yes.
lz300
 
Posts: 8
Joined: 2018-08-25 21:32

Re: keybind action to close a browser tab

Postby debiman » 2018-08-28 06:00

lz300 wrote:It will be for public use. I need to lock it down as much as possible. If someone can get to the desktop, then they can delete my shortcuts, access right-click menus, etc. Making it harder to exit the browser seems easier than chasing everything else down.

i don't see how this relates to your original question; Ctrl-W has niothing to do with it.

i realise you want to set up a kiosk system, but haven't got the first clue about how to do that.

firstly:
have you considered that many linux based kiosk systems exist, so instead of re-inventing the wheel, some targeted web searches might help?

in fact kiosk distros exist.

just one quick hint:
if you tell Xorg to start the browser instead of a window manager, exiting the browser will also exit the graphical session. there won't even be any desktop.
User avatar
debiman
 
Posts: 3008
Joined: 2013-03-12 07:18

Re: keybind action to close a browser tab

Postby lz300 » 2018-08-29 02:04

Um.... my original question IS about creating a keyboard shortcut alternative to ctrl-w that will close a browser tab...

I do have some knowledge (limited) of creating a kiosk, but mine is not the standard kiosk type.

I am aware of different pre-built images out there for kiosks, but they lock down too much.

Here are my exact requirements:
full screen browser (chromium) to a specific website on boot
disable ALL ability to do any keyboard shortcuts (other than closing a tab and the browser)
have the ability of my non-linux coworkers to be able to shut down or reboot the device
prevent anyone from being able to create, delete, move, or modify anything (without root access)
run a screensaver

I have created a shutdown and a reboot shortcut on the desktop for my coworkers to manage the device. Or I might come up with an SSH solution from a different machine. There is no actual need to get to a desktop, but I am not aware of an image that can run a screensaver without having a desktop.

Since the answer to my original question of using keybind to come up with an alternate way of closing a tab (like ctrl-w) appears to be that it cannnot be done, I will consider this thread closed.
lz300
 
Posts: 8
Joined: 2018-08-25 21:32

Re: keybind action to close a browser tab

Postby debiman » 2018-08-29 06:23

lz300 wrote:Um.... my original question IS about creating a keyboard shortcut alternative to ctrl-w that will close a browser tab...

yes, but why?
ansd what keyboard shortcut would that be?
why is ctrl-w not good enough?
have you considered that keyboard shortcuts might be configrable right inside the browser?
User avatar
debiman
 
Posts: 3008
Joined: 2013-03-12 07:18

Re: keybind action to close a browser tab

Postby lz300 » 2018-08-29 14:51

This will be open to the public. Anyone familiar with using ctrl-w will be able to close the browser. I want to make it more difficult (alt-shift-F9, for example), so nobody will mess with it. I can use keybind to use that 3-key combo to close the browser, but not the individual tabs.

I haven't been able to find a way to modify shortcut keys in chromium.
lz300
 
Posts: 8
Joined: 2018-08-25 21:32

Re: keybind action to close a browser tab

Postby debiman » 2018-08-29 17:41

lz300 wrote:Anyone familiar with using ctrl-w will be able to close the browser.
this isn't true.
e.g. firefox can be set up to not close when the last tab is closed.
and that is what you can change with the preferences gui; about:config offers many more options.
i guess sth similar exists for chromium-based browsers too.
in any case there's a slew of other browsers you can check out.
you could even use chrom/e/ium and make it restart immediately when someone closes it.

etc. etc. etc.

just off the top of my head there's a dozen solutions to what you want, yet you keep on harping on a window manager keybind - you don't even need a window manager for a browser kiosk!

you really haven't the first clue about what you're doing there, do you?
User avatar
debiman
 
Posts: 3008
Joined: 2013-03-12 07:18

Re: keybind action to close a browser tab

Postby lz300 » 2018-08-31 13:51

Lets see...

From your comments, I have deduced the following...

what? why? why isn't ctrl-w good enough?


You feel that ctrl-w should be "good enough", despite my explanation of wanting a more challenging way of closing tabs

it's not possible like that. you need to use something like xdotool issuing ctrl-w, together with a script that targets the proper window.
unless maybe some browsers have a way to close tabs via command line


I must have overlooked this, this was exactly the answer I was looking for - it cannot be done with keybinds. My bad.

i realise you want to set up a kiosk system, but haven't got the first clue about how to do that.


Whatever gave you that idea ? Maybe because I'm asking questions on a debian forum in the General section ?
I am obviously trying to learn about how to do this. I have searched for (unsuccessfully) a "kiosk distro" that fits all my needs, and have been unsuccessful so far. I am still looking, but in the meantime I am trying to lock down a standard desktop image. It has been a great learning experience so far.

just off the top of my head there's a dozen solutions to what you want, yet you keep on harping on a window manager keybind - you don't even need a window manager for a browser kiosk!


My original question was about modding keybind. I guess that is why I keep harping about it...
And I still haven't found a solution that provides a desktop-less distro AND a screensaver... maybe you could share one of the dozen solutions with me off the top of your head that would accomplish this ?

you really haven't the first clue about what you're doing there, do you?


The first time you tried to insult me, I blew it off. Maybe it's a personality trait that you have, or maybe you are not a people person. Maybe you didn't receive enough love as a child.
But this second time ? I've concluded that you are just a douchebag.
Last edited by lz300 on 2018-08-31 20:11, edited 1 time in total.
lz300
 
Posts: 8
Joined: 2018-08-25 21:32

Re: keybind action to close a browser tab

Postby lz300 » 2018-08-31 15:44

Thanks, TonyT, for the helpful suggestion on browser-specific settings.
Unfortunately, I'm forced to use chromium (company decision), and am still searching for options in that browser.

And thanks, Dai_trying, for the suggestion on changing permissions. I got that done for creating, modifying and deleting items on the desktop. Now I just need to lock down the ability to show folders, the recycle bin, etc.
lz300
 
Posts: 8
Joined: 2018-08-25 21:32

Re: keybind action to close a browser tab

Postby debiman » 2018-09-01 14:00

lz300 wrote:my explanation of wanting a more challenging way of closing tabs

yep, you also said why you need that:
so the user can't accidenatlly close the browser completely and "use" the "desktop".
but there are much cleverer ways to circumvent that.
"making it harder" is not thebest solution.
looking at how kiosk systems do things would certainly be enlightening, even if you want to roll your own in the end.

it would certainly help to not even log into a desktop but straight into the browser.

lz300 wrote:The first time you tried to insult me, I blew it off. Maybe it's a personality trait that you have, or maybe you are not a people person. Maybe you didn't receive enough love as a child.
But this second time ? I've concluded that you are just a douchebag.

I did not insult you, I criticized you.
Saying "you haven't got the first clue about what you're doing there" might be insensitive, and it might _feel_ insulting, but it has some content, and some people would even perceive it as constructive.
Saying "you're a douchebag", however, has no content at all and is objectively an insult.

lz300 wrote:I'm forced to use chromium (company decision)

11 posts later you deign to share this imprtant information!
:roll:
chromium has quite many "secret" options, you should search for that. but after your reaction I will not do it for you anymore.
User avatar
debiman
 
Posts: 3008
Joined: 2013-03-12 07:18

Re: keybind action to close a browser tab

Postby lz300 » 2018-09-01 16:48

I apologize for calling you a douchebag. I was extremely frustrated with how this post has been going, and other things going on in my life compounded things...

I don't see your "constructive criticism" comments as very constructive, however. They felt like slightly veiled insults to me. I was not inspired by the comment "you really haven't the first clue about what you're doing there, do you?" It didn't make me want to rush out and try to increase my kiosk-building knowledge. It just made me angry.

but there are much cleverer ways to circumvent that.
"making it harder" is not thebest solution.
looking at how kiosk systems do things would certainly be enlightening, even if you want to roll your own in the end.

it would certainly help to not even log into a desktop but straight into the browser.


That, to me, is constructive criticism. You are telling me I am going about this wrong, ant that there are other, better ways to accomplish my task. And you didn't comment on my lack of knowledge of how to do things.

I DID share that I was using chromium earlier, when I mentioned my exact requirements.

Again, I realize I missed the answer to my question in your first reply. At that point, I should have considered the topic resolved, and either lived with it, or try to find a kiosk image with a screensaver option, which I still cannot find. But I will keep looking.

Thanks for the ideas, and the constructive criticism.
lz300
 
Posts: 8
Joined: 2018-08-25 21:32

Next

Return to General Questions

Who is online

Users browsing this forum: No registered users and 6 guests

fashionable