We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

How to communicate between v3d iframe and other HTML pages?

Home Forums General Questions How to communicate between v3d iframe and other HTML pages?

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #69824
    Lee
    Customer

    Hi, When I embed a v3d code in my webflow project and try to host them on our own hosting server (with HTML, CSS, Javascript exported), it throws me an error saying
    DOMException: Failed to read a named property ‘document’ from ‘Window’: Blocked a frame with origin “https://cdn.soft8soft.com” from accessing a cross-origin frame.”

    This seems happens because I am not hosting custom html and javascript files on the verge3d network, but on my own hosting server (like ecommerce platform like shopify), it gives me Same-Origin Policy error. Accrording to Stackoverflow, they suggested a workaround this issue by using window.postMessage and window.eventlistener to avoid this iframe-cross domain access issues.

    https://stackoverflow.com/questions/25098021/securityerror-blocked-a-frame-with-origin-from-accessing-a-cross-origin-frame

    I assume that verge3d’s wordpress plugin encapsulated this approach already in the plugin source code to allow them to be hosted on custom hosting server.

    Do we have any guide or step by step approach how to add this workaround in our both sides (one for main page, the other for in the iframe)? Or any other suggestion here?

    For your reference, another web-based 3d configurator service called Vectary provides this ModelAPI so that users can easily make them communicate without barrier by adding this code “listenToChangesFromModel(); listenToChangesFromUI();0”

    https://help.vectary.com/custom-code

    Thanks for your help and techniques in advance.

    Attachments:
    You must be logged in to view attached files.
    #69826
    kdv
    Participant

    Blocked a frame with origin “https://cdn.soft8soft.com” from accessing a cross-origin frame.

    Why are you loading the app’s files from soft8soft.com? Can’t you upload them to your server? It will solve your problem.

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #69834
    Lee
    Customer

    Thank you Kdv for the quick answers!
    Let me try as you suggested.

    Just one clarification by the way. My FTP server doesn’t support file type like .blender and .gltf but only support like html, css, and javascript..

    Would it still work when we upload app’s files without those files?

    #69835
    kdv
    Participant

    Without .blend files – yes (they are not needed at all when running WebGL apps), without .gltf/.bin – NO.

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.