getFocusedPrimaryTabId()

Returns the ID of the primary tab on which the browser is focused. This method is only available in API version 25.0 or later.

NameTypeDescription
callbackfunctionJavaScript method that’s called upon completion of the method.

This method is asynchronous so it returns its response in an object in a callback method. The response object contains the following fields:

NameTypeDescription
idstringThe ID of the primary tab on which the browser is focused. If no primary tab is open, the ID is null.
successbooleantrue if returning the primary tab ID on which the browser is focused was successful; false if returning the primary tab ID on which the browser is focused wasn’t successful.