hexo-filter-auto-crossorigin

Add crossorigin attribute to all external resources automatically.

Usage no npm install needed!

<script type="module">
  import hexoFilterAutoCrossorigin from 'https://cdn.skypack.dev/hexo-filter-auto-crossorigin';
</script>

README

hexo-filter-auto-crossorigin

npm version npm license travis status npm download

Add crossorigin attribute to all external resources automatically. Read More.

Installations

$ npm i hexo-filter-auto-crossorigin --save

Options

filter_crossorigin:
  - name: script
    crossorigin: true
  - name: img
    crossorigin: true
    domains:
      - unpkg.com
    attrs:
      - src
  • name: tag name. Only given tags will be processed.
  • crossorigin: true (alias of anonymous) | false | 'anonymous' | 'use-credentials'.
  • domains: optional. Only matched domains will be processed. If not provided, all external resources will be processed.
  • attrs: optional. Tag attributes to match domains, only given attributes will be used. If not provided, will use src, data-src, href.