0.0.3 • Published 2 years ago

link-to-media v0.0.3

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

Link to Media Extension and Polyfill

Extension

A browser extension that allows you to link to arbitrary <img>s, <video>s, or <audio>s on webpages, according to the Alternative Content Types proposal.

Polyfill

A polyfill for the proposal to extend the concept of Text Fragments to include media.

Installation of the polyfill

npm install --save link-to-media

Usage

To create a link based on an element:

import { createLink, scrollTo } from 'link-to-media';

const img = document.querySelector('img');
const link = createLink(img);

To scroll the page to an element based on a link:

import { scrollTo } from 'link-to-media';

// This waits for `onload` internally.
scrollTo();

Developing

Scripts

npm run fix
# Beautifies the code.

npm run build
# Builds the polyfill.

npm start
# Runs a local server with test cases.

License

Apache 2.0.

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago