request(action, data, callback) {
    const message = {
      action,
      data,
    };
    if (!chrome.runtime) {
      console.error("chrome.runtime is undefined.");
      callback?.();
    } else if (callback) {
      chrome.runtime.sendMessage(message, callback);
    } else {
      chrome.runtime.sendMessage(message);
    }
  }
Creates an event that the extension is listening for and will
asynchronously respond by calling the callback.

@param {string} action - The action to trigger.
@param {string} [data] - The data to send.
@param {Function} [callback] - Response callback that will be called with
  one data argument. When the request cannot be handled, the callback is
  immediately invoked with no arguments.