There was, with using normal browser.runtime.onMessage/sendMessage, a race condition where the content script would sometimes load before the background script on extension startup and try to send it a message before its message listener had been added.
Using a port between the content script and background script eliminates this problem, as the content script is notified when it is connected with the background script and can then send and receive messages.
I also looked at the tooltip on several popular websites and added some neutralizing styles (and cleaned up the CSS block in background.js). One known shortcoming is tootip visibility when the match word is on a window boundary; depending on location it can be completely or partially obscured.
There was, with using normal browser.runtime.onMessage/sendMessage, a race condition where the content script would sometimes load before the background script on extension startup and try to send it a message before its message listener had been added.
Using a port between the content script and background script eliminates this problem, as the content script is notified when it is connected with the background script and can then send and receive messages.
I also looked at the tooltip on several popular websites and added some neutralizing styles (and cleaned up the CSS block in background.js). One known shortcoming is tootip visibility when the match word is on a window boundary; depending on location it can be completely or partially obscured.