hexo-filter-crossorigin

0.1.3 • Public • Published

hexo-filter-crossorigin

status npm version

Append crossorigin attribute to HTML elements (<img>, <video>, etc).

Why

See https://developers.google.com/web/tools/workbox/guides/handle-third-party-requests#remember_to_opt-in_to_cors_mod.

Config

# _config.yml 
 
filter_crossorigin:
  name: img
    crossorigin: true
    domains:
      - unpkg.com
    attrs:
      - src
  • name: tag name.
  • crossorigin: true (alias of anonymous) | false | anonymous | use-credentials.
  • domains: optional. If not provided, all elements that match tag name will be affected.
  • attrs: optional. Tag attributes to match domains. Default to src, data-src, href.

Package Sidebar

Install

npm i hexo-filter-crossorigin

Weekly Downloads

15

Version

0.1.3

License

MIT

Unpacked Size

9.77 kB

Total Files

10

Last publish

Collaborators

  • giuem