Raised This Month: $51 Target: $400
 12% 

Interactive Map doesn't load in Google Chrome


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Pricetx
Junior Member
Join Date: Jan 2013
Old 06-26-2013 , 12:07   Interactive Map doesn't load in Google Chrome
Reply With Quote #1

Hi, I currently run the latest HLX:CE on my HL2:DM server, and the stats page for it can be found here: http://gravitygunonly.com/stats

For some reason, a few months ago the map stopped loading in Google Chrome, but continues to work fine in FireFox and Internet Explorer. I would be tempted to blame chrome for this, but it seems that everybody elses stats page maps work fine!

Does anybody have any ideas as to what might be causing this?

Thanks,

Pricetx
Pricetx is offline
Mr.Spoon
Junior Member
Join Date: Apr 2010
Old 06-26-2013 , 13:29   Re: Interactive Map doesn't load in Google Chrome
Reply With Quote #2

Using the Chrome Element inspector I see the following

Code:
[blocked] The page at https://gravitygunonly.com/stats/hlstats.php ran insecure content from http://maps.google.com/maps/api/js?sensor=false.  hlstats.php:1
[COLOR=red !important]Uncaught ReferenceError: google is not defined hlstats.php:241

I haven't looked into the hlstats.php yet.

Have you modified this file?

My Hlstats works fine in chrome...

Last edited by Mr.Spoon; 06-26-2013 at 13:31.
Mr.Spoon is offline
Rytis
Veteran Member
Join Date: Feb 2012
Location: Germany
Old 06-26-2013 , 14:20   Re: Interactive Map doesn't load in Google Chrome
Reply With Quote #3

Yeah, it looks like, that you or someone else modified your HLStatsX:CE installation
Rytis is offline
Pricetx
Junior Member
Join Date: Jan 2013
Old 06-26-2013 , 16:24   Re: Interactive Map doesn't load in Google Chrome
Reply With Quote #4

I've narrowed down the problem (a bit at least).

I tried replacing all of the web PHP files (except the settings one) with fresh copies, and this didn't fix it.

I then tried setting nginx to disable SSL and serve everything over plain HTTP, and since I did this, it is now working again.

Does anybody know what might be causing the map to fail to render in chrome when ssl is enabled?

Thanks,

Pricetx

EDIT: Looks like it could be in some way relating to this? http://stackoverflow.com/questions/1...-https-to-http

Last edited by Pricetx; 06-26-2013 at 16:28.
Pricetx is offline
Rytis
Veteran Member
Join Date: Feb 2012
Location: Germany
Old 06-26-2013 , 16:31   Re: Interactive Map doesn't load in Google Chrome
Reply With Quote #5

Yeah, nginx is not compatible with https connections atm
Rytis is offline
Pricetx
Junior Member
Join Date: Jan 2013
Old 06-26-2013 , 16:40   Re: Interactive Map doesn't load in Google Chrome
Reply With Quote #6

Fixed!

The problem was indeed that the google maps API was trying to work over plain HTTP, which was being blocked by chrome due to security reasons (it doesn't allow remote connections over HTTP if the pages is being served over HTTPS).

the fix was in includes/google_maps.php line 45.

The line originally read:
Code:
echo ('<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>');
However, if you change it to:
Code:
echo ('<script src="//maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>');
it will use HTTPS if it is available, otherwise falling back to plain HTTP.

Unless anybody sees any downsides to this, it would be good if this changed was merged into HLStatsX, as it would allow others to use it over SSL.

The only issue I can think of is that google_maps.php is an include file, which means that it's probably sourced from upstream somewhere. If it was decided that include files shouldn't be edited then it would at least be useful if an FAQ point was added mentioning "Do I need to configure anything additional to use HTTPS?".

If anybody has any further questions, feel free to let me know.

Thanks,

Pricetx
Pricetx is offline
Rytis
Veteran Member
Join Date: Feb 2012
Location: Germany
Old 06-26-2013 , 16:59   Re: Interactive Map doesn't load in Google Chrome
Reply With Quote #7

There is also somewhere else a link that begins with http://.., but I forgot in which file
Rytis is offline
sil_El_mot
Member
Join Date: Jan 2015
Old 02-25-2015 , 16:33   Re: Interactive Map doesn't load in Google Chrome
Reply With Quote #8

ah. thank you a lot. i had the same problem and your fix works like a charm!
sil_El_mot is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:12.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode