Search code examples
firefoxgoogle-chromenpapifirebreathbrowser-plugin

Is there a way to disable Alt+F4, Ctrl+F4, Ctrl+W in web browser using an NPAPI plugin using Firebreath?


Is it possible to prevent certain Keypresses (as mentioned int he title) from reaching the browser? Basically I want to strip down user's ability to close a browser window. Is it possible through NPAPI plugin, particularly in google-chrome web browser. The plugin will be developed using firebreath.


Solution

  • If your actual question is if the browsers give plugins a way to do this, the answer is absolutely not.

    That said, there may be system APIs that you can use to do that, but you'd definitely be more likely to get help if you ask a question about how to do that using system APIs. The challenge will be finding a way to only do it when you're in the browser or on a specific tab, etc; there is no way through the browser to do this. If there is a way it'll be hackish and involve system calls, not plugin calls.

    Also remember that plugins don't automatically instantiate; it would only work on a page with your object tag. http://npapi.com/extensions for more info