Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 60a23fece1e23532c2ca54b921180dbd7f076572
      
https://github.com/WebKit/WebKit/commit/60a23fece1e23532c2ca54b921180dbd7f076572
  Author: Timothy Hatcher <[email protected]>
  Date:   2024-11-06 (Wed, 06 Nov 2024)

  Changed paths:
    M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionContextCocoa.mm
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIWindows.mm

  Log Message:
  -----------
  windows.getLastFocused() returns error when last focused window is incognito 
without access.
https://webkit.org/b/282703
rdar://138030992

Reviewed by Brian Weinstein.

When retrieving the most recently focused window, iterate through all windows 
and return the
first one that the extension has access to. This approach will bypass any 
private windows if
the extension does not have access to private data.

* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionContextCocoa.mm:
(WebKit::WebExtensionContext::frontmostWindow const): Added loop over all 
windows.
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIWindows.mm:
(TestWebKitAPI::TEST(WKWebExtensionAPIWindows, GetCurrentWindowAfterTabMove)): 
Added.
(TestWebKitAPI::TEST(WKWebExtensionAPIWindows, 
GetLastFocusedWithPrivateAccess)): Added.
(TestWebKitAPI::TEST(WKWebExtensionAPIWindows, 
GetLastFocusedWithoutPrivateAccess)): Added.

Canonical link: https://commits.webkit.org/286245@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to