Hello Daniel and everyone

Anatoly Kaverin wrote:

We need to get an image physical size (not dimentions) from Web page
loaded into Firefox browser.

Is it possible to get it via XPCOM without additional reloading???

From
chrome\browser\content\browser\metaData.js
function getSize(url) {
try
{
var cacheEntryDescriptor = httpCacheSession.openCacheEntry(url,
Components.interfaces.nsICache.ACCESS_READ, false);
if(cacheEntryDescriptor)
return cacheEntryDescriptor.dataSize;
}
catch(ex) {}
try
{
cacheEntryDescriptor = ftpCacheSession.openCacheEntry(url,
Components.interfaces.nsICache.ACCESS_READ, false);
if (cacheEntryDescriptor)
return cacheEntryDescriptor.dataSize;
}
catch(ex) {}
return -1;
}
Daniel

F'up set to netscape.public.mozilla.xpcom


This sample works great in our C++ XPCOM component in FF 1.0.x, but in Firefox 1.5 beta2 this code ins't working.
When we try to get service nsICacheService we always got error - NO_INTERFACE...

So, is there any mechanism to get physical size of images from cache???
maybe, new service or interface??
It's a pity, but XULPlanet don't include Gecko 1.8 interfaces...

With Best Regards,
Anatoly Kaverin, Firefox VEngine team
Comodo CA Limited
http://www.vengine.com http://www.comodo.com
[EMAIL PROTECTED]
MSN: [EMAIL PROTECTED]


_______________________________________________
Mozilla-xpcom mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to