Transmogrify-for-Plex / Transmogrify-for-Plex-chrome

A Chrome extension that adds several features to the Plex/Web 2.0 client for Plex
https://chrome.google.com/webstore/detail/transmogrify-for-plex/jdogfefgaagaledbkgeffgbjlaaplpgo
GNU General Public License v3.0
70 stars 31 forks source link

Bug fix for non-https connections blowing up extension at startup #27

Open sstrang opened 8 years ago

sstrang commented 8 years ago

I'm not sure why, but for some people (myself included), some non-https connections are getting returned from either the call to resources or servers. The actions subsequently performed with the non-https connection are causing the extension to blow up and not finish loading.

I'm not much of a JS developer, so I don't know if this is the best way to fix this, but it has solved the problem for me.

pdille commented 8 years ago

Interesting. I thought I tested non https connections, since this is what became a huge problem for this extension once Plex updated in favor of using https.

Anyway, your code essentially just skips that one iteration of the for loop if it comes across https. But clearly it iterates again to populate 'server_addresses' or nothing would work. I'd be curious what errors were throw before you added that segment of code. Could you post that? Also, how exactly are you accessing Plex? What exact URL? And what https setting do you have set on the Plex server? (Preferred, Required, Disabled?)

sstrang commented 8 years ago

This is the error I get in my JS console when the extension tries to run (with some stuff redacted):


Mixed Content: The page at  'https://app.plex.tv/web/app#!/server/<ahash>/section/1' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://192.168.2.232:32500/?X-Plex-Token=<atoken>'. This request has been blocked; the content must be served over HTTPS.

utils.getXMLWithTimeout @ utils.js:244

I get the error when I hit https://app.plex.tv/web/app# In my server settings, my HTTPS setting is set to preferred.

The IP referenced in the error message is that of my iPhone - I'm running the iOS Plex app 4.0.10 on it, if that helps.

pdille commented 8 years ago

Interesting. So your "server" in this situation is your iPhone?

sstrang commented 8 years ago

Transmogrify seems to be treating it as such, I guess, but it's definitely not an actual server.

pdille commented 8 years ago

Ah, so you have multiple devices which Plex knows about and could potentially stream content from. This is something I did not actually test. Good to know. I'll test out this situation more.

So question then. When you are browsing Plex in your browser, you have the option I believe to choose a "server" from the top left. Is your iPhone listed? And if so, does transmogrify do anything for the content listed there? Assuming of course you have anything streamable on your phone.

Thanks again for the prompt responses, btw.

pdille commented 8 years ago

And I just reproduced this with my Nexus 7 tablet. I'll get to the bottom of this. Thanks!

sstrang commented 8 years ago

In the Plex Web UI, my iPhone does not appear in the server dropdown.

sstrang commented 8 years ago

Great, thanks for looking into it! Hopefully you can come up with a better fix than my ghetto approach :)

pdille commented 8 years ago

No problem. Thanks again for reporting. The key to all this was your initial comment that the IP was for your phone. Now I have a better understanding of what's going on. :)

Also, I saw that you're adding some features (and have planned ones) in your own fork. Moussa doesn't have the time these days to work on this and I only plan to pitch in to fix bugs and make sure it continues to work with future Plex updates. Anyway, if you have features you wish to add then I'm sure we'd love to have you aboard. Not the right thread to discuss this, but something to think about.

OmgImAlexis commented 8 years ago

@Moussa any chance this will be fixed soon? I basically can't use your extension because of it.

OmgImAlexis commented 7 years ago

@Moussa I've sent you a message on the Plex forums, hopefully you see it as this really needs to be merged.