Unanswered
SDK iFrames and CORS
Good morning,
I am working to integrate a screen sharing service into Q2 OLB. I'm using UUXPayload to load the JS needed to integrate screen sharing site wide. While testing this integration, the agent is unable to see any extension that is created using the SDK because it is an iFrame. The agent gets an error that Cross-origin policy excludes this page from the co-browsing session.
To attempt to allow co-browsing on these pages, I need to enable co-browsing from specific origins. Below is the list of origins I've attempted to whitelist, but none have worked. I've tried looking for the src of the iFrame but do not see one. Am I missing something or is this a security policy baked into Q2 OLB?
<script>
const loadModuleAndEnableCobrowsing = async () => {
try {
// Dynamically import the module
const module = await import('https://auvious.video/widget/dist/auvious/cobrowser/core/index.js');
// Call enableCobrowsing from the imported module
module.enableCobrowsing({
allowOrigins: ["https://stack.q2developer.com", "https://local-dev-api.q2developer.com", "https://sdk-stg.onlineaccess1.com", "https://secure.avadiancu.com/"]
});
} catch (error) {
console.error('Failed to load the module:', error);
}
};
loadModuleAndEnableCobrowsing();
function start() {
const pin = document.getElementById("pin").value;
if (pin) {
const widget = window.parent.document.querySelector("app-auvious-widget");
widget.launch("cobrowse", pin);
dismiss();
}
}
</script>
133 Views
0
Answers
2 years ago
2 years ago
Similar posts
Hello Bradley,
We have run into this before with other developers, and it seems that this is solved by injecting a script into the iframes. We have a configuration in our DB that allows for us to do this; we set the config up and then UUX takes that config and injects the script using the "global_scripts" configuration. It is possilbe to do just that in your sandbox if you want to.
The best way for me to answer your question is for you to enter a ticket in the developer portal. We can provide you with the necessary SQL to inject the script in your sandbox.
— Dan Cox 2 years ago