Skip to main content

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.

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.