Some web sites (an increasing number of them these days, it seems) hijack various key combinations to perform actions within and defined by the web site itself. There's the specific example of / in GMail in an inappropriately titled question; there's the StackExchange edit box which hijacks Ctrl+G for "Add image" (rather than Firefox's normal "Find next"); there's Facebook hijacking Esc to hide an overlay rather than the usual "stop loading". I'm sure I could go on and on with examples, but this should be enough to illustrate that this question is not about any one specific website.
I use the keyboard extensively and keyboard shortcuts behaving differently based on which web site I am on is a major annoyance to me. If I press a browser-defined keyboard shortcut, I want the action defined by the browser to be taken, not something else. I also don't want certain features which are normally accessible by keyboard to not be accessible by keyboard, or suddenly be remapped to other key combinations.
I realize that this may make some things more cumbersome on some sites, but in this case I prefer consistency.
Is it possible to set up Firefox to prevent or ignore such hijackings by web sites and favor Firefox's own defined behavior?
A solution that works at least for Firefox versions 20, 21 and 22 on both Linux and Windows would be ideal.
Edit Mozilla Bugzilla Bug 380637 Should web pages be able to override the browser's keyboard shortcuts? seems to indicate it is at least being looked at. That bug was initially submitted in mid-2007 and is still active as of mid-2013. Interestingly enough, bug 775002 Enable users to disable javascript to hijack keyboard shortcuts was considered a duplicate around Firefox 15.