H5P crashing browser when download link clicked

Hi 

I have created a Drupal 7 site and successfully installed the H5P modules. Most every thing works well. However, when I click on the download link on any content I created it crashes the browser. Using Chrome on a Mac. Please see attached pic.

Tom

BV52's picture

Hi Tom,

I was able to reproduce the problem both on Chrome and Safari (works in Firefox). I filed a report on this, you can follow it here. I also attached a screenshot of what I am seeing on my end. Please confirm if this is the same scenario that you have. If not please re-attach your screenshot.

-BV52

Hi BVV52:

Yes, I can confirm that is the same that I have. Thanks for the help.

Tom

papi Jo's picture

I have the same problem. Looking forward to a fix.

BV52's picture

I have updated the ticket to include your report.

-BV52

falcon's picture

H5P.org is a Drupal 7 site. Do you experience the same problem here with the latest version of Chrome? (I don't)

papi Jo's picture

works fine on H5P.org

crashes with following settings:

Chrome Version 65.0.3325.181 (Build officiel) (64 bits) 

drupal 7.58

H5P 7.x-1.34

on both local host and online site

 

BV52's picture

Hi papi Jo,

Thank you I've added these information to the ticket.

-BV52

falcon's picture

Is it possible for you to provide a link to the online site where it fails?

otacke's picture

Hey guys!

Sorry for not kicking in earlier: Are you sure that your servers are set up properly? H5P is not crashing, but your servers seem to be sending the wrong MIME type, so the browser displays the H5P file (which is a ZIP file but will not necessarily be detected as such) in the browser.

You should be able to get rid of the problem by setting an appropriate MIME type on your servers (e.g. for Apache in mime.types). Adding

application/x-h5p h5p

to the list of MIME types should do the trick. If you want to be really ;-) sure, you could also add/update

application/zip zip h5p
application/x-zip-compressed h5p
papi Jo's picture

Hi Oliver!

Your solution does not explain why the download goes OK on the other browsers but fails on Google Chrome. Anyway, I added the mime types you suggest to my local machine apache mime.types file and the H5P Download works OK now for Google Chrome. However I do not have an access to my web provider's apache mime.type options, of course, so back to square one!

otacke's picture

That's because browsers do not come with the exact same set of MIME type definitions, and they may handle "unknown" types sent by servers differently.

You can also set MIME types in .htaccess files.

papi Jo's picture

Thanks Oliver,

Putting : AddType application/x-h5p h5p in an .htaccess file at the root of my online server web folder did the trick! Thanks again for your help.

otacke's picture

You're welcome!

Worked for me as well!

Sounds like advice we should have in a convenient location. Almost qualifies as FAQ material. Especially since keywords aren't easy to figure out.

Was preparing for a presentation about offline H5P (and PressBooks) and this issue really tripped me until I stumbled upon Oliver's reply in another thread