0

is it possible to load an image locally on the google chrome console? I tried but it obviously doesn't work ??

<img src="img/photo.jpg" alt="picture" width="300" height="300">

Do have you an idea please?

  • It is possible, but you have to make sure the path is correct. In this case, if your html file sits in `/foo` folder, browser will attempt to load the image from `/foo/img/photo.jpg` path - unless `` element has overridden the base path. – raina77ow Jun 29 '21 at 18:11
  • In this case your image will be displayed only if img and your html file are in same folder otherwise add full address of image. – Suryansh Singh Jun 29 '21 at 18:14
  • I want to add an image via google chrome console, the site is not mine. I don't have the source code –  Jun 29 '21 at 18:16
  • You cannot reference a local file from the HTML of a file served from a different domain. That would open all kinds of security holes. – Heretic Monkey Jun 29 '21 at 18:31

2 Answers2

0

As much I know, you can't because the website is fetching the from the server, not from your local drive. If you try to open the image file you will get domain.extention/path/image-name

So I think you can't do it

spatd
  • 17
  • 1
  • 10
-1

You need put your code in html.file to see the image, in browser you just can see the DOM https://www.w3schools.com/js/js_htmldom.asp

Tom Taylor
  • 3,344
  • 2
  • 38
  • 63
Guilhax
  • 13
  • 4