I am using SF Canvas to embed an external Web Application in a VisualForce page in my org. The content is being successfully loaded in an IFrame in the browser. The page needs access to the USB feature (FeaturePolicy usb) which is set by the external server as header. Inside the IFrame, the feature is disabled. Is there a way to set it for the frame by setting an HTML Attribute like this:

<iframe allow="usb *">

Or maybe another way to solve the issue?


The purpose of iframe is to create a sandbox with restrictions.


When the sandbox attribute is present, and it will: (...) disable APIs

Try this approach: create a Lightning Component with API-Version 39 to disable Lightning Locker. I have tested this successfully with USB feature in Chrome browser.


Disable Lightning Locker for an Aura component by setting the Salesforce API version to 39.0 or lower for the component. If a component is set to at least API version 40.0, Lightning Locker is enabled.

Inside the Lightning Component, you can use force:canvasApp.


A force:canvasApp component represents a canvas app that's embedded in your Lightning component. You can create a web app in the language of your choice and expose it in Salesforce as a canvas app.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.