Experience-Monks / devtool

[OBSOLETE] runs Node.js programs through Chromium DevTools
MIT License
3.76k stars 148 forks source link

Loading Images from relative path #37

Open mattdesl opened 8 years ago

mattdesl commented 8 years ago

Trying this:

var img = new Image()
img.src = 'foo/bar.png'

Seems to error out since it's trying to load from file:// instead of http:// protocol. Will explore further.

mattdesl commented 8 years ago

Tracking upstream: https://github.com/atom/electron/issues/4444

mattdesl commented 8 years ago

Ok, this is fixed in 1.8.2.

If there is another fix to electron#4444 then maybe we could have better error codes and overall cleaner handling for resources that aren't the main index.html.

NekR commented 8 years ago

What about script.src = 'script.js' loading script from directory where devtool was run, not from devtool's directory itself?

mattdesl commented 8 years ago

Thanks @NekR, it seems like a related bug. Still struggling to find a clean solve, you can see some suggestions and their issues in electron#4444.