@@ -3,40 +3,48 @@ var lastElementData = {}
3
3
var lastParentElem = null
4
4
var lastParentData = { }
5
5
6
+ let cleanXPaths = [ ]
7
+
6
8
7
9
let bodyElem = document . getElementsByTagName ( 'body' ) [ 0 ]
8
10
let bodyInner = bodyElem . innerHTML
9
11
bodyElem . innerHTML = ''
10
12
11
- let container = document . createElement ( 'div' )
12
- container . style . display = "flex"
13
- container . style . flexFlow = "row"
14
- let menuContainer = document . createElement ( 'div' )
15
- menuContainer . style . width = '300px'
16
- menuContainer . style . minWidth = '300px'
17
- menuContainer . style . height = '600px'
18
- menuContainer . style . minHeight = '600px'
19
- let page = document . createElement ( 'div' )
20
- page . id = 'super-selector'
21
- page . style . width = '100%'
22
- page . style . height = '100%'
23
- page . innerHTML = bodyInner
24
-
25
- let menu = document . createElement ( 'div' )
26
- menu . id = "slector-main-menu"
27
- menu . style . width = '300px'
28
- menu . style . minWidth = '300px'
29
- menu . style . height = '600px'
30
- menu . style . minHeight = '600px'
31
- menu . style . backgroundColor = 'black'
32
- menu . style . position = 'fixed'
33
- menu . style . top = '0'
34
-
35
-
36
- container . appendChild ( menuContainer )
37
- container . appendChild ( page )
38
- bodyElem . appendChild ( container )
39
- bodyElem . appendChild ( menu )
13
+ // let container = document.createElement('div')
14
+ // container.style.display = "flex"
15
+ // container.style.flexFlow = "row"
16
+ // let menuContainer = document.createElement('div')
17
+ // menuContainer.style.width = '300px'
18
+ // menuContainer.style.minWidth = '300px'
19
+ // menuContainer.style.height = '600px'
20
+ // menuContainer.style.minHeight = '600px'
21
+ // let page = document.createElement('div')
22
+ // page.id= 'super-selector'
23
+ // page.style.width = '90%'
24
+ // page.style.height = '90%'
25
+ // page.innerHTML = bodyInner
26
+
27
+ // let menu = document.createElement('div')
28
+ // menu.id = "slector-main-menu"
29
+ // menu.style.width = '300px'
30
+ // menu.style.minWidth = '300px'
31
+ // menu.style.height = '600px'
32
+ // menu.style.minHeight = '600px'
33
+ // menu.style.backgroundColor = 'black'
34
+ // menu.style.position = 'fixed'
35
+ // menu.style.top = '0'
36
+
37
+
38
+ // container.appendChild(menuContainer)
39
+ // container.appendChild(page)
40
+ // bodyElem.appendChild(container)
41
+ // bodyElem.appendChild(menu)
42
+
43
+ bodyElem . innerHTML = `<div style="width: 100%;">
44
+ <div id="super-selector" style="max-width:75%; position: absolute;">${ bodyInner } '</div>
45
+ <div id="slector-main-menu" style="width:25%; min-width: 300px; height: 100%; right: 0; position: fixed;">MENU</div>
46
+ </div>`
47
+
40
48
41
49
document . getElementById ( 'super-selector' ) . addEventListener ( 'mousemove' , ( e ) => {
42
50
// document.getElementsByTagName('body')[0].addEventListener('mousemove', (e) => {
@@ -67,6 +75,11 @@ document.getElementById('super-selector').addEventListener('mousemove', (e) => {
67
75
68
76
// console.log(createXPathFromElement(clickedElem));
69
77
78
+ ///
79
+ let tmpElem = document . createElement ( 'div' )
80
+ tmpElem . innerText = createXPathFromElement ( clickedElem ) ;
81
+ document . getElementById ( 'slector-main-menu' ) . appendChild ( tmpElem )
82
+
70
83
let clickedElemParent = clickedElem . parentNode ;
71
84
let foundClickedEleme = false
72
85
while ( clickedElemParent ) {
0 commit comments