diff --git a/downloadmanager.py b/downloadmanager.py
index 8402b81..d52e164 100644
a
|
b
|
class Download: |
252 | 252 | def _get_file_name(self): |
253 | 253 | if self._display_name: |
254 | 254 | return self._display_name |
| 255 | elif self._source.scheme == 'data': |
| 256 | return 'data URI' |
255 | 257 | else: |
256 | 258 | path = urlparse.urlparse(self._source.spec).path |
257 | 259 | location, file_name = os.path.split(path) |
… |
… |
def save_link(url, text, owner_document): |
311 | 313 | interfaces.nsIRequest.LOAD_BYPASS_CACHE | \ |
312 | 314 | interfaces.nsIChannel.LOAD_CALL_CONTENT_SNIFFERS |
313 | 315 | |
314 | | if _implements_interface(channel, interfaces.nsIHttpChannel): |
315 | | channel.referrer = io_service.newURI(owner_document.documentURI, None, |
316 | | None) |
| 316 | # HACK: when we QI for nsIHttpChannel on objects that implement |
| 317 | # just nsIChannel, pyxpcom gets confused. see trac #1029 |
| 318 | if uri.scheme == 'http': |
| 319 | if _implements_interface(channel, interfaces.nsIHttpChannel): |
| 320 | channel.referrer = io_service.newURI(owner_document.documentURI, |
| 321 | None, None) |
317 | 322 | |
318 | 323 | # kick off the channel with our proxy object as the listener |
319 | 324 | listener = xpcom.server.WrapObject( |