 // Test document.referrer.
    top.postMessage({test: "testDocumentReferrer", referrer: document.referrer}, "*");

    // Test a subresource being fetched by the iframe.
    const subresource_script = document.createElement('script');
    subresource_script.src = "${location.origin}/common/security-features/subresource/referrer.py";
    subresource_script.onload = e => {
      top.postMessage({test: "testSubresource", referrer: window.referrer}, "*");
    }
    subresource_script.onerror = function(e) {
  