Disable CloudCannon window global in the Visual Editor

Last modified: November 22nd, 2023

Working with a specific static site generator?
Customize CloudCannon's documentation to suit your SSG.

Great! We'll show you documentation relevant to .
You can change this any time using the dropdown in the navigation bar.

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