var lastContentType = -1;
const testURL = window.location.href + "/this/is/the/test/url";
const Cc = SpecialPowers.Cc;
const Ci = SpecialPowers.Ci;
// Content policy / factory implementation for the test var policyID = SpecialPowers.wrap(SpecialPowers.Components).ID("{b80e19d0-878f-d41b-2654-194714a4115c}"); var policyName = "@mozilla.org/testpolicy;1"; var policy = {
// nsISupports implementation
QueryInterface(iid) {
// nsIContentPolicy implementation
shouldLoad(contentLocation, loadInfo) {
let contentType = loadInfo.externalContentPolicyType;
// Remember last content type seen for the test url
if (SpecialPowers.wrap(contentLocation).spec == testURL) {
lastContentType = contentType;
return Ci.nsIContentPolicy.REJECT_REQUEST;
}
setTimeout(function() {
// Component must be unregistered delayed, otherwise other content
// policy will not be removed from the category correctly
componentManager.unregisterFactory(policyID, policy);
}, 0);
SimpleTest.finish();
}
}
// Request creating functions
function request_script() { var content = $("content");
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.