Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for base64 css stylesheet. #596

Closed
Leostat86 opened this issue Nov 11, 2020 · 1 comment
Closed

Support for base64 css stylesheet. #596

Leostat86 opened this issue Nov 11, 2020 · 1 comment

Comments

@Leostat86
Copy link

Hello, this is my first time ever to submit an issue. I apologize in advance that i probably did it wrong somehow.

We noticed that using base64 encoded images works great. Which got us thinking, if we base64 encoded our stylesheets we would be able to inspect the html in for instance chrome with CSS and everything. So after we used pebble to do some replacement of texts and such we got out a html with the CSS base64 ecoded.

<style type="text/css"> @import url("data:text/css;base64,LoolwskegfnhjoiNJEWF..........") </style>

This works perfectly in chrome, but then we tried to use this html in openhtmltopdf we get the following error:
MalformedURLException: unknown protocol: data

After inspecting the source code it does not seem that this usage is supported. However this would be a big improvement for us, as this would let us to use chrome as a debugging tool for our html when we are developing it.
I dont know how much effort it would require to add this support, but it would be greatly appreciated.

@syjer
Copy link
Contributor

syjer commented Nov 12, 2020

hi @Leostat86 , nice idea. I'll provide a PR :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants