Commit d63a9f07 authored by cypherpunks1's avatar cypherpunks1 Committed by jwilde
Browse files

BB 41791: Omit the source URL when copying page contents to the clipboard

parent ee774018
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -290,6 +290,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) {
@@ -310,6 +311,7 @@ static nsresult CreateTransferable(
        NS_ENSURE_SUCCESS(rv, rv);
      }
    }
#endif
  } else {
    if (!aEncodedDocumentWithContext.mSerializationForTextPlain.IsEmpty()) {
      // Add the unicode DataFlavor to the transferable
+4 −0
Original line number Diff line number Diff line
@@ -525,11 +525,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
@@ -1993,6 +1995,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;
@@ -2000,6 +2003,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;