All Projects → captainbrosset → devtools-highlighter

captainbrosset / devtools-highlighter

Licence: MPL-2.0 license
DevTools extension that finds and highlights elements in the page

Programming Languages

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

Projects that are alternatives of or similar to devtools-highlighter

Ply
CSS inspection aided by visual regression pruning
Stars: ✭ 370 (+1175.86%)
Mutual labels:  inspector, devtools
InAppDevTools
Android library with a collection of tools for debugging, inspecting and reporting from within your own app
Stars: ✭ 26 (-10.34%)
Mutual labels:  inspector, devtools
Rawkit
🦊 Immediately Open Chrome DevTools when debugging Node.js apps
Stars: ✭ 306 (+955.17%)
Mutual labels:  inspector, devtools
React Inspect Props
React properties inspector with the power of Redux DevTools
Stars: ✭ 31 (+6.9%)
Mutual labels:  inspector, devtools
prosemirror-dev-toolkit
Injectable developer tools for ProseMirror rich-text editors implemented in Svelte and TypeScript.
Stars: ✭ 44 (+51.72%)
Mutual labels:  inspector, devtools
Portal
A clojure tool to navigate through your data.
Stars: ✭ 239 (+724.14%)
Mutual labels:  inspector, devtools
Nim
Streamline Your Node.js Debugging Workflow with Chromium (Chrome, Edge, More) DevTools.
Stars: ✭ 168 (+479.31%)
Mutual labels:  inspector, devtools
mdebug
基于React开发的新一代web调试工具,支持React组件调试,类似于Chrome Devtools。A Lightweight, Easy To Extend Web Debugging Tool Build With React
Stars: ✭ 237 (+717.24%)
Mutual labels:  inspector, devtools
linkedin connect
Configurable and easy to use LinkedIn tool to automate connections with personalized messages.
Stars: ✭ 58 (+100%)
Mutual labels:  devtools
rkubelog
Send k8s Logs to Papertrail and Loggly Without DaemonSets (for Nodeless Clusters)
Stars: ✭ 15 (-48.28%)
Mutual labels:  devtools
intuit-spring-cloud-config-inspector
Inspection of Spring Cloud Config properties made easy using React
Stars: ✭ 18 (-37.93%)
Mutual labels:  inspector
httplab
The interactive web server
Stars: ✭ 3,856 (+13196.55%)
Mutual labels:  inspector
proposal-debugger-operands
Adding an optional operand to the DebuggerStatement production of JS
Stars: ✭ 13 (-55.17%)
Mutual labels:  devtools
BowieCode
Personal Code/Snippet Library for Unity 3D
Stars: ✭ 23 (-20.69%)
Mutual labels:  inspector
exlcode-chrome
EXLcode - VS Code-based Online IDE Chrome Extension
Stars: ✭ 18 (-37.93%)
Mutual labels:  devtools
hanzo
Ansible orchestration to configure a development environment -
Stars: ✭ 22 (-24.14%)
Mutual labels:  devtools
wurl
WebSocket curl - The WebSocket CLI for developers
Stars: ✭ 21 (-27.59%)
Mutual labels:  devtools
ScriptableObjectVariant
Unity Odin editor helper which permits to set a "SOVariant" attribute to a ScriptableObject and override, or not, certain fields (similar to prefab variants but for scriptable objects).
Stars: ✭ 30 (+3.45%)
Mutual labels:  inspector
chrome-trace
Process Chrome trace logs in Node.
Stars: ✭ 15 (-48.28%)
Mutual labels:  devtools
dom-inspector
Dom inspect like chrome dev tools.
Stars: ✭ 124 (+327.59%)
Mutual labels:  inspector

What is this?

This is the code for a browser DevTools extension that works in Firefox and Chrome.

This extension adds a new panel to the toolbox. The panel allows users to search for nodes in the current page.

Usage documentation

There are 2 ways to search within the panel:

  • By using computed style queries.
  • Or by using CSS selectors.

Computed style queries

This is the main feature of this extension. It is very useful for finding elements on a page that have certain CSS computed styles.

For example, say you want to list all of the CSS grids on a page. You can use this query to do this display:grid.

The extension will simply loop through all elements on the page and only display the ones that do have their CSS computed display value set to grid.

You can also use a couple of operators to make searching more useful:

  • display:!block will find all elements that have a display value other than block.
  • display:~flex will find all elements that have a display value that includes the substring flex. So it will match elements that have it set to inline-flex and flex.

The extension also supports descendant queries. That means you can find elements that have a given style and that are descendant of elements that have another given style.

For instance display:flex align-self:start will find all elements with align-self set to start and that are descendants of a display:flex element.

CSS selector queries

This is a more traditional way to search for elements in the page but can be useful too.

With this feature, you can simply type any CSS selector that would work with document.querySelectorAll and the matching elements will be listed and highlighted.

Using the results

Once a search has returned results, they are displayed in the panel and they are all highlighted in the page too.

Hovering over a single result will highlight only the corresponding element.

It is also possible to scroll elements into view or select them in the inspector panel by clicking on corresponding links.

Browser support

The code for this extension has been made compatible with Firefox and Chrome (it uses WebExtension APIs so should, in theory, work with any browser that has support for them). However, the extension has only been made available for installation via the Mozilla Add-On website (so for only Firefox only).

Helping!

So you want to help? Awesome!

Here are a few ways you can do that:

  • You have an idea for a new feature: please describe it in a new issue.
  • You have found a bug while using the extension: describing it in a new issue would help a lot!
  • You have found a typo, grammar error, or something that needs rephrasing in this documentation: great, fixing it will make it easier for other people to contribute in the future. See the contribution guide below.
  • You know JavaScript, HTML and CSS and you want to improve the code, add a new feature or fix a bug? Even better! See the contribution guide below.

Contributing code and documentation changes

This extension is written in JavaScript, with little bits of HTML and CSS, so you will need to be comfortable with those languages before starting.

There is absolutely no other pre-requisites or any other software to install. The only thing you will need is the Firefox web browser, and at least version 57.

We don't yet have documentation for working on the extension in the Google Chrome browser.

Getting the code

That's it! You have the code now.

Running the extension locally in Firefox

  • Start Firefox.
  • In the URL bar, type about:debugging.
  • Make sure you are on the Add-ons tab.
  • Press the Load Temporary Add-on button.
  • A file explorer window should appear, in it, navigate to where you created the clone of the code.
  • Select the src/manifest.json file and open.

That's it! Now if you open a new tab on any site, and open DevTools, you should see the extension in the toolbox.

Making changes and reloading those changes in Firefox

Now that you are set up with the development environment, you can start making changes to the code. To see those changes appear in Firefox, you will need to do the following:

  • Close DevTools.
  • Go back to about:debugging.
  • Under where it says devtools-highlighter you will see 3 links. Click on the link that says Reload.
  • Go back to your test tab, reload it (so the content script is reloaded), and open DevTools again.

That's it! You should now see your changes.

Running the extension locally in Chrome

  • Start Chrome.
  • In the URL bar, type chrome://extensions.
  • Switch the developer mode ON.
  • Click on the Load unpacked extension button.
  • A file explorer window should appear, in it, navigate to where you created the clone of the code.
  • Select the src/manifest.json file and open.

That's it! Now if you open a new tab on any site, and open DevTools, you should see the extension in the toolbox.

Making changes and reloading those changes in Chrome

Same as with Firefox, if you make changes to the code and want to reload the extension, do the following:

  • Close DevTools.
  • Go back to the chrome://extensions tab.
  • Under where it says devtools-highlighter click on the little circular arrows button to reload the extension.
  • Go back to your test tab, reload it (so the content script is reloaded), and open DevTools again.

That's it!

Submitting code changes to this repository

Simply open a pull request and I'll try to review it quickly.

Building the extension

This isn't necessary for working on the extension locally. This is needed only for deploying the extension to AMO.

  • Make sure to install the dependencies first npm install
  • Then run the build script with npm run build

Technical documentation

Very much needed. In particular explaining what each scope is responsible for would be nice.

Getting in touch

The best place to chat about this extension is on the DevTools Slack, in the #addons channel. Ping @pbro.

License

MPL 2

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].