commit 9b41e228aff33b76faafd056552e683520dbcb16
parent 7d8f2f3bf7286c5dda789423e0c3a9e1e11d605b
Author: cypherpunks1 <2478-cypherpunks1@gitlab.torproject.org>
Date: Mon, 3 Jul 2023 12:46:58 -0800
BB 41791: Omit the source URL when copying page contents to the clipboard
Diffstat:
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/dom/base/nsCopySupport.cpp b/dom/base/nsCopySupport.cpp
@@ -292,6 +292,7 @@ static nsresult CreateTransferable(
NS_ENSURE_SUCCESS(rv, rv);
}
+#if !defined(BASE_BROWSER_VERSION)
// Try and get source URI of the items that are being dragged
nsIURI* uri = aDocument.GetDocumentURI();
if (uri) {
@@ -312,6 +313,7 @@ static nsresult CreateTransferable(
NS_ENSURE_SUCCESS(rv, rv);
}
}
+#endif
} else {
if (!aEncodedDocumentWithContext.mSerializationForTextPlain.IsEmpty()) {
// Add the unicode DataFlavor to the transferable
diff --git a/widget/windows/nsDataObj.cpp b/widget/windows/nsDataObj.cpp
@@ -526,11 +526,13 @@ nsDataObj::nsDataObj(nsIURI* uri)
m_enumFE = new CEnumFormatEtc();
m_enumFE->AddRef();
+#if !defined(BASE_BROWSER_VERSION)
if (uri) {
// A URI was obtained, so pass this through to the DataObject
// so it can create a SourceURL for CF_HTML flavour
uri->GetSpec(mSourceURL);
}
+#endif
}
//-----------------------------------------------------
// destruction
@@ -1994,6 +1996,7 @@ nsresult nsDataObj ::BuildPlatformHTML(const char* inOurHTML,
*outPlatformHTML = nullptr;
nsDependentCString inHTMLString(inOurHTML);
+#if !defined(BASE_BROWSER_VERSION)
// Do we already have mSourceURL from a drag?
if (mSourceURL.IsEmpty()) {
nsAutoString url;
@@ -2001,6 +2004,7 @@ nsresult nsDataObj ::BuildPlatformHTML(const char* inOurHTML,
AppendUTF16toUTF8(url, mSourceURL);
}
+#endif
constexpr auto kStartHTMLPrefix = "Version:0.9\r\nStartHTML:"_ns;
constexpr auto kEndHTMLPrefix = "\r\nEndHTML:"_ns;