Closed jonasob closed 10 years ago
If we can't immediately get this to work, it'd be good to at least have a different error message, something like a "Due to security reasons, we can't retrieve this image: click here to report this error", with the latter going to the doorbell.io (mentioned in a separate issue).
The user can also be instructed to just do "view image" and then retry.
There might even be a button for it.
On 2014-10-07 12:20, Jonas Öberg wrote:
If we can't immediately get this to work, it'd be good to at least have a different error message, something like a "Due to security reasons, we can't retrieve this image: click here to report this error", with the latter going to the doorbell.io (mentioned in a separate issue).
— Reply to this email directly or view it on GitHub https://github.com/commonsmachinery/elogio.browser/issues/16#issuecomment-58164127.
10:50 <goodoldshep> jonaso: the plugin can even detect the CORS situation and ask the user if they want to open the image in a new tab.
10:50 <artemijan> jonaso, yes
10:51 <artemijan> it's simple solution for both plugins
10:51 <jonaso> right, I think the first step is "detect the CORS situation", and the second step is "offer to open image in new tab"
10:51 <jonaso> then if we have more time later, we can just replace the second step with something else
For http://glipho.com/margaretsw/3-innocent-creatures-turn-evil, matching the image https://d2ia58550xamqo.cloudfront.net/fda1b9bcc91248c5b4020f9f24806b63.jpg, doesn't work because of the lack of CORS headers.
This may be possible to get around with HTMLCanvas or similar, see below discussion:
10:40 The Firefox addon SDK docs says this about using sdk/request from the chrome part of a scrtip: "Since the request is not being made by any particular website, requests made here are not subject to the same-domain restriction that requests made in web pages are subject to."
10:40 https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/request
10:43 It seemed that artemijan had problems with the JPG or PNG libs breaking down in the chrome context because one of them actually used document.canvas behind the scenes, and there's no document in chrome. But it should be possible to hack them to do a new HTMLCanvas() or something like that.