I am not so certain this is even the right approach. Essentially, I would like to control some WiFi lights (Milight/LimitlessLED brand) so that I can fade out and fade in lights when videos are played on YouTube, Netflix, and other similar services.

The only way to communicate with the lights is by sending UDP messages, and it seems the only way I can access a UDP socket in chrome is either through a chrome app, or a native app.

Native apps seem better, as I can bundle them along with an extension while I don't seem to be able to do that with a chrome app. But in the examples I've seen in documentation, a portable native app (PNaCl), is embedded into a page using <embed> .

Well, a content script can create an tag, but then how could I load the native app without violating the same origin policy? Or would there be a better solution to what I'm trying to do?