/** * Tests that navigation request to a data uri is correctly logged in the * network monitor.
*/
add_task(async function test_navigation_to_data_uri() { const URL = "data:text/html,Hello from data-url!"; const { monitor } = await initNetMonitor(URL, {
requestCount: 1,
waitForLoad: false,
});
info("Starting test... ");
is(
firstItem.querySelector(".requests-list-url").innerText,
URL, "The url in the displayed request is correct"
);
is(
firstItem.querySelector(".requests-list-scheme").innerText, "data", "The scheme in the displayed request is correct"
);
is(
firstItem.querySelector(".requests-list-file").innerText,
URL, "The file in the displayed request is correct"
);
ok(hasValidSize(firstItem), "The request shows a valid size");
await teardown(monitor);
});
/** * Tests that requests to data URIs made from a content page are logged in the * network monitor.
*/
add_task(async function test_content_request_to_data_uri() { const IMAGE_URL = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"; const URL = `https://example.com/document-builder.sjs?html=
<h1>Test page for content data uri request</h1>
<img src="${IMAGE_URL}"></iframe>`;
is(
firstItem.querySelector(".requests-list-url").innerText,
IMAGE_URL, "The url in the displayed request is correct"
);
is(
firstItem.querySelector(".requests-list-scheme").innerText, "data", "The scheme in the displayed request is correct"
);
is(
firstItem.querySelector(".requests-list-file").innerText,
IMAGE_URL, "The file in the displayed request is correct"
);
ok(hasValidSize(firstItem), "The request shows a valid size");
await teardown(monitor);
});
¤ Dauer der Verarbeitung: 0.21 Sekunden
(vorverarbeitet)
¤
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 ist noch experimentell.