Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sudheej opened this issue Sep 8, 2020 · 2 comments
Open

Comments

@sudheej
Copy link

sudheej commented Sep 8, 2020

@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();

    }
@luoye-fe
Copy link
Owner

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
Copy link
Owner

luoye-fe commented Nov 5, 2020

ping?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants