Skip to main content
Solved

Is there any methods to control iframe?


_Rycont

I’m making figma embedded page, and i need to viewing frame of control embedded iframe figma file. I tried to control iframe with frame.contentWindow, but it’s blocked cause of iframe cross-origin policy. Is there any way to control viewing frame programmatically?

Best answer by Gleb

No. Figma has no APIs for this.

View original
This topic has been closed for replies.

5 replies

Gleb
  • Power Member
  • 4708 replies
  • July 27, 2022

Is there any way to control viewing frame programmatically?

No, because of iframe cross-origin policy. That’s a security feature. What do you want to control?


_Rycont
  • Author
  • 2 replies
  • July 27, 2022

All i want is just navigating the forward / backward, like pressing left / right arrow.


Gleb
  • Power Member
  • 4708 replies
  • July 27, 2022

If that’s a prototype, you simply need to click on the iframe and you should get these controls. They are native to Figma prototypes.


_Rycont
  • Author
  • 2 replies
  • July 27, 2022

Thank’s for your advise. But the project that i gonna make is side by side web page. There’s a text article in the left side, and the figma prototype is in the right side. If user scrolls down the article content, then the figma prototype is automatically navigated to next page, linked to the article scrolling. To make this, I need to control the prototype’s navigation programmatically, without user’s direct input into the iframe. Would it possible?

(I’ve found that frame.contentWindow.postMessage API is eligible for these types of work, but i couldn’t discover what postMessage spec figma embed receives.)


Gleb
  • Power Member
  • 4708 replies
  • Answer
  • July 27, 2022

No. Figma has no APIs for this.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings