4

So, I am am developing a Chrome Extension which means I am constantly accidentally closing Chrome:

And while you may not see it now, I've closed Chrome at least 8 times because of accidentally moving too fast and clicking the instead of the button for my extension. I mean the top of the button really is only 11 pixels away:

Now that you believe I'm not a psycho let me go through what I've tried.

  • Setting for it? Nope.
  • Another SU Question? YES! But wait, in the answer of the question it acknowledges that you can't stop Chrome from closing without warning when pressing the . Which is exactly my problem. (Yes, I know I can Ctrl + Shift + Tab to bring it back but really?)

How can I disable the , show a confirmation, or anything like that?


Side note 1: Bob made a good point in chat about how I could just move the icon to the left in front of the other extension icons. Yeah, that would work. But it's more of a workaround, and I'd still like an answer. Other devs might not have a bunch of extensions installed or have a good reason to be developing without other extensions that could cause conflict. In that case, there would be nothing to move behind of it.

Side note 2: Sort of unrelated but I've also closed Chrome when clicking in the past, so this question could help even non developers who are as sloppy as me.

2
  • also what you call a workaround but since it never comes to your Problem Probably still the Best Thing for you - On MacOS the Close/Max/Min Buttons of the Window are on the left Side so there you don't have this Problem. I know there are also some kind of Windowlayouts for Linux which have those Bottons on the left Side
    – konqui
    Nov 21, 2016 at 7:39
  • @konqui Thats pretty silly. To suggest using a whole new OS. But yes I use MacOS in addition to Windows.
    – Insane
    Nov 21, 2016 at 12:53

1 Answer 1

3

You could start typing in this answer box? ;)

enter image description here

Just thinking outside (actually, inside) the box.

Or, if you wanted to do it with the focus on another tab, you could always open the console (F12) and paste something along the lines of:

window.onbeforeunload = function (e) {
    e = e || window.event;

    if (e) {
        e.returnValue = 'Are you sure?';
    }
};
4
  • 2
    You're a genius, and for making a GIF you have my respect. I'll admit, I hate these kind of workarounds, but you might just be accepted in a week when no one else comes up with anything :P
    – Insane
    Feb 7, 2016 at 7:33
  • 2
    @Insane I'm certain there should be a better way to do it, but just the first thing that came to mind!
    – Jonno
    Feb 7, 2016 at 7:37
  • 1
    @Insane Added a little bit of JS you could add to another tab if you wanted to have a different tab in the foreground. Still haven't stumbled upon a more global option though.
    – Jonno
    Feb 7, 2016 at 7:54
  • 1
    @Jonno You could just make that bit of JS into a bookmarklet, and BAM! Solved!
    – undo
    Feb 8, 2016 at 15:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .