Figma Support Forum

Is there a way to open an URL via plugin command?

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. :upside_down_face:

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)
1 Like

Wow! Works like a charm! :clap: :clap: :clap:

I thought it requires a lot more labor in order to do it. Thank you very much for the code snippet! :pray: