Oneboxed links to YouTube are non-functional

Some links get oneboxed here on Discourse - e.g., Formula (or function) to reverse a string? - #12 by mikekaganski. However, the inline content I refer to - a link to a YouTube content - is not usable - it gives to me: “This content is blocked. Contact the site owner to fix the issue.”

Is this something to be fixed on our infra side?

Another issue is that the link above to a specific comment in a collapsed comment thread does not automatically expand the thread, and so links to specific comments are ~useless.

OneBox has a special engine for YouTube where the domain is hardcoded discourse/youtube_onebox.rb at v2.8.0.beta4 · discourse/discourse · GitHub . 3rd-party resources to that domain aren’t explicitly allowed by our Privacy Policy, and are therefore blocked by our Content-Security-Policy (its technical embodiment).

One option is to patch OneBox to point to instead. But the simplest is to just disable OneBoxing for YouTube and other engines trying to use <iframe/>. After all those were simple links in AskBot, right?

Absolutely no problem in simple links; my point was just that if it pretends to do something new, it should be functional :slight_smile:

Sure. Not sure if we would have noticed during the test period, but Discourse recently switched their default to OneBox all domains so we have an excuse :wink:

Disabled OneBoxing engines that need <iframe/> now, and rebuilt the 5400 posts that used OneBox in the first place. You’ll note that the minature doesn’t show up right away — this is intentional, Discourse links it directly at first, but tries to download all resources locally (in the background) and rebuild the post with the local resources when this is done. Since we block 3rd-party resources, they won’t be available for the first few seconds/minutes. (It’ll probably take a bit longer now since I rebaked a lot of posts without spawning more background processes.) This is no different than trying to source an external image.