premailer / css_parser

Ruby CSS Parser
Other
279 stars 110 forks source link

Make `USER_AGENT` parser writable #145

Closed george-gca closed 4 months ago

george-gca commented 5 months ago

I am trying to fetch a css file from Google fonts, and the information it generates depends on the user agent. When accessing the file from Google Chrome it returns all fonts inside as woff2 files, but when reading the file straight with load_uri it returns all fonts as ttf files. I believe being able to set the USER_AGENT value would fix this.

grosser commented 5 months ago

PR welcome, sounds like a small/innocent change

george-gca commented 5 months ago

What do you think would be the best solution for this? Create as an option in the constructor, or enable a setter?

grosser commented 5 months ago

lots of options in the constructer already so should be a good fit