1 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 export class BlockedSiteParent extends JSWindowActorParent {
9 case "Browser:SiteBlockedError":
13 this.browsingContext === this.browsingContext.top,
20 _onAboutBlocked(elementId, reason, isTopFrame, blockedInfo) {
21 let browser = this.browsingContext.top.embedderElement;
25 let { BrowserOnClick } = browser.ownerGlobal;
26 // Depending on what page we are displaying here (malware/phishing/unwanted)
27 // use the right strings and links for each.
29 let sendTelemetry = false;
30 if (reason === "malware") {
32 bucketName = "WARNING_MALWARE_PAGE_";
33 } else if (reason === "phishing") {
35 bucketName = "WARNING_PHISHING_PAGE_";
36 } else if (reason === "unwanted") {
38 bucketName = "WARNING_UNWANTED_PAGE_";
39 } else if (reason === "harmful") {
41 bucketName = "WARNING_HARMFUL_PAGE_";
43 let secHistogram = Services.telemetry.getHistogramById(
44 "URLCLASSIFIER_UI_EVENTS"
46 let nsISecTel = Ci.IUrlClassifierUITelemetry;
47 bucketName += isTopFrame ? "TOP_" : "FRAME_";
52 secHistogram.add(nsISecTel[bucketName + "GET_ME_OUT_OF_HERE"]);
54 browser.ownerGlobal.getMeOutOfHere(this.browsingContext);
56 case "ignore_warning_link":
57 if (Services.prefs.getBoolPref("browser.safebrowsing.allowOverride")) {
59 secHistogram.add(nsISecTel[bucketName + "IGNORE_WARNING"]);
61 BrowserOnClick.ignoreWarningLink(