Chouser/tractionsvg — Issue #1: Mime-type handling
Author: semperos
Created: 2011-12-29 22:38:58+00:00
State: open

To start off, thanks for contributing what looks to be an awesome library for making presentations.

I've tried to take your example app for a spin (using the instructions in the README to create a presentation called `mypres`), and have hit a snag. I'm running:

* Mac OSX Lion
* lighttpd/1.4.28 (ssl) (installed via Homebrew)
* Chrome 16.0.912.63

My first snag was the `include_shell` declaration at the top of `lighttpd.conf`. That Perl file does not exist in my installation, but even after finding a copy and adding it, the mime-type was still not set correctly (when going to `http://localhost:8080/mypres.svg`, the file was simply downloaded). After a little searching, I added this to my `lighttpd.conf` and at least got the page to load:

```
mimetype.assign = (
".svg" => "image/svg+xml"
)
```

However with this, I get some JavaScript errors in an alert box that look like this:

```
TypeError: Cannot call method 'getElementsByTagName' of undefined
TypeError: Cannot call method 'getElementsByTagName' of undefined
at Pf (http://localhost:8888/traction-0.0.1.js:141:37)
at Rf (http://localhost:8888/traction-0.0.1.js:142:54)
at qa. (http://localhost:8888/traction-0.0.1.js:151:318)
at mb.handleEvent (http://localhost:8888/traction-0.0.1.js:13:720)
at Vb (http://localhost:8888/traction-0.0.1.js:23:26)
at Ub (http://localhost:8888/traction-0.0.1.js:22:387)
at qa. (http://localhost:8888/traction-0.0.1.js:27:6)
at qa.dispatchEvent (http://localhost:8888/traction-0.0.1.js:39:219)
at Qc (http://localhost:8888/traction-0.0.1.js:42:479)
at qa.jb (http://localhost:8888/traction-0.0.1.js:41:81)
```

...and I get the following my Chrome console:

```
Error in event handler for 'undefined': TypeError: Cannot call method 'removeEventListener' of null (extensions/event.js:181)
at bindShortcuts (chrome-extension://alelhddbbhepgpmgidjdcjakblofbmce/javascripts/content_script.js:418:7)
at chrome-extension://alelhddbbhepgpmgidjdcjakblofbmce/javascripts/content_script.js:21:4
at [object Object].dispatch (extensions/event.js:179:28)
at extensions/renderer_extension_bindings.js:99:24
at [object Object].dispatch (extensions/event.js:179:28)
at Object. (extensions/renderer_extension_bindings.js:164:22)
at qa. (http://localhost:8888/traction-0.0.1.js:151:461)
at mb.handleEvent (http://localhost:8888/traction-0.0.1.js:13:720)
at Vb (http://localhost:8888/traction-0.0.1.js:23:26)
at Ub (http://localhost:8888/traction-0.0.1.js:22:387)
chrome.Event.dispatch

(12 times) event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future. (extensions/event.js:181)
```

Looking forward to using traction going forward; thanks for the contribution.