I’m developing a Safari App Extension. My goal would be that to have an item added to the contextual menu ONLY if certain conditions are satisfied. In particular I would like to have my item appear only when right clicking on a specific type of HTML element.
I know how to add an item to the contextual menu, by defyining it in the Info.plist of my extension.
I know how to detect if the contextual menu will appear, in the JavaScript code of my extension.
I also know how to check if my desired condition is satisfied or not.
But I don’t know how to prevent my item from appearing in the contextual menu. Is it possible to do?