mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-22 11:45:59 +01:00
Merge pull request #1399 from bitwarden/fix/no-autofill-from-pinned-tab-in-safari
Potential fix for pinned tab auto-fill in Safari
This commit is contained in:
commit
af0891fb03
@ -70,11 +70,26 @@ func makeSenderTabObject(page: SFSafariPage, props: SFSafariPageProperties?, com
|
||||
t.url = props?.url?.absoluteString
|
||||
page.getContainingTab { tab in
|
||||
tab.getContainingWindow(completionHandler: { win in
|
||||
win?.getActiveTab(completionHandler: { activeTab in
|
||||
guard let window = win else {
|
||||
t.active = false;
|
||||
t.windowId = -100
|
||||
SFSafariApplication.getAllWindows(completionHandler: { allWins in
|
||||
if (allWins.count == 0) {
|
||||
return
|
||||
}
|
||||
allWins[0].getAllTabs { allWinTabs in
|
||||
t.index = allWinTabs.firstIndex(of: tab) ?? -1
|
||||
t.id = "\(t.windowId)_\(t.index)"
|
||||
complete(t)
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
window.getActiveTab(completionHandler: { activeTab in
|
||||
t.active = activeTab != nil && tab == activeTab
|
||||
SFSafariApplication.getAllWindows(completionHandler: { allWins in
|
||||
t.windowId = allWins.firstIndex(of: win!) ?? -100
|
||||
win!.getAllTabs { allWinTabs in
|
||||
t.windowId = allWins.firstIndex(of: window) ?? -100
|
||||
window.getAllTabs { allWinTabs in
|
||||
t.index = allWinTabs.firstIndex(of: tab) ?? -1
|
||||
t.id = "\(t.windowId)_\(t.index)"
|
||||
complete(t)
|
||||
|
Loading…
Reference in New Issue
Block a user