On Toolbar item click, I am opening a tab. For this task first i have to get refrence to an activeWindow. But SFSafariApplication's getActiveWindowWithCompletionHandler method not always returns active window and hence can't open a tab in safari always.
To solve this problem i have cached activeWindow object when validateToolbarItemInWindow method is executed and use cached activewindow object for opening a tab in the active window.
Also I have to cache activeTab object, so that i can send message to active tab's attached content script.
Any help would be appreciated.