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.
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.