Please create an account or Login! Have fun!

User:G-lander/NotCC Embed

< User:G-lander
Revision as of 14:23, 2 January 2024 by G-lander (talk | contribs) (Created page with "== Play == <div class="levelEmbed" data-leveldata="eJwdU01sG1UQnpl9b_d5E4cHdhwnpWGxQxq5cZBTJXCqMM4mNnZtY28iKlXip0eQqqiST0VFYnfjSpiKhJ9WpFLEz4XeOHBEglPuHLgihAQcOCFOCNQv3dXTzJv53sw339NrNNavCBG9QHvhYOjCq63V1tYpakWdp7BrDTv17lbwcrjT6nZb3Z0hNTq74avINHqdTtiIgkuXgkaz1R8GUS_YCaOgXx9GQdQMg2Gv0Q6jtaA_CIfDYLt2BoAb1QdR0NoOrvZ2H-OH0W6jvZb1qb4bNT0Ubra2tsIu9fpRdx7bUyJmfvvnw5tff7H51f_m8Lv0vfZ1BPv1RnvARF3lBIGcME-O2b08EZmYz_lhwJxwZiWLs8aYSuLeLU2FLBVm4QpLXOPKUZn5oMw3kvIn2yLywfbRN9mC8GpehGUU...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Play[edit]

Paste the code below into the JS console to replace this with an experimental NotCC embed!!
const NOTCC_URL = "https://glander.club/notcc/prewrite/"
function replceEmbed(el) {
  const iframe = document.createElement("iframe")
  iframe.frameBorder = 0
  const url = new URL(`http://hash.path`)
  url.searchParams.append("embed", "1")
  url.searchParams.append("level", el.getAttribute("data-leveldata"))
  const listener = ev => {
    if (ev.source !== iframe.contentWindow) return
    iframe.width = ev.data.width
    iframe.height = ev.data.height
    window.removeEventListener("message", listener)
  }
  window.addEventListener("message", listener)
  
  iframe.src = `${NOTCC_URL}#${url.href.slice(url.origin.length)}`
  el.replaceWith(iframe)
}
function replaceAllEmbeds() {
  for (const el of document.querySelectorAll(".levelEmbed")) {
    replceEmbed(el)
  }
}
replaceAllEmbeds()