Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

keybind action to close a browser tab

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
lz300
Posts: 8
Joined: 2018-08-25 21:32

keybind action to close a browser tab

#1 Post by lz300 »

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 ?

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: keybind action to close a browser tab

#2 Post by debiman »

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.

TonyT
Posts: 575
Joined: 2006-09-04 11:57

Re: keybind action to close a browser tab

#3 Post by TonyT »

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.

lz300
Posts: 8
Joined: 2018-08-25 21:32

Re: keybind action to close a browser tab

#4 Post by lz300 »

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.

Dai_trying
Posts: 1101
Joined: 2016-01-07 12:25
Has thanked: 5 times
Been thanked: 16 times

Re: keybind action to close a browser tab

#5 Post by Dai_trying »

Wouldn't it make more sense to create user with very limited access to the system to prevent these things?

lz300
Posts: 8
Joined: 2018-08-25 21:32

Re: keybind action to close a browser tab

#6 Post by lz300 »

Is is possible to lock down (or heavily restrict) right-click menus, and prevent the ability to delete anything ? If so, then yes.

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: keybind action to close a browser tab

#7 Post by debiman »

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.

lz300
Posts: 8
Joined: 2018-08-25 21:32

Re: keybind action to close a browser tab

#8 Post by lz300 »

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.

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: keybind action to close a browser tab

#9 Post by debiman »

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?

lz300
Posts: 8
Joined: 2018-08-25 21:32

Re: keybind action to close a browser tab

#10 Post by lz300 »

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.

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: keybind action to close a browser tab

#11 Post by debiman »

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?

lz300
Posts: 8
Joined: 2018-08-25 21:32

Re: keybind action to close a browser tab

#12 Post by lz300 »

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

#13 Post by lz300 »

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.

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: keybind action to close a browser tab

#14 Post by debiman »

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.

lz300
Posts: 8
Joined: 2018-08-25 21:32

Re: keybind action to close a browser tab

#15 Post by lz300 »

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.

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: keybind action to close a browser tab

#16 Post by GarryRicketson »

Dai_trying wrote:Wouldn't it make more sense to create user with very limited access to the system to prevent these things?
This would be the way I approached this, if it was me. In fact, on our home PC,
my wife, and kid have their "user accounts", home dir, and can use the browser, and have their own Desktop, (Not DE, it is a WM, but they do have a Desktop directory,) but they can not even view my home dir, nor Desktop,etc.
and they can not use sudo or su.
==========
All though the OP does not seem to want to use a kiosk type set up, and I don't know much about this, in fact I had to do a search : "What is a kiosk system ?"
and then that inspired me to search: "kiosk packages for debian ",
This : https://willhaley.com/blog/debian-fullscreen-gui-kiosk/
These instructions are helpful if you would like to create a computer kiosk. The instructions are designed to run Chromium (the open-source version of Google’s Chrome browser), but can be adapted to run any GUI program in a kiosk/fullscreen mode.
There was another one, a"kiosk-browser", but it involves to many things from non-Debian sources, in my opinion.
How ever it might be of interest, to somebody,
This package disables the regular GUI and installs a browser-only GUI. Keyboards and mice are disabled to prevent tampering.----snip---
(my comment: makes me wonder how the user maneuvers, I think one would need to ask the author about that)
---more--Notes

This package disables all inputs in the X server so that nobody can mess with your system or use it as an entry point into your network.---snip---
different Browsers
The default browser is Chromium.
============
with a screensaver option
I don't understand why this is important, I don't use a "screen saver" that runs within the OS, how ever the "screen",...I guess it is, we call them Pantalla, here.
Any way, it has it's own "power saveing" settings, if the PC is not active for 10 minuets, the screen shots off, if and when someone moves the mouse or touches the keyboard, it comes back on,...
But any way, if a screen saver is essential , maybe :
https://manpages.debian.org/stretch/xsc ... .1.en.html
This program can lock your terminal in order to prevent others from using it, though its default mode of operation is merely to display pretty pictures on your screen when it is not in use.
It also provides configuration and control of your monitor's power-saving features.

Could the OP elaborate more on this:
Post by lz300 » 2018-08-27 14:39

It will be for public use.
Is this , maybe a public library, or perhaps a sales department, or by "public", you mean every body in the office, could it be a internet cafe ?

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: keybind action to close a browser tab

#17 Post by debiman »

lz300 wrote:I apologize for calling you a douchebag.
apology accepted.
it is ok to lose your nerves (or be snarky, in my case).
i just don't like the holier-than-thou attitude.
however, if you want to ever bring this to a conclusion, you need to concentrate on the topic at hand.
it seems like you're throwing in the towel now, and just having a meta discussion with me?
i don't understand why, but I am perfectly happy to have it.

seems like now would be the moment to get things rolling, do some web searches, try a few things, share results...?
I DID share that I was using chromium earlier, when I mentioned my exact requirements.
not in so many words.
now that i know it, yes it could be read like that: a hard requirement.

btw, i have been saying what i say from the start of the thread, just repeating it in varying aspects.

the permission thing is maybe a completely different approach, or maybe it's complementary - it would be best to implement both. but to get the whole thing looking good & remain usable even after wrong user input or even a program crash, you need to consider what i wrote so far.

TonyT
Posts: 575
Joined: 2006-09-04 11:57

Re: keybind action to close a browser tab

#18 Post by TonyT »


Post Reply