My extension is injecting markup and script into content pages from a protocol 
implemented by my own handler (nsIProtocolHandler). Because in some cases I 
need script loaded via this protocol handler to have chrome privileges, I am 
setting the channel owner to the system principal in newChannel().

All of this worked great, but I also need to block certain content loaded via 
my protocol handler. For this purpose I implemented a content policy 
(nsIContentPolicy). I noticed that when a stylesheet is loaded using my 
protocol handler, the content policy's shouldLoad() method is not triggered for 
subresources loaded by the stylesheet. If I remove the line that sets the owner 
of the stylesheet's channel to the system principal, then shouldLoad() is 
triggered for e.g. background images as expected.

Is it normal that subresources loaded by a stylesheet from a privileged channel 
do not trigger the content policy? If so, is there any way around this other 
than to not have the stylesheet's channel have the system principal?
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to