Skip to main content
Question

Plugin : Non Null Origin iFrame

  • April 17, 2025
  • 1 reply
  • 26 views

DanDoesDesign

Hey there, I’m looking for help setting up the UI for a Figma plugin.

I am using a non-null origin, and testing the code using “https://www.google.com”

 

figma.showUI(
  `<script>
    window.location.href = "https://www.google.com";
    console.log(window.origin); //null
  </script>`,
  { height: 600, width: 400 }
);

 

I’ve included google in the manifest as an allowed domain.

 

  "networkAccess": {
    "allowedDomains": ["https://www.google.com",
      "https://*.google.com"
    ],
    "reasoning" : "For testing purposes",
    "devAllowedDomains": [
      "https://wwww.google.com",
    "https://*.google.com"
  ]
  }

All I see in the plugin window is a white box. The console isn’t throwing any syntax or permission errors.

Does anyone have a suggested fix? Is there something “basic” that I’m missing? (like, not testing showUI with google)

Thank you for your time.

1 reply

reynaldi
  • New Member
  • 1 reply
  • April 24, 2025

Your snippet for loading a non-null origin is already correct, by using the window.location.href. However, it’s Google that is preventing you from loading it in an iframe.

Google is using the `X-Frame-Options: SAMEORIGIN` header, which means it can only be loaded inside an iframe in a same origin (meaning only google.com can load an iframe of google.com).

Just try it immediately using your actual UI, and you should be good.


Reply


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