From 8dd16259287f58f9273002717ec4d27e97127719 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:43:14 +0200 Subject: Merging upstream version 127.0. Signed-off-by: Daniel Baumann --- dom/events/DataTransferItem.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'dom/events/DataTransferItem.cpp') diff --git a/dom/events/DataTransferItem.cpp b/dom/events/DataTransferItem.cpp index 8b1aa1902c..27bce8bd8b 100644 --- a/dom/events/DataTransferItem.cpp +++ b/dom/events/DataTransferItem.cpp @@ -76,6 +76,7 @@ already_AddRefed DataTransferItem::Clone( it->mData = mData; it->mPrincipal = mPrincipal; it->mChromeOnly = mChromeOnly; + it->mDoNotAttemptToLoadData = mDoNotAttemptToLoadData; return it.forget(); } @@ -144,7 +145,7 @@ void DataTransferItem::SetData(nsIVariant* aData) { } void DataTransferItem::FillInExternalData() { - if (mData) { + if (mData || mDoNotAttemptToLoadData) { return; } @@ -183,6 +184,11 @@ void DataTransferItem::FillInExternalData() { nsresult rv = clipboard->GetData(trans, mDataTransfer->ClipboardType(), windowContext); if (NS_WARN_IF(NS_FAILED(rv))) { + if (rv == NS_ERROR_CONTENT_BLOCKED) { + // If the load of this content was blocked by Content Analysis, + // do not attempt to load it again. + mDoNotAttemptToLoadData = true; + } return; } } else { -- cgit v1.2.3