Skip to content

Instantly share code, notes, and snippets.

@heymartinadams
Last active March 9, 2023 11:00
Show Gist options
  • Save heymartinadams/031e214261f3743b2c0211ab2c74d00f to your computer and use it in GitHub Desktop.
Save heymartinadams/031e214261f3743b2c0211ab2c74d00f to your computer and use it in GitHub Desktop.

To export JavaScript, HTML, or CSS:

  1. Visit your Webflow site: https://webflow.com/design/yoursite

  2. Press shift + e to open the export window.

  3. Open the developer console (e.g. command + option + j in Chrome)

  4. Paste the following code into Webflow (yes, Webflow tells you not to paste code in there — the below snippets won’t grant anyone access to your Webflow account):

HTML

const htmlText = document.querySelectorAll('code')[0].innerText
const htmlDummy = document.createElement('textarea')
document.body.appendChild(htmlDummy)
htmlDummy.value = htmlText
htmlDummy.select()
document.execCommand('copy')
document.body.removeChild(htmlDummy)

CSS

const cssText = document.querySelectorAll('code')[1].innerText
const cssDummy = document.createElement('textarea')
document.body.appendChild(cssDummy)
cssDummy.value = cssText
cssDummy.select()
document.execCommand('copy')
document.body.removeChild(cssDummy)

JavaScript

const jsText = document.querySelectorAll('code')[2].innerText
const jsDummy = document.createElement('textarea')
document.body.appendChild(jsDummy)
jsDummy.value = jsText
jsDummy.select()
document.execCommand('copy')
document.body.removeChild(jsDummy)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment