dexterouslogic / super-simple-highlighter

A chrome extension which highlights text on a web page, and attempts to restore it on returning
GNU General Public License v3.0
144 stars 55 forks source link

Issue on pages that have elements with ids that start with numbers #7

Open espspinix opened 6 years ago

espspinix commented 6 years ago

On version 3.12 I cannot add markers on some pages. The error I see in the console is: Uncaught DOMException: Failed to execute 'querySelectorAll' on 'Document': '#43ce' is not a valid selector. ( example page )

To me it seems that the error is here: https://github.com/dexterouslogic/super-simple-highlighter/blob/33570ddce39cb6ed4a9b199c92f99ad4aba5661e/js/content_script/xpath.js#L55 As document.querySelectorAll has problems identifying ids that start with numbers.

A proposed fix from stackoverflow: https://stackoverflow.com/a/20306237/4489917