Extension crashes Firefox when trying to find ToS;DR for tosdr.org
Closed this issue · 5 comments
When I attempt to open the extension while on tosdr.org, Firefox crashes.
I'm using Firefox 63.0.3 on Mac. I also get the spinner, but once I click off or close the pop-up, it instantly crashes.
I also just updated to Firefox 64 to check if that fixed the issue, but it still crashes.
This is caused by invoking an invalid CSS selector due to the semicolon in the ToS;DR
service name concatenated in the query selector expressions used with jQuery in popup.js
I encounter this on the Chrome extension on this page: https://edit.tosdr.org/
It's likely the same issue with Firefox.
As an example: try to run this query selector command in plain JS in any page to observe the error.
document.querySelector('#popup-point-ToS;DR-4518')
// VM26:1 Uncaught DOMException: Failed to execute 'querySelector' on 'Document': '#popup-point-ToS;DR-4518' is not a valid selector.
// at <anonymous>:1:10
The getServiceDetails()
promise does not catch the error thrown by tosdrPoint()
, so the popup document remains stuck in the "loading" state.
Perhaps the serviceName
should be sanitized when generating the element ID & querying for it. Or maybe dropping the serviceName
altogether from the element ID if there's no real need for that distinction in the popup.html
. The dataPoint.id
should suffice to serve as a unique ID that's unique per service and services shown one at a time in the popup, right?
Fixed in 89e5689