chrome.windows.getLastFocused appears incorrect |
|
Issue description
// The WindowControllerList should contain a list of application,
// browser and devtools windows.
WindowController* controller = nullptr;
for (auto* iter : WindowControllerList::GetInstance()->windows()) {
if (windows_util::CanOperateOnWindow(this, iter,
extractor.type_filters())) {
controller = iter; << ?????
if (controller->window()->IsActive())
break; // Use focused window.
}
}
From https://chromium.googlesource.com/chromium/src/+/5859322791875be6f682139f736a090b58339c55/chrome/browser/extensions/api/tabs/tabs_api.cc
It appears that in the for loop above, if there was no last focused window, we'd return whichever was last in the loop. From a quick experiment, this seems to be the case.
,
Aug 2
Finally, someone noticed this function is broken... :) I reported this issue almost 3 years ago: https://crbug.com/546696 |
|
►
Sign in to add a comment |
|
Comment 1 by sriram...@samsung.com
, Feb 13 2018