I’m looking for a way to open an URL in a new tab to show some docs related to a certain command. Is there a way to perform such action via plugin’s backend script without spawning a hidden UI with iframe and all?
No, it can only be done with a UI.
Hey @Gleb !
I’m new to this figma plugins
thing, I bet you know the place where to submit feature requests related to plugins and the dev program. It’s such a pity there is no way to perform such a useful action without messing with the UI part of the thing. 🙃
You can submit requests right on the forum in the #plugin-api:feedback category.
However, if you need the UI to just perform this action, it should be pretty easy, not much messing around:
const url = 'http://example.com'
const openLinkUIString = `<script>window.open('${url}','_blank');</script>`
figma.showUI(openLinkUIString, { visible: false })
setTimeout(figma.closePlugin, 1000)
Wow! Works like a charm! 👏 👏 👏
I thought it requires a lot more labor in order to do it. Thank you very much for the code snippet! 🙏
Hey @Gleb
I was trying to open a url in the figma plugin itself using showUI and iframe but it shows 403 error. The link is opening in my browser window properly
figma.showUI( <iframe width="100%" height="100%" src="https://api.x.xxx.com/v1/oauth/google"></iframe>
,
{ width: 750, height: 500, title:“Login to DevBud”}
);
Its for a google authentication process. That link is not the exact url but looks like it.
It feels like either CORS error or whitelisted domain error. Can you tell what it is and a workaround for it
Search for oauth in the API docs or forum, this isn’t as simple as that.
What could be the issue, I have been going through the doc… no luck
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.