Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverts Chromium's [Clipboard API] Remove user gesture requirement fo… #14901

Merged
merged 1 commit into from
Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* Copyright (c) 2022 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at https://mozilla.org/MPL/2.0/. */

#include "third_party/blink/renderer/modules/clipboard/clipboard_promise.h"

#define BRAVE_CLIPBOARD_PROMISE_REQUEST_PERMISSION \
false); \
if (

#include "src/third_party/blink/renderer/modules/clipboard/clipboard_promise.cc"
#undef BRAVE_CLIPBOARD_PROMISE_REQUEST_PERMISSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/third_party/blink/renderer/modules/clipboard/clipboard_promise.cc b/third_party/blink/renderer/modules/clipboard/clipboard_promise.cc
index 232be5f18146d7e54aa41c34fb2f1d4da97c261a..5d678d5c4d57faedf507543939b958bd5ca4c6b4 100644
--- a/third_party/blink/renderer/modules/clipboard/clipboard_promise.cc
+++ b/third_party/blink/renderer/modules/clipboard/clipboard_promise.cc
@@ -550,6 +550,7 @@ void ClipboardPromise::RequestPermission(
// Currently NTP relies on readText & writeText to be called without any user
// gesture.
if (allow_without_sanitization &&
+ BRAVE_CLIPBOARD_PROMISE_REQUEST_PERMISSION
RuntimeEnabledFeatures::ClipboardCustomFormatsEnabled() &&
!has_transient_user_activation) {
script_promise_resolver_->Reject(MakeGarbageCollected<DOMException>(