AMP Cachify

A bookmark that opens the currently opened page in the Google AMP Cache.

Installation

Easy way

Drag the link below into your bookmarks bar, or right click on the link below to bookmark it:

AMP Cachify

Manual way

  1. Create a bookmark with the title you like
  2. Edit this bookmark (usually rightclick – edit...) and set the URL/location to the code below:

    javascript:(function() { let urlString = window.location.href; if (!urlString.startsWith("http")) { urlString = "https://" + urlString; } let url = new URL(urlString); let domain = url.hostname; domain = domain.replace(/-/g, "--"); domain = domain.replace(/\./g, "-"); const cdnUrl = "https://" + domain + ".cdn.ampproject.org/c/s" + url.href.slice(url.href.indexOf("/") + 1); window.location.href = cdnUrl; })()
    

Credits

The cache URL translation is 100% based on code by @adamread.