PageSourceSearch

https://www.tcfcanada.ai/js/load-css.js?v=2

js tcfcanada.ai collected 2026-10-05 14:36:29 UTC 1,950 bytes, 37 lines download raw bytes

1!(function () {
2  function swap(link) {
3    if (link && link.media === 'print') link.media = 'all';
4  }
5  // ⚠️ vercel.json 给 /assets/(.*) 挂了 `max-age=31536000, immutable`,而 Vercel 对自己
6  // 生成的 404(Content-Type: text/plain)也套用这条头。于是只要某一个 hash 资源在部署
7  // 窗口内还没就位(旧 HTML / 旧 SW 指向已被 CDN 删掉的 hash,或新 HTML 先于资源到达),
8  // 这一次 404 就被浏览器按 immutable 存一年 —— 之后每次访问都命中这份本地缓存,样式表
9  // 被严格 MIME 检查拒绝("Refused to apply style … MIME type text/plain"),页面完全
10  // 无样式,且 immutable 连普通刷新都不会回源,只有硬刷新/清缓存才能恢复。
11  // 带 query 的 URL 是新的缓存键,能绕开被污染的那条记录。用新建 <link> 而不是改 href,
12  // 避免掐断一次慢但正常的加载。
13  function retry(link) {
14    if (link.getAttribute('data-tcf-css-retry')) return;
15    link.setAttribute('data-tcf-css-retry', '1');
16    var url = new URL(link.href, location.href);
17    url.searchParams.set('css-retry', String(Date.now()));
18    var fresh = link.cloneNode(false);
19    fresh.setAttribute('href', url.href);
20    fresh.setAttribute('media', 'all');
21    document.head.appendChild(fresh);
22  }
23  document.querySelectorAll('link[rel="stylesheet"][media="print"]').forEach(function (link) {
24    if (link.sheet) {
25      swap(link);
26      return;
27    }
28    // 拿到响应但被 MIME 检查拒掉时 Chrome 走 load(此时 link.sheet 为空),
29    // 完全取不到才走 error;两者都兜住,4s 还没生效再补一次(慢网兜底)。
30    link.addEventListener('load', function () {
31      if (link.sheet) swap(link);
32      else retry(link);
33    });
34    link.addEventListener('error', function () { retry(link); });
35    setTimeout(function () { if (!link.sheet) retry(link); }, 4000);
36  });
37})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.