dom-inspector icon indicating copy to clipboard operation
dom-inspector copied to clipboard

Get target element id of a page in same domain in iframe during inspect

Open sudheej opened this issue 5 years ago • 2 comments

@luoye-fe Thanks for this wonderful module, I am trying to get element details of inspected id's inside an iframe, as of version 1.2.3 inspector is working fine inside the iframe, how do I identify the element details as I hover over them in the iframe.

this is what I have

    document.getElementById("iframe").onload = () => {
      const inspector = new DomInspector({
        // get iframe element by `contentWindow`
        root: document.getElementById("iframe").contentWindow.document.querySelector('body'),
        //exclude: ['#exclude>iframe', document.querySelector('.exclude')],
        maxZIndex: 99
      });

      inspector.enable();

    }

sudheej avatar Sep 08 '20 20:09 sudheej

Thank you for using this moudle.

Bind mouseover or click event on element, then when the event is triggered, get element details from inspector.target. Or direct use event.currentTarget & event.target gain the element.

luoye-fe avatar Sep 10 '20 07:09 luoye-fe

ping?

luoye-fe avatar Nov 05 '20 04:11 luoye-fe