GoogleChromeLabs / link-to-text-fragment

Browser extension that allows for linking to arbitrary text fragments.
https://chrome.google.com/webstore/detail/link-to-text-fragment/pbcodcjpfjdpcineamnnmbkkmkdpajjg
Apache License 2.0
412 stars 33 forks source link

Issues. #82

Closed ghost closed 1 year ago

ghost commented 1 year ago

The sendMessageToPage function is not defined anywhere in the code, which may cause a reference error.

The catch block in the injectContentScripts function does not have a parameter, which means that it will catch any error, including those not related to the sendMessageToPage function. It would be better to give it a parameter and check if the error is related to the sendMessageToPage function before proceeding.

The code uses console.log to log messages, which is not recommended for production code. It would be better to use an appropriate logging library or to remove the logs altogether.

The catch block in the polyfillTextFragments function does not have a parameter, which means that it will catch any error, including those not related to the askForAllOriginsPermission function. It would be better to give it a parameter and check if the error is related to the askForAllOriginsPermission function before proceeding.