PPCG-Design icon indicating copy to clipboard operation
PPCG-Design copied to clipboard

Non-https TIO links trigger mixed-content warnings and display empty results element

Open ephphatha opened this issue 7 years ago • 2 comments

The regex looking for the protocol/host part of TIO links (around line 773 in function breakoutTIOLinks()) picks up http and https links then performs an XMLHttpRequest with the URL using whatever the protocol was. Now that PPCG is using HTTPS older HTTP links get blocked due to the browser mixed-content policy.

This case does not get handled as an error/exception so the code that appends the response runs and creates the results element with an invalid/shared id and no content. Rewriting the protocol to use HTTPS would probably be easier, otherwise I'd expect the script to handle that case as an error and not append the results element.

I saw that #73 is still open but figured it was worth making a new issue for this since it's a different error, I can move this to a comment on that issue if preferred.

ephphatha avatar May 31 '17 11:05 ephphatha

No repro. (OS X with safari, firefox, chrome, vivaldi)

RikerW avatar Mar 02 '18 01:03 RikerW

For reference the following page triggers mixed content warnings in Chrome 64.0.3282.186 on Windows 10 on at least 10 answers - https://codegolf.stackexchange.com/questions/102370/add-a-language-to-a-polyglot?answertab=oldest#tab-top

Answer 4 is the first http tryitonline.net link.

Given tryitonline.net 301's to tio.run the link parsing needs to be updated anyway so this is probably not worth addressing on its own.

ephphatha avatar Mar 02 '18 14:03 ephphatha