Search code examples
menutinymcewysiwyg

Contextual inline menu doesn't appear on some inserted images


The contextual inline menu appears on inserted images with the same domain name. It doesn't appear on outside images.

For instance: http://fiddle.tinymce.com/k5faab/35 you will notice that I added imagetools_toolbar: "openlink link unlink", to the tinymce.init. Try to insert an image ( https://www.paintthemoon.org/wp-content/uploads/2015/02/250x250.gif ) you will notice that the contextual menu is missing.

I am using TinyMCE 4.7. The issue is present on all browsers.


Solution

  • What you are seeing is expected behavior due to how CORS works in the browser. You can create an image proxy to address this as documented here:

    https://www.tiny.cloud/docs/plugins/imagetools/#imagetools_proxy

    Another alternative is to build your own method to fetch the image:

    https://www.tiny.cloud/docs/plugins/imagetools/#imagetools_fetch_image

    ...but note that you still have to abide by CORS restrictions so the image proxy may be the more robust solution.