2

I wanted to do something very similar to a question that has already been answered here:

build a chrome extension in order to upload images (from clipboard)

but with a significant difference. In the problem above, the developer is taking a screenshot of the a tab via captureVisibleTab(), and uploading the data to a server via a chrome plugin.

What I'm looking for is a way to do the exact same thing except with the content of a single img tag on the visible tab, instead of the whole tab ... is this possible or can I only take a full screenshot?

Thanks in advance.

Community
  • 1
  • 1
sshukul
  • 23
  • 3

1 Answers1

0

If you have the path to the actual file:

var reader = new FileReader();

reader.onload = function (e) {
  var base64Data = e.target.result;
};

reader.readAsDataURL(imageFile);

Theoretically you could pull the file from the browser's tmp folder that downloaded that image.

GAgnew
  • 3,847
  • 3
  • 26
  • 28