Skip to content

DOM Inspector to pick elements and execute custom action onClick

Notifications You must be signed in to change notification settings

mbondyra/inspector-dom

Repository files navigation

Inspector Dom

Pure vanilla-js ultra-lightweight dom inspector similiar to built-in tool in chrome browser with a custom callback onClick.

Install

yarn add inspector-dom

const Inspector = require('inspector-dom')

import Inspector from 'inspector-dom'

Usage

Initialize:

const inspector = Inspector()

Props:

const inspector = Inspector({
    root: 'body',                       // root element
    excluded: [],                       // excluded children, string or node Element
    outlineStyles: '2px solid orange',  // styles
    onClick: el => console.log('Element was clicked:', constructCssPath(el) //onClick callback
});

API

inspector.enable() // turn the inspector on

inspector.cancel() // turn the inspector off

About

DOM Inspector to pick elements and execute custom action onClick

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published