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.
I needed to disable all of the following to get this to work.
config.removePlugins = 'language,tableresize,liststyle,tabletools,scayt,menubutton,contextmenu';
Previously we did not need language or tableresize - but a newer version of ckeditor seems to require that.
I discovered this in looking at the output in F12 dev tools on chrome.
With CKEditor 3.6 I was able to disable context menu by removing the contextmenu plugin as suggested above. To do this, you have to configure the editor with the removePlugins option. For instance:
CKEDITOR.replace('my_editor', {
removePlugins : 'contextmenu'
});
It can also be disabled globally from the config.js file:
CKEDITOR.editorConfig = function(config) {
/* Your config options */
...
config.removePlugins = 'contextmenu';
};
For version 4.2, I put the following at the end of my config.js file
CKEDITOR.on('instanceReady', function(ev) {
ev.editor.editable().addClass('cke_enable_context_menu')
});
You can find out which plugins require contextmenu
in your particular build of CKEditor using the following snippet in an F12 console window in your site (assumes you have jQuery also for $.each
):
$.each(CKEDITOR.plugins, function(k, v){
v.requires && console.log("Plugin '" + k + "' requires: " + v.requires)
})
For example:
Plugin 'tabletools' requires table,dialog,contextmenu
Which you can then use to help you with your config.removePlugins
- in my case:
config.removePlugins = 'tabletools,contextmenu'
Unfortunately since CKEditor 3.6/4.0 this does not work anymore.
See bug report: http://dev.ckeditor.com/ticket/9284
Hold down the ctrl button while right clicking to by-pass the context menu and access spell checker etc.