[webkit-changes] [WebKit/WebKit] 761708: WebExtensionContext::requestPermissions needs to i...

Timothy Hatcher noreply at github.com
Tue Mar 12 09:43:29 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 76170850b6e90c8640ed83bac975a365972c5679
      https://github.com/WebKit/WebKit/commit/76170850b6e90c8640ed83bac975a365972c5679
  Author: Timothy Hatcher <timothy at apple.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionContextCocoa.mm
    M Source/WebKit/UIProcess/Extensions/WebExtensionContext.h

  Log Message:
  -----------
  WebExtensionContext::requestPermissions needs to ignore denied permissions.
https://webkit.org/b/270857
rdar://problem/124457612

Reviewed by Jeff Miller.

Currently these request methods use hasPermission(), but that isn't correct since if
the permission is denied we shouldn't request it. Add new needsPermission() methods
that return true only if the permission is requested.

* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionContextCocoa.mm:
(WebKit::WebExtensionContext::requestPermissionMatchPatterns): Use needsPermission().
(WebKit::WebExtensionContext::requestPermissionToAccessURLs): Ditto.
(WebKit::WebExtensionContext::requestPermissions): Ditto.
(WebKit::WebExtensionContext::needsPermission): Added.
* Source/WebKit/UIProcess/Extensions/WebExtensionContext.h:
(WebKit::WebExtensionContext::needsPermission): Added.

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



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list