philipp-winterle / crittr

High performance critical css extraction with a great configuration abilities
https://hummal.github.io/crittr/
GNU General Public License v3.0
51 stars 6 forks source link

Allow internal HTML files to be processed #18

Closed andershagbard closed 3 years ago

andershagbard commented 3 years ago

Is your feature request related to a problem? Please describe.

I wan't to be able to use internal HTML files, instead of URLs. This feature would be good to have, if the URL is behind a password or similar.

Describe the solution you'd like

I wan't to be able to pass in a internal URL in the urls field.

const urls = [
  './crittr/index.html',
  'https://example.com/about',
];
philipp-winterle commented 3 years ago

That should be possible. But not without some work. Iam not sure but as I remember correctly Chrome does not allow to access local files via headless. Also the external CSS and JS will not be loaded properly then. But I need to check that. Am not sure.

Anyway, the workaround would be to set up an webserver for file urls and load the localhost url into the browser. Guess this is the easy way. Will take some time tho.

philipp-winterle commented 3 years ago

With the release of 1.3.0 you should be able to work with local html files. Enjoy

andershagbard commented 3 years ago

Neat!