Chrome extension API documentation: how callbacks are called? -
in chrome api extensions lots of methods take "callback" argument. majority of methods it's not documented when callbacks called. example, chrome.tabs.remove takes callback reads:
if specify callback parameter, should specify function looks this: function() {...}; this documentation have. given documentation, how can figure if callback called once after tabs removed, or after each tab removed? based on answer, need write different code. maybe it's "general" documentation sections callback in chrome api, "callbacks called once after operation complete if otherwise not specified". or no 1 uses api , no 1 cares documentation?
from the overview page:
most methods in chrome.* apis asynchronous: return immediately, without waiting operation finish. if need know outcome of operation, pass callback function method.
the implied information here callbacks called when information completed operation available passed callback. when , what information available varies operation operation.
callbacks called once all of relevant work has been done, tabs.remove callback called once specified tabs closed.
Comments
Post a Comment