0

I'm struck in a project, I need to develop a project as agenty chrome extension, where it uses point and click css selector. First I have used iframe to display a site but I faced cross origin and security issues. Now I'm using object tag to display a site and I want to make like point and click css selector on a button click.

Here is my sample code

<!DOCTYPE html>
<html>
<head>
     <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
     <script type="text/javascript">
        $(function () {

            $('#dragit').click(function(){

                // make $("#dvSource") to point and click css selector
            });
        });
    </script>
</head>
<body>
 <input type="submit" id="dragit" value="DragValues" />
    <div id="dvSource">
        <object type="text/html" data="http://validator.w3.org/" width="100%" height="600px" id="test">
        </object>
    </div>
</body>
</html>

I have placed in div (dvSource) and I have a button with id dragit, once I click that button I want to make point and click css selector for dvSource content

לבני מלכה
  • 15,925
  • 2
  • 23
  • 47
Zabi
  • 37
  • 4
  • Why are you using iframe for Chrome extension? – Nerdi.org Apr 10 '18 at 04:45
  • @Nerdi.org no i need like agenty chrome extension (on a button click i need to make point and css selector), i'm not using chrome extension – Zabi Apr 10 '18 at 04:48
  • Possible duplicate of [How to pick element inside iframe using document.getElementById](https://stackoverflow.com/questions/14451358/how-to-pick-element-inside-iframe-using-document-getelementbyid) – Vishal Taj PM Apr 10 '18 at 04:55
  • refer this [post](https://stackoverflow.com/a/14451440/3422357) might be helpful for you. – Vishal Taj PM Apr 10 '18 at 04:58
  • @VishalTajPM You have misunderstood my requirement, i just need to apply point and click css selector on a button click – Zabi Apr 10 '18 at 05:08
  • @Zabi Point in the sense are you try to get `pixel position` from `window` if so it varies based `window` width.hence it not a solution for your requirement. – Vishal Taj PM Apr 13 '18 at 01:25

0 Answers0