Skip to content

evalScript implementation for new CORS policy in Adobe apps regardless of context or iframe depth

Notifications You must be signed in to change notification settings

battleaxedotco/workaround

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

workaround

evalScript implementation to bypass CORS restrictions on new Adobe applications for use in <iframe> elements and bombino templates.

# Installation
npm i workaround
// Usage:
import { evalScript } from "workaround";

// Within async/await
let result = await evalScript(`
  (
    function() {
      alert("Hello world");
      return true;
    }();
  )
`);
console.log(result); // Returns true, regardless of location or iframe depth

Notes

  • This is not a standalone package, and relies on a window.addEventListener("message", callback) on the topmost window of the document to function properly. If you're using any bombino template, this is already taken care of. To see the implementation necessary on the topmost window, view any ./public/index-dev.html file of any bombino template (specifically the <script> tag containing window.addEventListener and callback).

About

evalScript implementation for new CORS policy in Adobe apps regardless of context or iframe depth

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published