DXR will be turned off on Tuesday, December 29th. It will redirect to Searchfox.
See the announcement on Discourse.

DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (c68fe15a81fc)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
<!DOCTYPE html>
<head>
  <script src="/resources/testharness.js"></script>
  <script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
  function expectMessage(filter) {
    return new Promise(resolve => {
      window.addEventListener("message", e => { if (filter(e)) resolve(); });
    });
  }

  function expectViolationAsMessage(sample) {
    const filter = e => ((e.data.effectiveDirective == "require-trusted-types-for" ||
                          e.data.effectiveDirective == "trusted-types") &&
                         (!sample || e.data.sample.startsWith(sample)));
    return new expectMessage(filter);
  }

  function expectLoadedAsMessage(uri) {
    const filter = e => (e.data.type == "DOMContentLoaded" &&
                        (!uri || e.data.uri.endsWith(uri)));
    return new expectMessage(filter);
  }

  function openWindow(test, uri) {
    const win = window.open(uri);
    test.add_cleanup(_ => win.close());
  }

  promise_test(t => {
    openWindow(t, "support/navigation-support.html");
    return Promise.all([
      expectLoadedAsMessage("navigation-support.html"),
      expectViolationAsMessage("Location href"),
    ]);
  }, "Navigate a window with javascript:-urls in enforcing mode.");

  promise_test(t => {
    openWindow(t, "support/navigation-support.html?defaultpolicy");
    return Promise.all([
      expectLoadedAsMessage("navigation-support.html?defaultpolicy"),
      expectLoadedAsMessage("navigation-support.html?defaultpolicy&defaultpolicywashere"),
    ]);
  }, "Navigate a window with javascript:-urls w/ default policy in enforcing mode.");

  promise_test(t => {
    const page = "navigation-report-only-support.html"
    openWindow(t, `support/${page}`);
    return Promise.all([
      expectLoadedAsMessage(page),
      expectLoadedAsMessage("navigation-support.html#continue"),
    ]);
  }, "Navigate a window with javascript:-urls in report-only mode.");

  promise_test(t => {
    const page = "navigation-report-only-support.html?defaultpolicy";
    openWindow(t, `support/${page}`);
    return Promise.all([
      expectLoadedAsMessage(page),
      expectLoadedAsMessage("navigation-support.html?defaultpolicy#defaultpolicywashere"),
    ]);
  }, "Navigate a window with javascript:-urls w/ default policy in report-only mode.");
</script>
</body>