Static version doesn't work on Chrome #92

Open
RobertAudi opened this Issue May 31, 2011 · 6 comments

Comments

Projects
None yet
3 participants

If I do showoff serve, the presentation works fine, but if I generate the static site the presentation gets stuck on the first slide in Chrome (Mac OS X).

Contributor

badboy commented May 31, 2011

do you use syntax highlighted code in your presentation?
If so, this is a known problem. The syntax highlighting code per language is requested using Ajax and this is not possible on file:// urls.

I do use syntax highlighting but the presentation worked in Firefox for some reason.

Contributor

badboy commented May 31, 2011

Hm, weird. Did you tested with a custom presentation or using the example one?

I just did a presentation (obviously not the example one ;) ) yesterday in Firefox using a static showoff presentation.

Contributor

badboy commented Jun 2, 2011

I tested it using the example presentation.

Chromium still throws an XMLHttpRequest cannot load file:///.../static//js/sh_lang/sh_javascript.min.js. Cross origin requests are only supported for HTTP.
and it works fine in Firefox.

So there's still no real solution for this. Either don't make use of syntax highlighted code or change the Javascript to disable the syntax highlighting on file:// (static version) as mentioned in #63

I just ran into this issue on a static version of a showoff presentation hosted on github. After much hair-pulling and debugging, I found that the issue was with the bindings of the document.onkeyup and document.onkeydown events. I managed a quick fix by using jQuery to handle the events:

// setupPreso function in showoff.js around line 37

// original, broken in chrome
// document.onkeydown = keyDown
// document.onkeyup = keyUp

// fixes chrome
$(document).keydown(keyDown);
$(document).keyup(keyUp); 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment