ElkArte Community

Project Support => General ElkArte discussions => Topic started by: Adrek on August 31, 2014, 02:44:58 pm

Title: Can't load font from subdomain on homepage?
Post by: Adrek on August 31, 2014, 02:44:58 pm
As homepage I'm using SimplePortal standalone mode. On this homepage menus are missing icons (for dropdowns).
Chrome shows me this error:
Code: [Select]
Font from origin 'http://forum.elkarte.pl' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://elkarte.pl' is therefore not allowed access. 

This is issue with SP or Elk? How can be solved?

Don't know if SSI page will have the same issue, because menu added with ssi_menubar(); is missing CSS, don't know why ::)
Title: Re: Can't load font from subdomain on homepage?
Post by: emanuele on August 31, 2014, 03:15:08 pm
Try going in admin > configuration > security > general
And set the "Frame Security Options" to "Allow Same Origin".
Title: Re: Can't load font from subdomain on homepage?
Post by: Adrek on August 31, 2014, 03:22:28 pm
I have this set up like this from the beginning
Title: Re: Can't load font from subdomain on homepage?
Post by: Spuds on August 31, 2014, 03:28:14 pm
Try disabled then?
Title: Re: Can't load font from subdomain on homepage?
Post by: emanuele on August 31, 2014, 03:44:54 pm
Ahh.... sorry, I didn't realize I was looking at SP standalone.

Yes, apparently the standalone file needs a call to frameOptionsHeader and probably securityOptionsHeader.

@Spuds that's for ya! :P
/me has to update its SP repo...

Set the headers should be something "delayed" (i.e. add everything to an array and sent all of them at once), it may be one of the things to do in 1.1.
Title: Re: Can't load font from subdomain on homepage?
Post by: Adrek on August 31, 2014, 04:14:33 pm
I tried every option - no success.
Title: Re: Can't load font from subdomain on homepage?
Post by: emanuele on August 31, 2014, 04:41:12 pm
Sorry, I was wrong, actually those two functions are needed in SSI.php I think...
Title: Re: Can't load font from subdomain on homepage?
Post by: Spuds on August 31, 2014, 07:45:57 pm
So an SSI bug ?
Title: Re: Can't load font from subdomain on homepage?
Post by: emanuele on September 01, 2014, 09:26:03 am
It should be verified.

@phantom could you try adding frameOptionsHeader and securityOptionsHeader to SSI... I'd say somewhere around here (https://github.com/elkarte/Elkarte/blob/master/SSI.php#L184)? Thanks!
Title: Re: Can't load font from subdomain on homepage?
Post by: Adrek on September 01, 2014, 11:39:09 am
still no luck :|
Title: Re: Can't load font from subdomain on homepage?
Post by: emanuele on September 01, 2014, 02:26:20 pm
Okay, I did a quick search on google and found:
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/sU138vJ_PI0
apparently it's something to set on the font header.

Again a quick google search I found:
http://enable-cors.org/server_apache.html
Title: Re: Can't load font from subdomain on homepage?
Post by: Adrek on September 01, 2014, 02:57:03 pm
Yay! It works :D

I found earlier that second page, but tried only php/HTML code (http://enable-cors.org/server_php.html ), now I added one line in .htaccess and it works great :)
Title: Re: Can't load font from subdomain on homepage?
Post by: emanuele on September 01, 2014, 04:19:26 pm
Cool!