GithubHelp home page GithubHelp logo

lookmark's Introduction

LookMark

A browser bookmark to show hidden and disabled elements on a targets page.

This was made with the help of ChatGPT in responses to this tweet from @ctbbpodcast and taking inspiration from an example by @joaxcar

Just create a browser bookmark, setting the URL to the code below. Then go to a target page and click the bookmark. Hidden elements will be shown and highlighted in red with an identifier, and Disabled fields will be enabled and highlighted in blue with an identifier.

javascript:document.querySelectorAll(':not(img):not(span):not(div)[disabled],:not(img):not(span):not(div)[disabled=""]').forEach((e) => {const src = e.getAttribute("src"); if (src && !/googletagmanager|doubleclick|google-analytics/.test(src)) {e.disabled = false; e.style.cssText = "border-color: blue; border-width: 3px"; const d = document.createElement("div"); const elementType = e.getAttribute("type") || e.tagName; const elementName = e.getAttribute("name") || e.getAttribute("id"); d.innerHTML = `<span style="color: blue;">Disabled ${elementType} [${elementName}]  </span>`; e.parentNode.insertBefore(d, e).appendChild(e); } });document.querySelectorAll(":not(img):not(span):not(div)[type=hidden],:not(img):not(span):not(div)[hidden]").forEach((e) => {const src = e.getAttribute("src"); if (!src || !/googletagmanager|doubleclick|google-analytics/.test(src)) {e.type = "text"; e.style.cssText = "border-color: red; border-width: 3px"; const d = document.createElement("div"); const elementType = e.getAttribute("type") || e.tagName; const elementName = e.getAttribute("name") || e.getAttribute("id"); d.innerHTML = `<span style="color: red;">Hidden ${elementType} [${elementName}]  </span>`; e.parentNode.insertBefore(d, e).appendChild(e); } });document.querySelectorAll(':not(img):not(span):not(div)[style*="display: none;"]').forEach((e) => {const src = e.getAttribute("src"); if (!src || !/googletagmanager|doubleclick|google-analytics/.test(src)) {e.type = "text"; e.style.cssText = "border-color: red; border-width: 3px"; e.style.display = "block"; const d = document.createElement("div"); const elementType = e.getAttribute("type") || e.tagName; const elementName = e.getAttribute("name") || e.getAttribute("id"); d.innerHTML = `<span style="color: red;">Hidden ${elementType} [${elementName}]  </span>`; e.parentNode.insertBefore(d, e).appendChild(e); } });document.querySelectorAll(':not(img):not(span):not(div)[style*="visibility: hidden;"]').forEach((e) => {const src = e.getAttribute("src"); if (!src || !/googletagmanager|doubleclick|google-analytics/.test(src)) {e.type = "text"; e.style.cssText = "border-color: red; border-width: 3px"; e.style.visibility = "visible"; const d = document.createElement("div"); const elementType = e.getAttribute("type") || e.tagName; const elementName = e.getAttribute("name") || e.getAttribute("id"); d.innerHTML = `<span style="color: red;">Hidden ${elementType} [${elementName}]  </span>`; e.parentNode.insertBefore(d, e).appendChild(e); } });

NOTES:

  • When showing hidden elemetns, it looks for attributes hidden, type=hidden, style*="display: none; or visibility: hidden;.
  • When enabling disabled elements, it looks for attributes disabled or disabled="".
  • The following types of elements are ignored <img>,<span> and <div> using the code :not(img):not(span):not(div). If you want to check those, or add more exclusions, this is the code you need to change.
  • If an element has a src attribute and it includes the text googletagmanager, doubleclick or google-analytics then it will be ignored. This is donw withthe code !/googletagmanager|doubleclick|google-analytics/.test(src)`. If you want to change that or ad more exlcusions, this is the code you need to change.

lookmark's People

Contributors

xnl-h4ck3r avatar

Stargazers

 avatar 5gyTwv8RpYZd5jE0J0QJx4WHG4e6oRRcDqIcREq2zxnuu8CMfhxFhsusSStlq3ibELlqRTVWsxulfHzV2K0EQb9xjtuPzNjnvVW avatar n1sh1th avatar 0xrz avatar itsallpretend avatar m1tz avatar Keith Hoodlet avatar  avatar  avatar  avatar Sourav Kalal avatar kleozzy avatar Khaled Mohamed avatar Betillø Galvan avatar AmirJr avatar  avatar Solomon Sklash avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.