2007-10-29 11:29:14 -07: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;
|
|
|
|
]>
|
|
|
|
|
|
|
|
<!-- ***** BEGIN LICENSE BLOCK *****
|
|
|
|
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
-
|
|
|
|
- The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
- 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
- the License. You may obtain a copy of the License at
|
|
|
|
- http://www.mozilla.org/MPL/
|
|
|
|
-
|
|
|
|
- Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
- for the specific language governing rights and limitations under the
|
|
|
|
- License.
|
|
|
|
-
|
|
|
|
- The Original Code is mozilla.org code.
|
|
|
|
-
|
|
|
|
- The Initial Developer of the Original Code is
|
|
|
|
- Netscape Communications Corporation.
|
|
|
|
- Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
- the Initial Developer. All Rights Reserved.
|
|
|
|
-
|
|
|
|
- Contributor(s):
|
|
|
|
- Adam Lock <adamlock@netscape.com>
|
|
|
|
- William R. Price <wrprice@alumni.rice.edu>
|
|
|
|
- Henrik Skupin <mozilla@hskupin.info>
|
|
|
|
- Jeff Walden <jwalden+code@mit.edu>
|
|
|
|
- Johnathan Nightingale <johnath@mozilla.com>
|
|
|
|
-
|
|
|
|
- Alternatively, the contents of this file may be used under the terms of
|
|
|
|
- either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
- in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
- of those above. If you wish to allow use of your version of this file only
|
|
|
|
- under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
- use your version of this file under the terms of the MPL, indicate your
|
|
|
|
- decision by deleting the provisions above and replace them with the notice
|
|
|
|
- and other provisions required by the LGPL or the GPL. If you do not delete
|
|
|
|
- the provisions above, a recipient may use your version of this file under
|
|
|
|
- the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
-
|
|
|
|
- ***** END LICENSE BLOCK ***** -->
|
|
|
|
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml" class="blacklist">
|
|
|
|
<head>
|
|
|
|
<link rel="stylesheet" href="chrome://global/skin/netError.css" type="text/css" media="all" />
|
|
|
|
<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:
|
|
|
|
// about:blocked?e=error_code&u=url
|
|
|
|
|
|
|
|
// 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.
|
|
|
|
|
|
|
|
function getErrorCode()
|
|
|
|
{
|
|
|
|
var url = document.documentURI;
|
|
|
|
var error = url.search(/e\=/);
|
|
|
|
var duffUrl = url.search(/\&u\=/);
|
|
|
|
return decodeURIComponent(url.slice(error + 2, duffUrl));
|
|
|
|
}
|
|
|
|
|
|
|
|
function getURL()
|
|
|
|
{
|
|
|
|
var url = document.documentURI;
|
2009-12-23 19:03:37 -08:00
|
|
|
var match = url.match(/&u=([^&]+)&/);
|
2007-10-29 11:29:14 -07:00
|
|
|
|
2009-12-23 19:03:37 -08:00
|
|
|
// match == null if not found; if so, return an empty string
|
2007-10-29 11:29:14 -07:00
|
|
|
// instead of what would turn out to be portions of the URI
|
2009-12-23 19:03:37 -08:00
|
|
|
if (!match)
|
2007-10-29 11:29:14 -07:00
|
|
|
return "";
|
|
|
|
|
2009-12-23 19:03:37 -08:00
|
|
|
url = decodeURIComponent(match[1]);
|
|
|
|
|
|
|
|
// If this is a view-source page, then get then real URI of the page
|
|
|
|
if (/^view-source\:/.test(url))
|
|
|
|
url = url.slice(12);
|
|
|
|
return url;
|
2007-10-29 11:29:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2009-12-23 19:03:37 -08:00
|
|
|
* Attempt to get the hostname via document.location. Fail back
|
2007-10-29 11:29:14 -07:00
|
|
|
* to getURL so that we always return something meaningful.
|
|
|
|
*/
|
|
|
|
function getHostString()
|
|
|
|
{
|
2009-12-23 19:03:37 -08:00
|
|
|
try {
|
|
|
|
return document.location.hostname;
|
|
|
|
} catch (e) {
|
|
|
|
return getURL();
|
|
|
|
}
|
2007-10-29 11:29:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function initPage()
|
|
|
|
{
|
|
|
|
// Handoff to the appropriate initializer, based on error code
|
2010-02-06 02:40:06 -08:00
|
|
|
switch (getErrorCode()) {
|
2007-10-29 11:29:14 -07:00
|
|
|
case "malwareBlocked" :
|
|
|
|
initPage_malware();
|
|
|
|
break;
|
|
|
|
case "phishingBlocked" :
|
|
|
|
initPage_phishing();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialize custom strings and functionality for blocked malware case
|
|
|
|
*/
|
|
|
|
function initPage_malware()
|
|
|
|
{
|
2008-03-07 14:46:56 -08:00
|
|
|
// Remove phishing strings
|
|
|
|
var el = document.getElementById("errorTitleText_phishing");
|
|
|
|
el.parentNode.removeChild(el);
|
|
|
|
|
|
|
|
el = document.getElementById("errorShortDescText_phishing");
|
|
|
|
el.parentNode.removeChild(el);
|
|
|
|
|
|
|
|
el = document.getElementById("errorLongDescText_phishing");
|
|
|
|
el.parentNode.removeChild(el);
|
|
|
|
|
|
|
|
// Set sitename
|
|
|
|
document.getElementById("malware_sitename").textContent = getHostString();
|
|
|
|
document.title = document.getElementById("errorTitleText_malware")
|
|
|
|
.innerHTML;
|
2007-10-29 11:29:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialize custom strings and functionality for blocked phishing case
|
|
|
|
*/
|
|
|
|
function initPage_phishing()
|
|
|
|
{
|
2008-03-07 14:46:56 -08:00
|
|
|
// Remove malware strings
|
|
|
|
var el = document.getElementById("errorTitleText_malware");
|
|
|
|
el.parentNode.removeChild(el);
|
|
|
|
|
|
|
|
el = document.getElementById("errorShortDescText_malware");
|
|
|
|
el.parentNode.removeChild(el);
|
|
|
|
|
|
|
|
el = document.getElementById("errorLongDescText_malware");
|
|
|
|
el.parentNode.removeChild(el);
|
|
|
|
|
|
|
|
// Set sitename
|
|
|
|
document.getElementById("phishing_sitename").textContent = getHostString();
|
|
|
|
document.title = document.getElementById("errorTitleText_phishing")
|
|
|
|
.innerHTML;
|
2007-10-29 11:29:14 -07:00
|
|
|
}
|
|
|
|
]]></script>
|
2008-03-12 13:34:31 -07:00
|
|
|
<style type="text/css">
|
|
|
|
/* Style warning button to look like a small text link in the
|
|
|
|
bottom right. This is preferable to just using a text link
|
|
|
|
since there is already a mechanism in browser.js for trapping
|
|
|
|
oncommand events from unprivileged chrome pages (BrowserOnCommand).*/
|
|
|
|
#ignoreWarningButton {
|
|
|
|
-moz-appearance: none;
|
|
|
|
background: transparent;
|
|
|
|
border: none;
|
|
|
|
color: white; /* Hard coded because netError.css forces this page's background to dark red */
|
|
|
|
text-decoration: underline;
|
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
|
|
|
position: relative;
|
|
|
|
top: 23px;
|
|
|
|
left: 20px;
|
|
|
|
font-size: smaller;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ignoreWarning {
|
|
|
|
text-align: right;
|
|
|
|
}
|
|
|
|
</style>
|
2007-10-29 11:29:14 -07:00
|
|
|
</head>
|
|
|
|
|
|
|
|
<body dir="&locale.dir;">
|
|
|
|
<div id="errorPageContainer">
|
|
|
|
|
|
|
|
<!-- Error Title -->
|
|
|
|
<div id="errorTitle">
|
2009-05-19 01:19:45 -07:00
|
|
|
<h1 id="errorTitleText_phishing">&safeb.blocked.phishingPage.title;</h1>
|
|
|
|
<h1 id="errorTitleText_malware">&safeb.blocked.malwarePage.title;</h1>
|
2007-10-29 11:29:14 -07:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="errorLongContent">
|
|
|
|
|
|
|
|
<!-- Short Description -->
|
|
|
|
<div id="errorShortDesc">
|
2009-05-19 01:19:45 -07:00
|
|
|
<p id="errorShortDescText_phishing">&safeb.blocked.phishingPage.shortDesc;</p>
|
|
|
|
<p id="errorShortDescText_malware">&safeb.blocked.malwarePage.shortDesc;</p>
|
2007-10-29 11:29:14 -07:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- Long Description -->
|
|
|
|
<div id="errorLongDesc">
|
2009-05-19 01:19:45 -07:00
|
|
|
<p id="errorLongDescText_phishing">&safeb.blocked.phishingPage.longDesc;</p>
|
|
|
|
<p id="errorLongDescText_malware">&safeb.blocked.malwarePage.longDesc;</p>
|
2007-10-29 11:29:14 -07:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- Action buttons -->
|
|
|
|
<div id="buttons">
|
2008-03-07 11:51:25 -08:00
|
|
|
<!-- Commands handled in browser.js -->
|
2010-08-19 16:06:07 -07:00
|
|
|
<button id="getMeOutButton">&safeb.palm.accept.label;</button>
|
|
|
|
<button id="reportButton">&safeb.palm.reportPage.label;</button>
|
2007-10-29 11:29:14 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
2008-03-12 13:34:31 -07:00
|
|
|
<div id="ignoreWarning">
|
2010-08-19 16:06:07 -07:00
|
|
|
<button id="ignoreWarningButton">&safeb.palm.decline.label;</button>
|
2008-03-12 13:34:31 -07:00
|
|
|
</div>
|
2007-10-29 11:29:14 -07: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.
|
|
|
|
-->
|
|
|
|
<script type="application/javascript">initPage();</script>
|
|
|
|
</body>
|
|
|
|
</html>
|