Beyond20
Beyond20 copied to clipboard
Support Roll20 as a Discord Activity
Hey there!
Roll20 is coming to Discord as an Activity. As part of that we are taking a look at popular extensions that Roll20 users install and seeing what needs to be done to support the Activity version. In particular, it doesn't seem possible to use the messaging feature to send messages between tabs since the Activity runs as a nested iFrame in a different domain from the parent tab (this is a Discord security feature and applies to all Activities).
Therefore, I put together this quick PR that adds support for using a content port to communicate with the Discord Activity version. It only uses this method if the extension detects that it's running in an Activity, otherwise it uses the current message passing method.
The one drawback to this is the "filter to a specific tab" feature really isn't supported for the Activity (if you pick a specific tab it just won't work), but I think that's an acceptable tradeoff to get this working.
Let me know if this makes sense or if I can help work on a different approach that would work well for the extension. And thanks for providing this resource to the tabletop gaming community!