Bug 12239 - Errors loading script under https in chrome
Summary: Errors loading script under https in chrome
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-13 09:37 UTC by Martin Renvoize
Modified: 2016-12-05 21:22 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize 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.