Does anybody know how to disable CKEditor\'s context (right click) menu? I would expect a configuration option, but I can\'t find one. I am using v3.1. Thanks.
It's possible to completely disable the context menu adding this line to your config file (tipically fckconfig.js):
FCKConfig.ContextMenu = [];
As of version 3.6.4, the other answers in this question don't work anymore. See bug #9284
The three plugins that need to be disabled (using the means discussed in this question), are contextmenu, liststyle and tabletools. So for example, using config files:
CKEDITOR.editorConfig = function(config) {
/* Your config options */
...
config.removePlugins = 'contextmenu,liststyle,tabletools';
};
There is still a practical solution, by overriding the prototype function that initializes contextmenu behavior:
CKEDITOR.dom.element.prototype.disableContextMenu = function () {
this.on( 'contextmenu', function( event ) {
// your contextmenu behavior
});
};
NOTE: when CKEDITOR loads its JS resources dynamically you need to place it right before the replace call.
You need to remove the contextmenu plugin. See here for 3.1.
In CKEditor 4.x, (I tested 4.2.2) you must do both:
CKEDITOR.replace('my_editor', {
removePlugins : 'contextmenu'
});
And
CKEDITOR.editorConfig = function(config) {
/* Your config options */
...
config.removePlugins = ''liststyle,tabletools,contextmenu'';
};
All three of those will automatically require contextmenu if you don't disable them.
Ckeditor 4.7.1
CKEDITOR.editorConfig = function (config) {
config.language = 'en';
config.toolbar = "mini";
config.removePlugins = 'elementspath,contextmenu,liststyle,tabletools,tableselection';
config.disableNativeSpellChecker = false;
}
Ckeditor 4.8.0 ('elementspath' plugin no longer need to remove)
CKEDITOR.editorConfig = function (config) {
config.language = 'en';
config.toolbar = "mini";
config.removePlugins = 'contextmenu,liststyle,tabletools,tableselection';
config.disableNativeSpellChecker = false;
}