[SOLVED] Links don't work

Hello, I created an extension with a link to another Twitch page but it is not clickable.
Do I have to do some additional actions to make a link work in extension?

Solved, how?

The viewer is in an iframe and it seems browser security is blocking links.

How would you add a link to the PubSub auth page from the viewer iframe?

I didn’t have much luck with an anchor tag. I have to right-click and say open tab for the link to open.

image

When I try:

window.open('redirect.html', '_blank', 'height=200,width=200');

I get the error:

I’m just trying to link from the extension viewer to the pubsub auth page on a backend service.
https://github.com/twitchdev/pubsub-samples/blob/master/javascript/index.html

Make sure you are adding the backend service URL(s) to the “Whitelisted Panel Urls” section of the extension settings. Simple anchor links work for me if I whitelist the URL.

1 Like

Hot dang! That worked like a charm! Thanks!

That worked for both cases of anchor links and javascript window.open.

You can’t/shouldn’t, the viewer iframe is not allowed to open links, unless it’s directly related to the extension so much it’s required. Amazon extension allows this coz it’s linking to products. But I got denied for linking to $myStreamers FakeCurrency store.

You can from the dashboard/config iframe’s however

Extensions may not request or require OAuth permissions from extension viewers.

In my case the link is only for extension broadcaster.

Right now I have the webpage doing broadcasting to the PubSub. But it only works if the window has focus. I plan on moving the broadcasting to PubSub into the backend service.

That way the broadcaster won’t need to keep the webpage in focus in order to broadcast.

The link is only to authorize the backend service.

In the end, opening a page to do auth on the viewer wasn’t needed. I did use the viewer auth callback to pass the auth.token (JTWT) to the backend service.

Solved: [SOLVED] Backend Service: Broadcast to PubSub from Backend using Auth.Token JWT