I am trying to write a chrome app which is set to fullscreen and started with Google's getting started tutorial from here: https://developer.chrome.com/apps/first_app
Now i am trying to disable the context menu which appears on right click.
Is that possible? And if so, how? I was searching over and over but couldn't find a solution. Please help!
Chrome context menu only apear on debugging app (loaded from a directory).
But if you still want to disable context menu on your whole chrome app, simply use preventDefault() on the onContext event of your document... (every your custom context menu ll still work...)
For js (demo):
document.addEventListener("contextmenu", function(e) {
e.preventDefault();
});
For dart:
document.onContextMenu.listen((e)=>e.preventDefault());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With