BackgroundScript > ContentScript keeps giving a 'key length' warning and not running any code

After multiple rewrites and different attempts, using ports, or simple messages, page/browser actions or menu’s: i keep getting a warning in the console:

image
“browser.ui.interaction.content_context - The key length must be limited to 72 characters.”

and the code never runs:

image
(Note: This is not the original code i wrote, as i have rewritten and deleted it so many times, its a skeleton of what it once was)

It used to work, is the weird thing, then i added two lines of code to the background script, and then it stopped. Reverting didn’t fix it.

From the error description I’d assume the issue is with the context menu item and not the communication to the background script. Have you tried to see if the onClicked handler ever gets called?

Note that your warning is unrelated to the extension and comes from the telemetry system.

Edit: why do you query for a tab when you already get a tab in the onClicked listener? Seems like unnecessary complication.

The error only appears once i click a menu option.

Left over from a previous iteration where i had it send a message two ways, forgot about it honestly.

I’ll reiterate, the warning you included is not related to your extension. And my question was if you’ve seen any code being executed in the onClicked handler at all from your context menu item. Like for example a console.log.

I see. No, nothing gets executed since it stopped working originally.