I want to make a Chrome addon, which displays ones Facebook picture. Mine e.g. is this one.
I do get the final Url and the response of an XMLHttpRequest.
In response.response
I have the image data, which starts with ����JFIF���Photoshop 3.08BIM�gO87swNzt0qHGr_stQXIz(bFBMD01000aa00100001d020000b6020000ec02000027030
I am trying to store and than display it. (I want to display this bigger on a different place as well). So I do not want to use path
in chrome.browserAction.setIcon
, but the Image itself.
I tried a lot of things (and will continue tomorrow). So far:
- I need an
ImageData
Object - I need an
ImageData
Object smaller than <= 19 pixels. - I do know the size of the image from facebook (50x50)
Tomorrow I will continue with trying this. I forgot, that the Image is not base64 encoded yet, so the solution linked in this sentence was not able to work...
My problem is: How to create the ImageData
-Object(s) required by chrome.browserAction.setIcon
frim the icon above in JS. Using the "html5-canvas" tag, as ImageData is very close to a canvas.
As always, answers are highly appreciated.
Yours,
Florian