Currently, we use multiple functions that call sendMessage just with different action. So make the code cleaner, the goal is to merge all the functions into one function that takes the following arguments:
action as a string to call different listeners
currentTab as a tab object to use the id of the currentTab in the sendMessage function
args as an object with additional information for the specific use case
Additionally, we can merge the listeners into one big listener with a switch case for the different actions, so only one listener per file should be needed. Possibly change single-time requests into a long-lived connections
Currently, we use multiple functions that call
sendMessagejust with different action. So make the code cleaner, the goal is to merge all the functions into one function that takes the following arguments:actionas a string to call different listenerscurrentTabas a tab object to use the id of the currentTab in thesendMessagefunctionargsas an object with additional information for the specific use caseAdditionally, we can merge the listeners into one big listener with a switch case for the different actions, so only one listener per file should be needed. Possibly change single-time requests into a long-lived connections