Disable CloudCannon window global in the Visual Editor

Last modified: November 22nd, 2023

CloudCannon injects an object onto the window object when viewed in the Visual Editor. This article will show how to turn off this behaviour. This is helpful if you are using another global variable called CloudCannon.

To turn this off, we need to capture the cloudcannon:load event and call the disableGlobalInstall function.

copied
document.addEventListener('cloudcannon:load', function (e) {
  const { CloudCannon } = e.details;
  CloudCannon.disableGlobalInstall();
});

Related Articles

Open in a new tab