Giter Site home page Giter Site logo

broccoli-sri-hash's People

Contributors

jmervine avatar jonathankingston avatar mwpastore avatar rwjblue avatar stefanpenner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

broccoli-sri-hash's Issues

Missing support for Link preload and prefetch

Preload and prefetch links should also have calculated integrity otherwise the preloaded resources are not used

A preload for 'abc.css' is found, but is not used due to an integrity mismatch.

Actual:

<link rel="preload" href="/assets/vendor.css" as="style">
<link rel="prefetch" href="/assets/vendor.css" as="style">

Expected:

<link rel="preload" href="/assets/vendor.css" as="style" integrity="123213">
<link rel="prefetch" href="/assets/vendor.css" as="style" integrity="123213">

Ember CLI: ENOENT, no such file or directory ... index.html w/ 1.2.0

I get the following trace in my Ember CLI project with broccoli-sri-hash 1.2.0, depended upon by ember-cli-sri. If I manually rollback to broccoli-sri-hash 1.1.1, the problem goes away.

➜ ember test
Future versions of Ember CLI will not support v0.10.40. Please update to Node 0.12 or io.js.
version: 1.13.8
Invalid watchman found, version: [4.1.0] did not satisfy [^3.0.0], falling back to NodeWatcher.
Visit http://www.ember-cli.com/user-guide/#watchman for more info.
Build failed.
ENOENT, no such file or directory '/path/to/my-cool-app/tmp/srihash_assets-output_path-S8FPzcEu.tmp/my-cool-app/index.html'
Error: ENOENT, no such file or directory '/path/to/my-cool-app/tmp/srihash_assets-output_path-S8FPzcEu.tmp/my-cool-app/index.html'
    at Object.fs.openSync (fs.js:439:18)
    at Object.fs.writeFileSync (fs.js:978:15)
    at SRIHashAssets.processFile [as processHTMLFile] (/path/to/my-cool-app/node_modules/ember-cli-sri/node_modules/broccoli-sri-hash/index.js:208:6)
    at Array.map (native)
    at SRIHashAssets.build (/path/to/my-cool-app/node_modules/ember-cli-sri/node_modules/broccoli-sri-hash/index.js:228:22)
    at /path/to/my-cool-app/node_modules/ember-cli-sri/node_modules/broccoli-sri-hash/node_modules/broccoli-caching-writer/index.js:152:21
    at lib$rsvp$$internal$$tryCatch (/path/to/my-cool-app/node_modules/ember-cli-sri/node_modules/broccoli-sri-hash/node_modules/rsvp/dist/rsvp.js:493:16)
    at lib$rsvp$$internal$$invokeCallback (/path/to/my-cool-app/node_modules/ember-cli-sri/node_modules/broccoli-sri-hash/node_modules/rsvp/dist/rsvp.js:505:17)
    at lib$rsvp$$internal$$publish (/path/to/my-cool-app/node_modules/ember-cli-sri/node_modules/broccoli-sri-hash/node_modules/rsvp/dist/rsvp.js:476:11)
    at Object.lib$rsvp$asap$$flush [as _onImmediate] (/path/to/my-cool-app/node_modules/ember-cli-sri/node_modules/broccoli-sri-hash/node_modules/rsvp/dist/rsvp.js:1198:9)

re-enable snyk

disabled here

it was catching

> [email protected] test /Users/stefanpenner/src/broccoli-sri-hash
> snyk test && mocha test

✗ Vulnerability found on [email protected]
Info: https://app.snyk.io/vuln/npm:uglify-js:20150824
From: [email protected] > [email protected] > uglify-js@~2.3
Upgrade direct dependency [email protected] to [email protected] (triggers upgrades to [email protected])

which doesn't actually affect broccoli, or this plugin.

broccoli issue: broccolijs/broccoli#286

Add crossorigin property to elements

As suggested by @metromoxie adding crossorigin property:

https://twitter.com/metromoxie/status/613824343001268224

Suggestion:

  • Accept an origin in the options passed into the plugin.
  • Use origin to determine which URLs are remote to the page
  • For script or link tags that don't have a crossorigin property set it to crossorigin="anonymous" if the resource isn't loaded from the current path.

Decide upon a method to exclude or include third party library code that should not have an integrity.

Does not take `base` tag into account.

Currently, when processing tests/index.html that has:

<base href="/">
<script src="assets/vendor.js"></script>

We look for tests/assets/vendor.js, but we should be looking for assets/vendor.js. This means that no integrity= attributes are added for tests/index.html (but they are properly added for index.html). This is also causing the ember-cli-sri tests to fail (because none of the <script> or <link> tags get integrity= attributes added).

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.