Skip to content

foiseworth/safe-to-capture

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Safe to capture

npm version Build Status Coverage Status MIT Licensed

A simple function that tells you whether a link DOM node is 'safe to capture' by a single page web app. Typically these will be links you wish to handle within the router.

A link is safe to capture if it:

  • is not external
  • is not a hash link to the current page
  • has a href

To use

var isSafeToCapture = require('safe-to-capture');
var link = document.querySelector('a');

isSafeToCapture(link);

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published