2007-10-29 21:29:14 +03:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
|
|
|
|
<!DOCTYPE html [
|
|
|
|
<!ENTITY % htmlDTD PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
|
|
|
|
%htmlDTD;
|
|
|
|
<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
|
|
|
|
%globalDTD;
|
|
|
|
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
|
|
|
|
%brandDTD;
|
|
|
|
<!ENTITY % blockedSiteDTD SYSTEM "chrome://browser/locale/safebrowsing/phishing-afterload-warning-message.dtd">
|
|
|
|
%blockedSiteDTD;
|
|
|
|
]>
|
|
|
|
|
2012-05-21 15:12:37 +04:00
|
|
|
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
2007-10-29 21:29:14 +03:00
|
|
|
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml" class="blacklist">
|
|
|
|
<head>
|
2016-04-21 19:50:16 +03:00
|
|
|
<link rel="stylesheet" href="chrome://browser/skin/blockedSite.css" type="text/css" media="all" />
|
2007-10-29 21:29:14 +03:00
|
|
|
<link rel="icon" type="image/png" id="favicon" href="chrome://global/skin/icons/blacklist_favicon.png"/>
|
|
|
|
|
|
|
|
<script type="application/javascript"><![CDATA[
|
|
|
|
// Error url MUST be formatted like this:
|
2015-11-24 00:34:31 +03:00
|
|
|
// about:blocked?e=error_code&u=url(&o=1)?
|
|
|
|
// (o=1 when user overrides are allowed)
|
|
|
|
|
2007-10-29 21:29:14 +03:00
|
|
|
// Note that this file uses document.documentURI to get
|
|
|
|
// the URL (with the format from above). This is because
|
|
|
|
// document.location.href gets the current URI off the docshell,
|
|
|
|
// which is the URL displayed in the location bar, i.e.
|
|
|
|
// the URI that the user attempted to load.
|
|
|
|
|
2016-12-31 05:47:25 +03:00
|
|
|
function getErrorCode() {
|
2007-10-29 21:29:14 +03:00
|
|
|
var url = document.documentURI;
|
|
|
|
var error = url.search(/e\=/);
|
|
|
|
var duffUrl = url.search(/\&u\=/);
|
|
|
|
return decodeURIComponent(url.slice(error + 2, duffUrl));
|
|
|
|
}
|
|
|
|
|
2016-12-31 05:47:25 +03:00
|
|
|
function getURL() {
|
2007-10-29 21:29:14 +03:00
|
|
|
var url = document.documentURI;
|
2009-12-24 06:03:37 +03:00
|
|
|
var match = url.match(/&u=([^&]+)&/);
|
2007-10-29 21:29:14 +03:00
|
|
|
|
2009-12-24 06:03:37 +03:00
|
|
|
// match == null if not found; if so, return an empty string
|
2007-10-29 21:29:14 +03:00
|
|
|
// instead of what would turn out to be portions of the URI
|
2009-12-24 06:03:37 +03:00
|
|
|
if (!match)
|
2007-10-29 21:29:14 +03:00
|
|
|
return "";
|
|
|
|
|
2009-12-24 06:03:37 +03:00
|
|
|
url = decodeURIComponent(match[1]);
|
|
|
|
|
|
|
|
// If this is a view-source page, then get then real URI of the page
|
2012-09-23 23:09:29 +04:00
|
|
|
if (url.startsWith("view-source:"))
|
2009-12-24 06:03:37 +03:00
|
|
|
url = url.slice(12);
|
|
|
|
return url;
|
2007-10-29 21:29:14 +03:00
|
|
|
}
|
2015-11-24 00:34:31 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Check whether this warning page should be overridable or whether
|
|
|
|
* the "ignore warning" button should be hidden.
|
|
|
|
*/
|
2016-12-31 05:47:25 +03:00
|
|
|
function getOverride() {
|
2015-11-24 00:34:31 +03:00
|
|
|
var url = document.documentURI;
|
|
|
|
var match = url.match(/&o=1&/);
|
|
|
|
return !!match;
|
|
|
|
}
|
|
|
|
|
2007-10-29 21:29:14 +03:00
|
|
|
/**
|
2009-12-24 06:03:37 +03:00
|
|
|
* Attempt to get the hostname via document.location. Fail back
|
2007-10-29 21:29:14 +03:00
|
|
|
* to getURL so that we always return something meaningful.
|
|
|
|
*/
|
2016-12-31 05:47:25 +03:00
|
|
|
function getHostString() {
|
2009-12-24 06:03:37 +03:00
|
|
|
try {
|
|
|
|
return document.location.hostname;
|
|
|
|
} catch (e) {
|
|
|
|
return getURL();
|
|
|
|
}
|
2007-10-29 21:29:14 +03:00
|
|
|
}
|
2015-11-21 07:24:50 +03:00
|
|
|
|
2016-12-31 05:47:25 +03:00
|
|
|
function initPage() {
|
2015-11-21 07:24:50 +03:00
|
|
|
var error = "";
|
2010-02-06 13:40:06 +03:00
|
|
|
switch (getErrorCode()) {
|
2007-10-29 21:29:14 +03:00
|
|
|
case "malwareBlocked" :
|
2015-11-21 07:24:50 +03:00
|
|
|
error = "malware";
|
2007-10-29 21:29:14 +03:00
|
|
|
break;
|
2016-02-26 08:34:01 +03:00
|
|
|
case "deceptiveBlocked" :
|
2015-11-21 07:24:50 +03:00
|
|
|
error = "phishing";
|
2007-10-29 21:29:14 +03:00
|
|
|
break;
|
2015-04-22 12:01:37 +03:00
|
|
|
case "unwantedBlocked" :
|
2015-11-21 07:24:50 +03:00
|
|
|
error = "unwanted";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return;
|
2007-10-29 21:29:14 +03:00
|
|
|
}
|
2015-04-22 12:01:37 +03:00
|
|
|
|
2015-11-21 07:24:50 +03:00
|
|
|
var el;
|
2015-04-22 12:01:37 +03:00
|
|
|
|
2015-11-21 07:24:50 +03:00
|
|
|
if (error !== "malware") {
|
|
|
|
el = document.getElementById("errorTitleText_malware");
|
2017-01-30 10:10:22 +03:00
|
|
|
el.remove();
|
2015-11-21 07:24:50 +03:00
|
|
|
el = document.getElementById("errorShortDescText_malware");
|
2017-01-30 10:10:22 +03:00
|
|
|
el.remove();
|
2015-11-21 07:24:50 +03:00
|
|
|
el = document.getElementById("errorLongDescText_malware");
|
2017-01-30 10:10:22 +03:00
|
|
|
el.remove();
|
2015-11-21 07:24:50 +03:00
|
|
|
}
|
2008-03-08 01:46:56 +03:00
|
|
|
|
2015-11-21 07:24:50 +03:00
|
|
|
if (error !== "phishing") {
|
|
|
|
el = document.getElementById("errorTitleText_phishing");
|
2017-01-30 10:10:22 +03:00
|
|
|
el.remove();
|
2015-11-21 07:24:50 +03:00
|
|
|
el = document.getElementById("errorShortDescText_phishing");
|
2017-01-30 10:10:22 +03:00
|
|
|
el.remove();
|
2015-11-21 07:24:50 +03:00
|
|
|
el = document.getElementById("errorLongDescText_phishing");
|
2017-01-30 10:10:22 +03:00
|
|
|
el.remove();
|
2015-11-21 07:24:50 +03:00
|
|
|
}
|
2015-04-22 12:01:37 +03:00
|
|
|
|
2015-11-21 07:24:50 +03:00
|
|
|
if (error !== "unwanted") {
|
|
|
|
el = document.getElementById("errorTitleText_unwanted");
|
2017-01-30 10:10:22 +03:00
|
|
|
el.remove();
|
2015-11-21 07:24:50 +03:00
|
|
|
el = document.getElementById("errorShortDescText_unwanted");
|
2017-01-30 10:10:22 +03:00
|
|
|
el.remove();
|
2015-11-21 07:24:50 +03:00
|
|
|
el = document.getElementById("errorLongDescText_unwanted");
|
2017-01-30 10:10:22 +03:00
|
|
|
el.remove();
|
2015-11-21 07:24:50 +03:00
|
|
|
}
|
2015-04-22 12:01:37 +03:00
|
|
|
|
2008-03-08 01:46:56 +03:00
|
|
|
// Set sitename
|
2015-11-21 07:24:50 +03:00
|
|
|
document.getElementById(error + "_sitename").textContent = getHostString();
|
|
|
|
document.title = document.getElementById("errorTitleText_" + error)
|
2008-03-08 01:46:56 +03:00
|
|
|
.innerHTML;
|
2015-11-21 07:25:11 +03:00
|
|
|
|
2015-11-24 00:34:31 +03:00
|
|
|
if (!getOverride()) {
|
|
|
|
var btn = document.getElementById("ignoreWarningButton");
|
|
|
|
if (btn) {
|
2017-01-30 10:10:22 +03:00
|
|
|
btn.remove();
|
2015-11-24 00:34:31 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-21 07:25:11 +03:00
|
|
|
// Inform the test harness that we're done loading the page
|
2017-03-21 21:29:43 +03:00
|
|
|
var event = new CustomEvent("AboutBlockedLoaded", {bubbles: true});
|
2015-11-21 07:25:11 +03:00
|
|
|
document.dispatchEvent(event);
|
2007-10-29 21:29:14 +03:00
|
|
|
}
|
|
|
|
]]></script>
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body dir="&locale.dir;">
|
2016-04-21 19:50:16 +03:00
|
|
|
<div id="errorPageContainer" class="container">
|
|
|
|
|
2007-10-29 21:29:14 +03:00
|
|
|
<!-- Error Title -->
|
2016-04-21 19:50:16 +03:00
|
|
|
<div id="errorTitle" class="title">
|
|
|
|
<h1 class="title-text" id="errorTitleText_phishing">&safeb.blocked.phishingPage.title2;</h1>
|
|
|
|
<h1 class="title-text" id="errorTitleText_malware">&safeb.blocked.malwarePage.title;</h1>
|
|
|
|
<h1 class="title-text" id="errorTitleText_unwanted">&safeb.blocked.unwantedPage.title;</h1>
|
2007-10-29 21:29:14 +03:00
|
|
|
</div>
|
2016-04-21 19:50:16 +03:00
|
|
|
|
2007-10-29 21:29:14 +03:00
|
|
|
<div id="errorLongContent">
|
2016-04-21 19:50:16 +03:00
|
|
|
|
2007-10-29 21:29:14 +03:00
|
|
|
<!-- Short Description -->
|
|
|
|
<div id="errorShortDesc">
|
2016-02-26 08:34:01 +03:00
|
|
|
<p id="errorShortDescText_phishing">&safeb.blocked.phishingPage.shortDesc2;</p>
|
2009-05-19 12:19:45 +04:00
|
|
|
<p id="errorShortDescText_malware">&safeb.blocked.malwarePage.shortDesc;</p>
|
2015-04-22 12:01:37 +03:00
|
|
|
<p id="errorShortDescText_unwanted">&safeb.blocked.unwantedPage.shortDesc;</p>
|
2007-10-29 21:29:14 +03:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- Long Description -->
|
|
|
|
<div id="errorLongDesc">
|
2016-02-26 08:34:01 +03:00
|
|
|
<p id="errorLongDescText_phishing">&safeb.blocked.phishingPage.longDesc2;</p>
|
2009-05-19 12:19:45 +04:00
|
|
|
<p id="errorLongDescText_malware">&safeb.blocked.malwarePage.longDesc;</p>
|
2015-04-22 12:01:37 +03:00
|
|
|
<p id="errorLongDescText_unwanted">&safeb.blocked.unwantedPage.longDesc;</p>
|
2007-10-29 21:29:14 +03:00
|
|
|
</div>
|
2016-04-21 19:50:16 +03:00
|
|
|
|
2017-06-14 12:36:02 +03:00
|
|
|
<!-- Advisory -->
|
|
|
|
<div id="advisoryDesc">
|
|
|
|
<p id="advisoryDescText">&safeb.palm.advisory.desc;</p>
|
|
|
|
</div>
|
|
|
|
|
2007-10-29 21:29:14 +03:00
|
|
|
<!-- Action buttons -->
|
2016-04-21 19:50:16 +03:00
|
|
|
<div id="buttons" class="button-container">
|
2008-03-07 22:51:25 +03:00
|
|
|
<!-- Commands handled in browser.js -->
|
2016-04-21 19:50:16 +03:00
|
|
|
<button id="getMeOutButton" class="primary">&safeb.palm.accept.label;</button>
|
|
|
|
<div class="button-spacer"></div>
|
2010-08-20 03:06:07 +04:00
|
|
|
<button id="reportButton">&safeb.palm.reportPage.label;</button>
|
2007-10-29 21:29:14 +03:00
|
|
|
</div>
|
|
|
|
</div>
|
2008-03-12 23:34:31 +03:00
|
|
|
<div id="ignoreWarning">
|
2010-08-20 03:06:07 +04:00
|
|
|
<button id="ignoreWarningButton">&safeb.palm.decline.label;</button>
|
2008-03-12 23:34:31 +03:00
|
|
|
</div>
|
2007-10-29 21:29:14 +03:00
|
|
|
</div>
|
|
|
|
<!--
|
|
|
|
- Note: It is important to run the script this way, instead of using
|
|
|
|
- an onload handler. This is because error pages are loaded as
|
|
|
|
- LOAD_BACKGROUND, which means that onload handlers will not be executed.
|
|
|
|
-->
|
2016-08-24 00:38:57 +03:00
|
|
|
<script type="application/javascript">
|
|
|
|
initPage();
|
|
|
|
</script>
|
2007-10-29 21:29:14 +03:00
|
|
|
</body>
|
|
|
|
</html>
|