summaryrefslogtreecommitdiff
path: root/dom
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-10-22 07:49:59 +0000
committerMoonchild <moonchild@palemoon.org>2022-04-01 16:05:02 +0200
commit7c90c0205cd9fda52caf0d6b2a42f8a53c6fba37 (patch)
treec0034e58dac5a1c42be6124f22b314a0e999922d /dom
parenta95439db61c4530afae3967e2912d6ca38f1bbda (diff)
downloaduxp-7c90c0205cd9fda52caf0d6b2a42f8a53c6fba37.tar.gz
Issue #1822 - Part 4: Remove URL classifier and internal blocklist errors.
This removes NS_ERROR_{TRACKING|MALWARE|PHISHING|UNWANTED|BLOCKED}_URI that are no longer in use.
Diffstat (limited to 'dom')
-rw-r--r--dom/base/nsImageLoadingContent.cpp20
-rw-r--r--dom/base/nsObjectLoadingContent.cpp29
-rw-r--r--dom/browser-element/BrowserElementChildPreload.js9
-rw-r--r--dom/html/HTMLMediaElement.cpp9
-rw-r--r--dom/script/ScriptLoader.cpp10
5 files changed, 1 insertions, 76 deletions
diff --git a/dom/base/nsImageLoadingContent.cpp b/dom/base/nsImageLoadingContent.cpp
index 1226ef22e1..fecd995d72 100644
--- a/dom/base/nsImageLoadingContent.cpp
+++ b/dom/base/nsImageLoadingContent.cpp
@@ -175,25 +175,7 @@ nsImageLoadingContent::Notify(imgIRequest* aRequest,
if (aType == imgINotificationObserver::LOAD_COMPLETE) {
uint32_t reqStatus;
aRequest->GetImageStatus(&reqStatus);
- /* triage STATUS_ERROR */
- if (reqStatus & imgIRequest::STATUS_ERROR) {
- nsresult errorCode = NS_OK;
- aRequest->GetImageErrorCode(&errorCode);
-
- /* Handle image not loading error because source was a tracking URL.
- * We make a note of this image node by including it in a dedicated
- * array of blocked tracking nodes under its parent document.
- */
- if (errorCode == NS_ERROR_TRACKING_URI) {
- nsCOMPtr<nsIContent> thisNode
- = do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
-
- nsIDocument *doc = GetOurOwnerDoc();
- doc->AddBlockedTrackingNode(thisNode);
- }
- }
- nsresult status =
- reqStatus & imgIRequest::STATUS_ERROR ? NS_ERROR_FAILURE : NS_OK;
+ nsresult status = reqStatus & imgIRequest::STATUS_ERROR ? NS_ERROR_FAILURE : NS_OK;
return OnLoadComplete(aRequest, status);
}
diff --git a/dom/base/nsObjectLoadingContent.cpp b/dom/base/nsObjectLoadingContent.cpp
index 525ece9296..128ec2a95d 100644
--- a/dom/base/nsObjectLoadingContent.cpp
+++ b/dom/base/nsObjectLoadingContent.cpp
@@ -1127,24 +1127,6 @@ nsObjectLoadingContent::OnStartRequest(nsIRequest *aRequest,
nsresult status = NS_OK;
bool success = IsSuccessfulRequest(aRequest, &status);
- if (status == NS_ERROR_BLOCKED_URI) {
- nsCOMPtr<nsIConsoleService> console(
- do_GetService("@mozilla.org/consoleservice;1"));
- if (console) {
- nsCOMPtr<nsIURI> uri;
- chan->GetURI(getter_AddRefs(uri));
- nsString message = NS_LITERAL_STRING("Blocking ") +
- NS_ConvertASCIItoUTF16(uri->GetSpecOrDefault().get()) +
- NS_LITERAL_STRING(" since it was found on an internal Firefox blocklist.");
- console->LogStringMessage(message.get());
- }
- mContentBlockingEnabled = true;
- return NS_ERROR_FAILURE;
- } else if (status == NS_ERROR_TRACKING_URI) {
- mContentBlockingEnabled = true;
- return NS_ERROR_FAILURE;
- }
-
if (!success) {
LOG(("OBJLC [%p]: OnStartRequest: Request failed\n", this));
// If the request fails, we still call LoadObject() to handle fallback
@@ -1166,17 +1148,6 @@ nsObjectLoadingContent::OnStopRequest(nsIRequest *aRequest,
PROFILER_LABEL("nsObjectLoadingContent", "OnStopRequest",
js::ProfileEntry::Category::NETWORK);
- // Handle object not loading error because source was a tracking URL.
- // We make a note of this object node by including it in a dedicated
- // array of blocked tracking nodes under its parent document.
- if (aStatusCode == NS_ERROR_TRACKING_URI) {
- nsCOMPtr<nsIContent> thisNode =
- do_QueryInterface(static_cast<nsIObjectLoadingContent*>(this));
- if (thisNode && thisNode->IsInComposedDoc()) {
- thisNode->GetComposedDoc()->AddBlockedTrackingNode(thisNode);
- }
- }
-
NS_ENSURE_TRUE(nsContentUtils::LegacyIsCallerChromeOrNativeCode(), NS_ERROR_NOT_AVAILABLE);
if (aRequest != mChannel) {
diff --git a/dom/browser-element/BrowserElementChildPreload.js b/dom/browser-element/BrowserElementChildPreload.js
index 5adff2caca..f6c224b391 100644
--- a/dom/browser-element/BrowserElementChildPreload.js
+++ b/dom/browser-element/BrowserElementChildPreload.js
@@ -1648,15 +1648,6 @@ BrowserElementChild.prototype = {
case Cr.NS_ERROR_CSP_FRAME_ANCESTOR_VIOLATION :
sendAsyncMsg('error', { type: 'cspBlocked' });
return;
- case Cr.NS_ERROR_PHISHING_URI :
- sendAsyncMsg('error', { type: 'deceptiveBlocked' });
- return;
- case Cr.NS_ERROR_MALWARE_URI :
- sendAsyncMsg('error', { type: 'malwareBlocked' });
- return;
- case Cr.NS_ERROR_UNWANTED_URI :
- sendAsyncMsg('error', { type: 'unwantedBlocked' });
- return;
case Cr.NS_ERROR_FORBIDDEN_URI :
sendAsyncMsg('error', { type: 'forbiddenBlocked' });
return;
diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp
index 21f62b0e32..6774504a43 100644
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -516,15 +516,6 @@ HTMLMediaElement::MediaLoadListener::OnStartRequest(nsIRequest* aRequest,
NS_ENSURE_SUCCESS(rv, rv);
if (NS_FAILED(status)) {
if (element) {
- // Handle media not loading error because source was a tracking URL.
- // We make a note of this media node by including it in a dedicated
- // array of blocked tracking nodes under its parent document.
- if (status == NS_ERROR_TRACKING_URI) {
- nsIDocument* ownerDoc = element->OwnerDoc();
- if (ownerDoc) {
- ownerDoc->AddBlockedTrackingNode(element);
- }
- }
element->NotifyLoadError();
}
return status;
diff --git a/dom/script/ScriptLoader.cpp b/dom/script/ScriptLoader.cpp
index 3e1c13af5c..f669690ce7 100644
--- a/dom/script/ScriptLoader.cpp
+++ b/dom/script/ScriptLoader.cpp
@@ -2347,16 +2347,6 @@ ScriptLoader::VerifySRI(ScriptLoadRequest* aRequest,
void
ScriptLoader::HandleLoadError(ScriptLoadRequest *aRequest, nsresult aResult) {
- /*
- * Handle script not loading error because source was a tracking URL.
- * We make a note of this script node by including it in a dedicated
- * array of blocked tracking nodes under its parent document.
- */
- if (aResult == NS_ERROR_TRACKING_URI) {
- nsCOMPtr<nsIContent> cont = do_QueryInterface(aRequest->mElement);
- mDocument->AddBlockedTrackingNode(cont);
- }
-
if (aRequest->IsModuleRequest() && !aRequest->mIsInline) {
auto request = aRequest->AsModuleRequest();
SetModuleFetchFinishedAndResumeWaitingRequests(request, aResult);