All Projects → luoye-fe → dom-inspector

luoye-fe / dom-inspector

Licence: MIT license
Dom inspect like chrome dev tools.

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to dom-inspector

theroomjs
A vanilla javascript plugin that allows you to outline dom elements like web inspectors
Stars: ✭ 53 (-57.26%)
Mutual labels:  dom, inspector
Ply
CSS inspection aided by visual regression pruning
Stars: ✭ 370 (+198.39%)
Mutual labels:  dom, inspector
Object Visualizer
Vue JSON inspector with Chrome-like theme.
Stars: ✭ 159 (+28.23%)
Mutual labels:  dom, inspector
js-symbol-tree
Turn any collection of objects into its own efficient tree or linked list using Symbol
Stars: ✭ 86 (-30.65%)
Mutual labels:  dom
intuit-spring-cloud-config-inspector
Inspection of Spring Cloud Config properties made easy using React
Stars: ✭ 18 (-85.48%)
Mutual labels:  inspector
crab
JavaScript library for building user interfaces with Custom Elements, Shadow DOM and React like API
Stars: ✭ 22 (-82.26%)
Mutual labels:  dom
Python
covers python basic to advance topics, practice questions, logical problems in python, web development using html, css, bootstrap, jquery, DOM, Django 🚀🚀. 💥 🌈
Stars: ✭ 29 (-76.61%)
Mutual labels:  dom
vue-drag-select
基于Vue的仿原生操作系统鼠标拖拽选择
Stars: ✭ 63 (-49.19%)
Mutual labels:  dom
v8-inspector-api
A simple node module to access V8 inspector + some tools to export and read the data.
Stars: ✭ 43 (-65.32%)
Mutual labels:  inspector
javascript-html5-apis
🏆 Starter project for JavaScript HTML5 APIs
Stars: ✭ 19 (-84.68%)
Mutual labels:  dom
tsdom
Fast, lightweight TypeScript DOM manipulation utility
Stars: ✭ 16 (-87.1%)
Mutual labels:  dom
Mei.js
a minimal, simple and helpful library for you
Stars: ✭ 15 (-87.9%)
Mutual labels:  dom
emerj
Emerj is a tiny JavaScript library to render live HTML/DOM updates efficiently and non-destructively, by merging an updated DOM with the live DOM, and only changing those elements that differ.
Stars: ✭ 56 (-54.84%)
Mutual labels:  dom
dom-to-image-more
Generates an image from a DOM node using HTML5 canvas
Stars: ✭ 231 (+86.29%)
Mutual labels:  dom
modulor-html
Missing template engine for Web Components
Stars: ✭ 36 (-70.97%)
Mutual labels:  dom
PopUpOFF
Chrome extension, providing better web experience.
Stars: ✭ 65 (-47.58%)
Mutual labels:  dom
bassdrum
reactive, type safe components with preact and rxjs.
Stars: ✭ 44 (-64.52%)
Mutual labels:  dom
BowieCode
Personal Code/Snippet Library for Unity 3D
Stars: ✭ 23 (-81.45%)
Mutual labels:  inspector
colr pickr
Colr Pickr, a vanilla JavaScript color picker component built with SVGs, with features like saving colors. Similar design to the chrome-dev-tools color picker.
Stars: ✭ 27 (-78.23%)
Mutual labels:  chrome-dev
picoCSS
picoCSS - really small JavaScript Framework
Stars: ✭ 62 (-50%)
Mutual labels:  dom

DomInspector

Dom inspector like chrome dev tools.

Usage

Install dom-inspector

npm install dom-inspector --save
<script type="text/javascript" src="./dist/dom-inspector.min.js"></script>
const DomInspector = require('dom-inspector');
import DomInspector from 'dom-inspector';

New instance

const inspector = new DomInspector();

Instance options

const inspector = new DomInspector({
	root: 'body',
	exclude: ['#exclude>div', document.querySelector('.exclude')],
  theme: 'you-custom-theme-class',
  maxZIndex: '', // max z index, if blank, will auto get document.all max z index
});
  • root

    Dom inspector root element. String or Dom, default body.

  • exclude

    Not inspect some elements. String or Dom Array.

  • theme

    Inspector overlay style. You can custom overlay background color as follow.

     .you-custom-theme-class .margin {
     	background-color: blue;
     }
    
     .you-custom-theme-class .border {
     	background-color: red;
     }
    
     .you-custom-theme-class .padding {
     	background-color: green;
     }
    
     .you-custom-theme-class .content {
     	background-color: gray;
     }

    Don`t forget background color opacity. ^_^

Attribute list

  • inspector.target

    Inspecting element.

API list

  • inspector.enable()

    Display overlay block and addEventListener mousemove.

  • inspector.pause()

    RemoveEventListener mousemove, pause inspector.

  • inspector.disable()

    RemoveEventListener mousemove, display overlay none.

  • inspector.destroy()

    disable() and remove overlay.

  • inspector.getXPath([ele])

    Return ele XPath.

  • inspector.getSelector([ele])

    Return ele selector.

    html>body>div:nth-of-type(9)

  • inspector.getElementInfo([ele])

     return {
     	top: '',
     	left: '',
     	width: '',
     	height: '',
     	'padding-top': '',
     	'padding-right': '',
     	'padding-bottom': '',
     	'padding-left': '',
     	'border-top-width': '',
     	'border-right-width': '',
     	'border-bottom-width': '',
     	'border-left-width': '',
     	'margin-top': '',
     	'margin-right': '',
     	'margin-bottom': '',
     	'margin-left': ''
     };
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].