While developing a Chrome extension and reading through the documentation found at https://developer.chrome.com/docs/extensions, I have seen the following syntax used and have been unable to find an explanation as to what the "info" or "tab" parameters(?) are for quite some time;
chrome.contextMenus.onClicked.addListener((info, tab) => {
"Info" and "tab" are then used like the below in various ways like they were a parent object or an interface;
var EncodedSelectedText = encodeURIComponent(info.selectionText).toString();
or
chrome.tabs.create({
url: 'https://example.com/path?fragment'+EncodedSelectedText, index: tab.index + 1
});
They are not part of an interface, per the list of interfaces found on MDN here: https://developer.mozilla.org/en-US/docs/Web/API#interfaces (Unless I am missing something?)
This must have a simple explanation that I have been unable to find. Please, if someone could provide a link to the documentation about this on MDN or some other authoritative resource, it would be so very helpful.