Bug 12239

Summary: Errors loading script under https in chrome
Product: Koha Reporter: Martin Renvoize (ashimema) <martin.renvoize>
Component: OPACAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: magnus, mtompset
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Martin Renvoize (ashimema) 2014-05-13 09:37:53 UTC
Chrome seems to be more strict when it comes to loading scripts than other browsers. It seems we're sending /opac-tmpl/bootstrap/lib/enquire.min.js and /opac-tmpl/bootstrap/js/script.js with a MIME type of text/plain when we should be sending it with type application/javascript.

This causes warnings when running under https and the following error message to appear in the console: 'Resource interpreted as script but transferred with MIME type text/plain.'

This relevant code is inside a modernizr block so I'm not sure how to proceed with a fix.
Comment 1 Mark Tompsett 2014-05-13 10:45:15 UTC
Not that this is the best solution, but perhaps adding:
    AddType text/javascript .js
in the appropriate apache configuration files would work?
(http://stackoverflow.com/questions/3467404/chrome-says-resource-interpreted-as-script-but-transferred-with-mime-type-text)
I haven't tried it.
Comment 2 Magnus Enger 2014-05-15 07:05:06 UTC
I could recreate the error messages in the Chromium console on my local dev install, which is not using https. No sign of any warnings in Firefox, though.
Comment 3 Owen Leonard 2016-02-02 19:03:01 UTC
Is this bug still valid? I don't see any errors when I look at our OPAC in Chrome.