Git Product home page Git Product logo

inlineresources's People

Contributors

barillax avatar cburgmer avatar dependabot[bot] avatar heikomat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

inlineresources's Issues

Scripts with valid RegExp break on inline

The following valid RegExp fails to be correctly inlined

/</.test('<');

This is due to the necessary escaping of </ kicks in.

A solution might be to use a different escaping mechanism with \uFEFF.

CSS Parsing errors are not shown to the user

I get the Unable to load stylesheet undefined with some third party css that uses an @page rule.

The parsing error is an issue with the parser library you're using (NV/CSSOM#5) but not showing the user that there was an error with the parsing is non-helpful.

To be able to see where the error was I edited rasterizeHTML.allinone.js to use the following code:

  c.loadAndInlineCssLinks=function(a,b){
    var c=r(a)
      , e=[];
    console.log("filtered links",c);
    return d.all(c.map(function(a){
      console.log("CSS",a);
      return (q(a,b)
                  .then(
                      function(b){
                        o(a,b.content+"\n")
                                  ,e=e.concat(b.errors)
                      }
                    ,function(ee){
                      console.log("CSS ERROR", [a,ee]);
                      e.push({resourceType:"stylesheet",url:ee.url,msg:"Unable to load stylesheet "+ (ee.url ||a.getAttribute('href')) +" -- "+ee})
                    })
             )}

Stop publishing all-in-one builds

Hey @barillax, in 2571b79 i've made a change to stop publishing the all-in-one packages. I just realised, that we only recently added the non-cssom one.

The benefits of not publishing those is removing the need to provide updates here if some downstream dependency changes. Naturally the user should just get those by running a local npm install.

Can you let me know if that works with your build process / otherwise whether we can come up with a good argument why we should bring back support for these?

Data URIs getting relative URLs

Debugging rasterizeHTML.js, I came across a problem with inlineresources' handling of Data URIs in background images.

Through the function adjustPathsOfCssResources, all data URIs passed as background images will be given a relative URL based on the stylesheet they're within, which causes an incorrect external request for the image later on.

I experienced this when using SVGs as data URIs in stylesheets that were being run through rasterizeHTML.js.

Bower.json ?

I know Bower has fallen out of fashion these days, but we have a project that still uses it for external libs. It would be convenient to have a build of inlineresources in the bower repo.

Failing that, I'd be amenable to creating and maintaining a shadow repo, a la https://github.com/nidheeshdas/bower-pdfkit that serves to simply point to the latest build. Let me know what you prefer!

Support adding a Header to Ajax requests for Authentication through options

I'm trying to use rasterizeHTML to rasterize html that includes an image with src that points to a server which requires Authorization through a Bearer Token.

It doesn't seem there is currently any way to attach a Header to the requests made from rasterizeHTML through inlineresources. It would be very helpful to enable this functionality, then expose it through rasterizeHTML.

Loading CSS in a background tab is flaky

Loading CSS resources over a HTTP source in a background tab in Firefox seems flaky. The error "Unable to load stylesheet undefined" is returned in some cases. Further debugging around the message makes the message disappear.

cssSupport.changeFontFaceRuleSrc() seems to have problems either retrieving rule.style.getPropertyValue("font-family") or rule.parentStyleSheet, the latter being null.

Please release a prebuilt version

Please release a prebuilt version, so we don't have to downloadwhole dependencies (its really slow in my country) just to build inlineresources.allinone.js

Missing package init tasks

  • Make importable (browserify or distribute bundle) ✓
  • Document API ✓
  • Move characterisation test data over from rasterizeHTML.js ✓
  • Move open issues over from rasterizeHTML.js
  • Register npm package ✓

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.