// ==UserScript== // @name Unreel: no Shorts, no Reels // @namespace unreel // @version 1.2.0 // @description Removes YouTube Shorts and Instagram Reels from the websites, and shows how long you spend on each part of them. A Short or Reel someone sends you opens as a normal video or post; the swipe feeds are gone. // @match *://*.youtube.com/* // @match *://*.instagram.com/* // @run-at document-start // @inject-into content // @grant none // @noframes // @updateURL https://raw.githubusercontent.com/TymonBitesTheDust/Unreel/HEAD/iphone/unreel.meta.js // @downloadURL https://raw.githubusercontent.com/TymonBitesTheDust/Unreel/HEAD/iphone/unreel.user.js // ==/UserScript== // GENERATED by scripts/build-userscript.mjs from targets/safari/assets/content.{css,js} and screentime.js. // Edit those files, then run `npm run build:userscript`. (() => { // Hide the shelves, tabs and links that lead into Shorts and Reels. const css = "/*\n * Hides the entry points into Shorts and Reels. Selectors target both desktop (ytd-*) and the\n * mobile site Safari on iPhone actually gets (m.youtube.com, ytm-*). Like the Android view IDs,\n * these break when the sites redesign — keep them in one place and re-check after updates.\n */\n\n/* ---- YouTube: Shorts shelves, cards and nav ---- */\nytd-reel-shelf-renderer,\nytd-rich-shelf-renderer[is-shorts],\nytd-rich-section-renderer:has(ytd-rich-shelf-renderer[is-shorts]),\nytd-video-renderer:has(a[href^=\"/shorts/\"]),\nytd-grid-video-renderer:has(a[href^=\"/shorts/\"]),\nytd-guide-entry-renderer:has(a[title=\"Shorts\"]),\nytd-mini-guide-entry-renderer[aria-label=\"Shorts\"],\ngrid-shelf-view-model:has(a[href^=\"/shorts/\"]),\nytm-reel-shelf-renderer,\nytm-shorts-lockup-view-model,\nytm-shorts-lockup-view-model-v2,\nytm-rich-section-renderer:has(ytm-reel-shelf-renderer),\nytm-rich-section-renderer:has(a[href^=\"/shorts/\"]),\nytm-video-with-context-renderer:has(a[href^=\"/shorts/\"]),\nytm-pivot-bar-item-renderer:has(.pivot-shorts),\nyt-tab-shape[tab-title=\"Shorts\"] {\n display: none !important;\n}\n\n/* ---- Instagram: Reels nav and profile tab ---- */\na[href=\"/reels/\"],\na[href$=\"/reels/\"][role=\"tab\"],\na[href^=\"/reels/\"] {\n display: none !important;\n}\n"; const addStyle = () => { if (document.getElementById('unreel-style')) return true; const root = document.head || document.documentElement; if (!root) return false; // At document-start the page may not have a root element yet. const style = document.createElement('style'); style.id = 'unreel-style'; style.textContent = css; root.appendChild(style); return true; }; if (!addStyle()) { const observer = new MutationObserver(() => addStyle() && observer.disconnect()); observer.observe(document, { childList: true, subtree: true }); } // YouTube and Instagram rebuild parts of the page as you navigate; put the style back if it's dropped. setInterval(addStyle, 1000); })(); /** * Unreel for Safari — removes Shorts and Reels from youtube.com and instagram.com. * * Two layers: * 1. rules.json (declarativeNetRequest) rewrites full page loads of /shorts/… and /reels/… * before they render. * 2. This script handles in-page (SPA) navigation, which never hits the network as a page load, * and content.css hides the shelves and nav entries that lead into the feeds. * * Policy mirrors the Android app: a single Short or Reel someone sent you opens as a normal * video/post (no swipe-to-next feed); the feeds themselves bounce back to the home page. * * scripts/test-userscript.mjs runs this file against a list of URLs; add a case there when you * add a rule here or in rules.json. */ (() => { const host = location.hostname; const isYouTube = /(^|\.)youtube\.com$/.test(host); const isInstagram = /(^|\.)instagram\.com$/.test(host); if (!isYouTube && !isInstagram) return; /** Returns the URL to go to instead, or null if this page is fine. */ function rewrite(url) { const path = url.pathname; if (isYouTube) { const single = path.match(/^\/shorts\/([A-Za-z0-9_-]+)/); if (single) { // Keep a start time if the link had one. const t = new URLSearchParams(url.search).get('t'); return `/watch?v=${single[1]}${t && /^\d+s?$/.test(t) ? `&t=${t}` : ''}`; } if (/^\/shorts\/?$/.test(path)) return '/'; // Channel "Shorts" tabs: /@name/shorts, /channel/UC…/shorts, /c/name/shorts, /user/name/shorts const channelShorts = path.match(/^(\/(?:@[^/]+|channel\/[^/]+|c\/[^/]+|user\/[^/]+))\/shorts\/?$/); if (channelShorts) return `${channelShorts[1]}/videos`; // Hashtag pages have a Shorts-only feed: /hashtag/name/shorts const hashtagShorts = path.match(/^(\/hashtag\/[^/]+)\/shorts\/?$/); if (hashtagShorts) return hashtagShorts[1]; } if (isInstagram) { if (/^\/reels\/?$/.test(path)) return '/'; // "Reels using this audio" is another swipe feed. if (/^\/reels\/audio\//.test(path)) return '/'; const single = path.match(/^\/reels?\/([A-Za-z0-9_-]{8,})\/?$/); if (single) return `/p/${single[1]}/`; // Profile reels grid: /name/reels/ const profileReels = path.match(/^(\/[^/]+)\/reels\/?$/); if (profileReels) return `${profileReels[1]}/`; } return null; } /** * If a site starts sending us straight back (say YouTube began redirecting /watch to /shorts), * redirecting again would reload the page forever. After two bounces from the same page within * ten seconds, Unreel stops and says so instead. */ const GUARD_KEY = 'unreel-redirects'; function mayRedirect(from) { try { const now = Date.now(); const recent = JSON.parse(sessionStorage.getItem(GUARD_KEY) || '[]').filter((r) => now - r.at < 10_000); if (recent.filter((r) => r.from === from).length >= 2) return false; recent.push({ from, at: now }); sessionStorage.setItem(GUARD_KEY, JSON.stringify(recent)); } catch { // No sessionStorage (private mode quirks): redirect anyway. } return true; } function showStuckNotice() { if (document.getElementById('unreel-notice')) return; if (!document.body) { document.addEventListener('DOMContentLoaded', showStuckNotice, { once: true }); return; } const box = document.createElement('div'); box.id = 'unreel-notice'; box.setAttribute('role', 'status'); box.style.cssText = 'position:fixed;left:12px;right:12px;bottom:12px;z-index:2147483647;padding:12px 14px;border-radius:12px;' + 'background:#2B3BD6;color:#fff;font:14px/1.4 -apple-system,system-ui,sans-serif;box-shadow:0 4px 16px rgba(0,0,0,.3)'; box.textContent = (isYouTube ? 'Unreel couldn’t open this Short as a normal video. ' : 'Unreel couldn’t open this Reel as a post. ') + 'The site may have changed; check for an Unreel update. Tap to close.'; box.addEventListener('click', () => box.remove()); document.body.appendChild(box); } let lastHref = ''; function check() { if (location.href === lastHref) return; lastHref = location.href; const target = rewrite(location); if (!target || target === location.pathname + location.search) return; if (mayRedirect(location.pathname)) { location.replace(target); } else { showStuckNotice(); } } // YouTube fires this after every in-app navigation; it's a DOM event, so it reaches the // isolated world content scripts run in. document.addEventListener('yt-navigate-finish', check); window.addEventListener('popstate', check); // Fallback for anything that changes history without an event we can see (Instagram, // m.youtube.com). Comparing one string twice a second is negligible. setInterval(check, 500); check(); })(); /** * Unreel screen time for the websites: Safari on iPhone, iPad and Mac, and Chrome, Edge or * Firefox on a computer. Counts how long youtube.com or instagram.com is open and in use, split * into the same parts as the Android app, and shows it behind a small badge on the page. * * YouTube: shorts · video · other ("Not watching") * Instagram: scrolling ("Scrolling Reels") · normal ("Posts & Stories") · chat · other * * Parts come from the address (the Android app reads view IDs instead): /watch is a video, * /direct/ is chat, and so on. A video playing with sound anywhere (the miniplayer) also counts * as a video. content.js redirects Shorts and the Reels feed away, so those parts stay near zero. * * Counting: once a second, only while the tab is visible and in use: a video is playing with * sound, or the page has focus and was touched in the last 5 minutes. Background tabs, a locked * phone and a forgotten window don't count. * * Storage: this site's localStorage in this browser (`unreel-screen-time`), 60 days. Unreel sends * nothing anywhere; the site's own scripts could read it, as they can any of their page data. * * Built into iphone/unreel.user.js by scripts/build-userscript.mjs, and loaded next to content.js * by the Safari extension. scripts/test-userscript.mjs tests the pure parts through * globalThis.__unreelScreenTime. */ (() => { /** Display order and names, the same as the Android app (ScreenTimeStore.kt, MainActivity.kt). */ const SITES = { youtube: { name: 'YouTube', parts: [ ['shorts', 'Shorts'], ['video', 'Videos'], ['other', 'Not watching'], ], }, instagram: { name: 'Instagram', parts: [ ['scrolling', 'Scrolling Reels'], ['normal', 'Posts & Stories'], ['chat', 'Chat'], ['other', 'Other'], ], }, }; const KEY = 'unreel-screen-time'; const BADGE_KEY = 'unreel-screen-time-badge'; const RETENTION_DAYS = 60; const MINUTE = 60_000; const TICK_MS = 1000; /** A longer gap between ticks means the page or the phone slept. */ const MAX_TICK_MS = 2000; const IDLE_MS = 5 * MINUTE; const SAVE_EVERY_MS = 10_000; // ---- Pure parts (tested) ------------------------------------------------------------------- function siteOf(hostname) { if (/(^|\.)youtube\.com$/.test(hostname)) return 'youtube'; if (/(^|\.)instagram\.com$/.test(hostname)) return 'instagram'; return null; } /** Which part of the site this page is. `playing`: a video is playing with sound. */ function partOf(site, pathname, playing) { if (site === 'youtube') { if (/^\/shorts(\/|$)/.test(pathname)) return 'shorts'; if (/^\/(watch\/?$|live\/)/.test(pathname) || playing) return 'video'; return 'other'; } if (/^\/reels(\/|$)/.test(pathname)) return 'scrolling'; if (/^\/direct(\/|$)/.test(pathname)) return 'chat'; if (pathname === '/' || /^\/(p|reel|stories)\//.test(pathname)) return 'normal'; return 'other'; } /** Local calendar day, yyyy-MM-dd, like the Android app. */ function dayKey(ms) { const d = new Date(ms); const pad = (n) => String(n).padStart(2, '0'); return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`; } /** { days: { 'yyyy-MM-dd': { part: ms } } }, from storage text; anything unreadable is empty. */ function parse(raw) { try { const data = JSON.parse(raw); if (data && typeof data.days === 'object' && data.days !== null && !Array.isArray(data.days)) return { days: data.days }; } catch { // Fall through. } return { days: {} }; } function add(store, at, part, ms) { const day = dayKey(at); const parts = store.days[day] || (store.days[day] = {}); parts[part] = (parts[part] || 0) + ms; return store; } /** Adds another store's times into `store` (a tab's unsaved time into what's saved). */ function merge(store, other) { for (const [day, parts] of Object.entries(other.days)) { const into = store.days[day] || (store.days[day] = {}); for (const [part, ms] of Object.entries(parts)) { if (typeof ms === 'number' && ms > 0) into[part] = (typeof into[part] === 'number' ? into[part] : 0) + ms; } } return store; } function prune(store, now) { const cutoff = dayKey(now - RETENTION_DAYS * 24 * 60 * MINUTE); for (const day of Object.keys(store.days)) if (day < cutoff) delete store.days[day]; return store; } /** The last `n` days, oldest first, including empty ones: [{ date, parts }]. */ function lastDays(store, n, now) { const out = []; const d = new Date(now); d.setHours(12, 0, 0, 0); // Midday, so stepping back a day never trips over a DST change. d.setDate(d.getDate() - (n - 1)); for (let i = 0; i < n; i++) { const date = dayKey(d.getTime()); out.push({ date, parts: store.days[date] || {} }); d.setDate(d.getDate() + 1); } return out; } /** "0 min", "under 1 min", "45 min", "2 h", "1 h 12 min". Same as the Android app. */ function durationText(ms) { if (!(ms > 0)) return '0 min'; const minutes = Math.floor(ms / MINUTE); if (minutes === 0) return 'under 1 min'; const h = Math.floor(minutes / 60); const m = minutes % 60; if (h === 0) return `${m} min`; return m === 0 ? `${h} h` : `${h} h ${m} min`; } if (globalThis.__UNREEL_TEST__) { globalThis.__unreelScreenTime = { SITES, siteOf, partOf, dayKey, parse, add, merge, prune, lastDays, durationText }; return; } const site = siteOf(location.hostname); if (!site) return; // ---- Counting ------------------------------------------------------------------------------ let unsaved = { days: {} }; let lastTick = Date.now(); let lastInput = Date.now(); let lastSave = Date.now(); function read() { try { return parse(localStorage.getItem(KEY)); } catch { return { days: {} }; } } /** Saved time plus this tab's unsaved time. */ function current() { return merge(read(), unsaved); } function save() { lastSave = Date.now(); if (Object.keys(unsaved.days).length === 0) return; const store = prune(current(), Date.now()); try { localStorage.setItem(KEY, JSON.stringify(store)); unsaved = { days: {} }; } catch { // Storage full or blocked (some private modes): keep counting in memory for this visit. } } function playingWithSound() { for (const video of document.querySelectorAll('video')) { if (!video.paused && !video.ended && !video.muted && video.volume > 0 && video.readyState > 2) return true; } return false; } const touchScreen = typeof matchMedia === 'function' && matchMedia('(pointer: coarse)').matches; function inUse(now, playing) { if (document.visibilityState !== 'visible') return false; if (playing) return true; // On a computer, only the focused window counts, so two tabs side by side aren't counted twice. return (touchScreen || document.hasFocus()) && now - lastInput < IDLE_MS; } let ticks = 0; function tick() { const now = Date.now(); const elapsed = Math.min(Math.max(now - lastTick, 0), MAX_TICK_MS); lastTick = now; const playing = playingWithSound(); if (elapsed > 0 && inUse(now, playing)) add(unsaved, now, partOf(site, location.pathname, playing), elapsed); if (now - lastSave >= SAVE_EVERY_MS) save(); ticks++; if (ui) { if (!ui.host.isConnected && document.documentElement) document.documentElement.appendChild(ui.host); if (!ui.panel.hidden) renderPanel(); else if (ticks % 5 === 0) renderBadge(); } } const noteInput = () => { lastInput = Date.now(); }; for (const type of ['pointerdown', 'keydown', 'wheel', 'touchstart', 'scroll']) { document.addEventListener(type, noteInput, { capture: true, passive: true }); } document.addEventListener('visibilitychange', () => { lastTick = Date.now(); // Time spent hidden is never counted. if (document.visibilityState === 'hidden') save(); }); window.addEventListener('pagehide', save); setInterval(tick, TICK_MS); // ---- Badge and panel ----------------------------------------------------------------------- // Built with createElement and textContent only: YouTube enforces Trusted Types, so assigning // HTML strings would throw. A closed shadow root keeps the sites' CSS and ours apart. const CSS = ` :host { all: initial; position: fixed; z-index: 2147483646; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); font: 14px/1.4 -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; --surface: #FFFFFF; --hi: #EDEFF3; --ink: #10162F; --muted: #5A6075; --line: #D5D9E2; --brand: #2B3BD6; --link: #2B3BD6; --blue: #2A78D6; --orange: #EB6834; --aqua: #1BAF7A; color-scheme: light; } @media (prefers-color-scheme: dark) { :host { --surface: #171C35; --hi: #2A3050; --ink: #EEF0F7; --muted: #9AA1BC; --line: #2A3050; --brand: #3443E0; --link: #9AA6FF; --blue: #3987E5; --orange: #D95926; --aqua: #199E70; color-scheme: dark; } } /* Above the bottom navigation bar both sites show on phones. */ @media (max-width: 800px) { :host { bottom: calc(env(safe-area-inset-bottom, 0px) + 64px); } } * { box-sizing: border-box; } [hidden] { display: none !important; } button { font: inherit; cursor: pointer; } button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; } .badge { display: flex; align-items: center; gap: 6px; min-height: 32px; padding: 6px 12px; border: 0; border-radius: 16px; background: var(--brand); color: #FFFFFF; font-weight: 600; box-shadow: 0 2px 10px rgba(0,0,0,.25); opacity: .94; white-space: nowrap; } .badge.mini { padding: 6px 8px; } .badge.mini .label { display: none; } .badge svg { width: 16px; height: 16px; flex: none; } .panel { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); width: min(340px, calc(100vw - 24px)); max-height: min(70vh, 560px); overflow: auto; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: 0 8px 32px rgba(0,0,0,.3); } .head { display: flex; align-items: center; gap: 8px; } .title { flex: 1; font-size: 16px; font-weight: 600; } .close { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; } .seg { display: flex; margin-top: 12px; padding: 3px; border: 1px solid var(--line); border-radius: 12px; } .seg button { flex: 1; padding: 7px 0; border: 0; border-radius: 9px; background: transparent; color: var(--muted); } .seg button[aria-pressed="true"] { background: var(--hi); color: var(--ink); font-weight: 600; } .total { display: flex; margin-top: 14px; font-size: 16px; font-weight: 600; } .total span:first-child { flex: 1; } .avg { color: var(--muted); font-size: 13px; } .bar { display: flex; gap: 2px; height: 8px; margin: 12px 0 4px; overflow: hidden; border-radius: 4px; } .bar.empty { background: var(--line); } .bar span { min-width: 2px; } .row { display: flex; align-items: center; gap: 10px; margin-top: 10px; } .sw { width: 10px; height: 10px; flex: none; border-radius: 50%; } .name { flex: 1; } .time { color: var(--muted); } .foot { margin-top: 14px; color: var(--muted); font-size: 12px; } .link { margin-top: 6px; padding: 0; border: 0; background: transparent; color: var(--link); font-size: 13px; text-decoration: underline; } `; const COLORS = { shorts: 'var(--orange)', scrolling: 'var(--orange)', video: 'var(--blue)', normal: 'var(--blue)', chat: 'var(--aqua)' }; function h(tag, props, ...children) { const node = document.createElement(tag); for (const [key, value] of Object.entries(props || {})) { if (key === 'class') node.className = value; else if (key === 'text') node.textContent = value; // Through CSSOM, which a page's CSP allows; a style attribute may be blocked. else if (key === 'style') Object.assign(node.style, value); else if (key.startsWith('on')) node.addEventListener(key.slice(2), value); else node.setAttribute(key, value); } for (const child of children) if (child) node.append(child); return node; } function clockIcon() { const ns = 'http://www.w3.org/2000/svg'; const svg = document.createElementNS(ns, 'svg'); svg.setAttribute('viewBox', '0 0 24 24'); svg.setAttribute('aria-hidden', 'true'); for (const [tag, attrs] of [ ['circle', { cx: '12', cy: '12', r: '9' }], ['path', { d: 'M12 7v5l3 2' }], ]) { const shape = document.createElementNS(ns, tag); for (const [k, v] of Object.entries(attrs)) shape.setAttribute(k, v); shape.setAttribute('fill', 'none'); shape.setAttribute('stroke', 'currentColor'); shape.setAttribute('stroke-width', '2'); shape.setAttribute('stroke-linecap', 'round'); svg.appendChild(shape); } return svg; } const name = SITES[site].name; let ui = null; let range = 'today'; function mini() { try { return localStorage.getItem(BADGE_KEY) === 'mini'; } catch { return false; } } function todayTotal() { const parts = lastDays(current(), 1, Date.now())[0].parts; return Object.values(parts).reduce((sum, ms) => sum + (typeof ms === 'number' ? ms : 0), 0); } function renderBadge() { const text = durationText(todayTotal()); ui.label.textContent = text; ui.badge.classList.toggle('mini', mini()); ui.badge.setAttribute('aria-label', `Unreel: ${text} on ${name} today. Show screen time`); } let shownSignature = ''; function renderPanel() { const days = lastDays(current(), range === 'today' ? 1 : 7, Date.now()); const parts = SITES[site].parts.map(([id, label]) => ({ id, label, ms: days.reduce((sum, day) => sum + (typeof day.parts[id] === 'number' ? day.parts[id] : 0), 0), })); const total = parts.reduce((sum, p) => sum + p.ms, 0); const shown = parts.filter((p) => p.ms > 0); // Re-render only when a figure changes, so a screen reader isn't interrupted every second. const signature = [range, mini(), durationText(total), ...parts.map((p) => `${p.ms > 0}${durationText(p.ms)}`), shown.length && total].join('|'); if (signature === shownSignature) return; shownSignature = signature; for (const button of ui.seg.children) button.setAttribute('aria-pressed', String(button.dataset.range === range)); const bar = h('div', { class: shown.length ? 'bar' : 'bar empty', 'aria-hidden': 'true' }); for (const p of shown) { bar.append(h('span', { style: { flex: `${p.ms} 1 0`, background: COLORS[p.id] || 'var(--muted)' } })); } const rows = [ h('div', { class: 'total' }, h('span', { text: range === 'today' ? 'Today' : 'Last 7 days' }), h('span', { text: durationText(total) })), range === 'week' && total > 0 ? h('div', { class: 'avg', text: `About ${durationText(total / days.length)} a day` }) : null, bar, ...parts.map((p) => h( 'div', { class: 'row' }, h('span', { class: 'sw', style: { background: COLORS[p.id] || 'var(--muted)' }, 'aria-hidden': 'true' }), h('span', { class: 'name', text: p.label }), h('span', { class: 'time', text: durationText(p.ms) }), ), ), ]; // replaceChildren would print a null as the text "null". ui.body.replaceChildren(...rows.filter(Boolean)); ui.sizeLink.textContent = mini() ? 'Show the time on the badge' : 'Make the badge smaller'; } function open() { save(); shownSignature = ''; ui.panel.hidden = false; ui.badge.setAttribute('aria-expanded', 'true'); renderPanel(); ui.close.focus(); } function close() { if (ui.panel.hidden) return; const hadFocus = ui.root.activeElement != null; ui.panel.hidden = true; ui.badge.setAttribute('aria-expanded', 'false'); renderBadge(); if (hadFocus) ui.badge.focus(); } function mount() { if (ui) return; if (!document.body) { document.addEventListener('DOMContentLoaded', mount, { once: true }); return; } const host = h('div', { id: 'unreel-screen-time' }); const root = host.attachShadow({ mode: 'closed' }); const label = h('span', { class: 'label' }); const badge = h('button', { class: 'badge', type: 'button', 'aria-expanded': 'false', onclick: () => (ui.panel.hidden ? open() : close()) }, clockIcon(), label); const closeButton = h('button', { class: 'close', type: 'button', 'aria-label': 'Close', text: '×', onclick: close }); const pick = (value) => () => { range = value; renderPanel(); }; const seg = h( 'div', { class: 'seg', role: 'group', 'aria-label': 'Period' }, h('button', { type: 'button', 'data-range': 'today', text: 'Today', onclick: pick('today') }), h('button', { type: 'button', 'data-range': 'week', text: 'Last 7 days', onclick: pick('week') }), ); const body = h('div'); const sizeLink = h('button', { class: 'link', type: 'button', onclick: () => { try { localStorage.setItem(BADGE_KEY, mini() ? 'full' : 'mini'); } catch { // Not saved; nothing else to do. } shownSignature = ''; renderPanel(); renderBadge(); }, }); const panel = h( 'div', { class: 'panel', role: 'dialog', 'aria-label': `Screen time on ${name}`, hidden: '' }, h('div', { class: 'head' }, h('span', { class: 'title', text: `${name} screen time` }), closeButton), seg, body, h('div', { class: 'foot', text: `Counted by Unreel while ${name} is open and in use in this browser. It stays on this device.` }), sizeLink, ); panel.addEventListener('keydown', (event) => { if (event.key === 'Escape') close(); }); // A constructed stylesheet isn't subject to the page's CSP; older browsers get a