Content Security Policy (CSP) restrictions
Security guidelines and coding restrictions enforced by the Content Security Policy (CSP) when developing custom code in HTML Canvas widgets and Ubidots Pages.
Content Security Policy (CSP) restrictions
1. Inline JavaScript is not executed
<button id="export-btn" onclick="exportData()">Export</button><!-- HTML tab -->
<button id="export-btn">Export</button>// JavaScript tab
document.getElementById('export-btn').addEventListener('click', exportData);
function exportData() {
// Same logic as before — no functional changes required
}2. Avoid dynamic code evaluation
3. Loading external scripts and libraries
4. Styles
Troubleshooting CSP issues

Symptom
Likely cause
Fix
Last updated
Was this helpful?