So.. my hands have been itching, I had to do it
I have written a simple beginner-style userscript for webflow.
The script imports the custom
<head> you have defined in the site Code section, and applies it to the site in Design Mode.
I've gone an extra mile, and displayed the custom
<head> in the sidebar, just for fun.
I won't release it until I'm sure that this doesn't breaks rules or something.
Editing and saving code does not work right now.. but I'm working on it.
- Automatically imports
- Works on every page in the project in Design Mode.
- No need to duplicate
<head>code, never again.
- It's cool.
Well, I've read the terms and apparently I'm not breaking the agreement.. yay!
Here is the js file that enables this functionality:
You will need to run it using a userscript extension for your browser.
Tampermonkey for Chrome
Greasemonkey for Firefox
If you don't understand what the script is doing.. please do not use it. I can't be held responsible if something happens to your project. Use at your own risk!
How does it work?
- The script will load the custom
<head>using webflow API.
- It will inject that code 5 seconds after the project loads just before
</body>, this gives it enough time to be ready and should work in all cases.
- A new box will be added to the Styles section in the sidebar that displays the custom
- The ability to save the custom
<head>from inside Design Mode, if possible.