[ prog / sol / mona ]

prog


SICP yuri fanfics

9 2020-04-28 03:01

To navigate between pages on the current version of the dynasty-scans reader without running their minified javascript:

makenav = () => {
  const image = document.getElementById ("image").children [2]
  const pages = JSON.parse (document.getElementsByTagName ("script") [1].innerText.match (/var pages = (\[[^\]]+\]);/) [1])
  const count = pages.length
  let   now   = 0
  return [
    () => {
      now = (now + 1) % count
      image.setAttribute ("src", pages [now].image)
    },
    () => {
      now = (now + count - 1) % count
      image.setAttribute ("src", pages [now].image)
    }
  ]
}

[next, back] = makenav ()
next ()
back ()

After the first next() you can advance with UP ENTER.

71


VIP:

do not edit these