question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Root element ignored in options, full path returned

See original GitHub issue

Context page : http://histo.io

Code to execute in order to test it (x = 165, y = 305):

function testCase(x, y) {
  const root = document.querySelector('nav > ul > li > ul');
  const result = CssSelectorGenerator.getCssSelector(document.elementFromPoint(x, y), { blacklist: ['[href=*]', '[src=*]'], root: root });
  console.log(result);
  // :root > :nth-child(2) > :nth-child(4) > :nth-child(2) > :nth-child(1) > :nth-child(1) > :nth-child(2) > :nth-child(5) > :nth-child(1);
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
lilacdevcommented, Aug 26, 2021

You’re absolutely right. I noticed that some generated selectors are now shorter than before 😃.

Thank you for your efforts.

1reaction
lilacdevcommented, Aug 25, 2021

Thanks for quick reply. Unfortunately error still here (I doubled checked I was using version 3.4.1).

EDIT : I checked with the exact same test case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does node's path.resolve allow but ignore multiple root ...
Now that we have resolved and got our absolute path we can ignore the other parameters present and return /bar/baz.
Read more >
Path | Node.js v19.3.0 Documentation
The path.parse() method returns an object whose properties represent significant elements of the path . Trailing directory separators are ignored, see path.sep ...
Read more >
Path.Combine Method (System.IO) - Microsoft Learn
If one of the specified paths is a zero-length string, this method returns the other path. If path2 contains an absolute path, this...
Read more >
os.path — Common pathname manipulations — Python 3.11 ...
Return the longest common sub-path of each pathname in the sequence paths. Raise ValueError if paths contain both absolute and relative pathnames, the...
Read more >
isaacs/node-glob: glob functionality for node.js - GitHub
root The place where patterns starting with / will be mounted onto. Defaults to path.resolve(options.cwd, "/") ( / on Unix systems, and C:\...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found