how can I block the browser xul component from downloading?
I have a xulrunner app, and I am using the browser object; I would like to call loadURI to download a URL and not have it load any of the content on the page.
Is there a way to specify via pref a way to disable downloading of resources such as CSS, images, JavaScript?
Update I found the nsIDocShell documentation, and this solves half of my problem; is there a way to prevent it from download javascript and CSS files?
browser.docShell.allowImages = false;
browser.docShell.allowMetaRedirects = false;
browser.docShell.allo开发者_运维问答wAuth = false;
browser.docShell.allowPlugins = false;
browser.docShell.allowSubframes = false;
See How to stop firefox from downloading and applying CSS via a firefox extension?. It doesn't have an easy answer also, but the questioner does suggest a workaround that might be close enough to your needs.
精彩评论