devtool icon indicating copy to clipboard operation
devtool copied to clipboard

Loading Images from relative path

Open mattdesl opened this issue 9 years ago • 4 comments

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 avatar Feb 05 '16 18:02 mattdesl

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

mattdesl avatar Feb 11 '16 16:02 mattdesl

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.

mattdesl avatar Feb 11 '16 17:02 mattdesl

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

NekR avatar Feb 28 '16 11:02 NekR

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.

mattdesl avatar Mar 06 '16 19:03 mattdesl