home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / lib / firefox-3.0.14 / chrome / browser.jar / content / browser / safebrowsing / blockedSite.xhtml next >
Encoding:
Extensible Markup Language  |  2008-04-08  |  8.5 KB  |  226 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2.  
  3. <!DOCTYPE html [
  4.   <!ENTITY % htmlDTD PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
  5.   %htmlDTD;
  6.   <!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
  7.   %globalDTD;
  8.   <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
  9.   %brandDTD;
  10.   <!ENTITY % blockedSiteDTD SYSTEM "chrome://browser/locale/safebrowsing/phishing-afterload-warning-message.dtd">
  11.   %blockedSiteDTD;
  12. ]>
  13.  
  14. <!-- ***** BEGIN LICENSE BLOCK *****
  15.    - Version: MPL 1.1/GPL 2.0/LGPL 2.1
  16.    -
  17.    - The contents of this file are subject to the Mozilla Public License Version
  18.    - 1.1 (the "License"); you may not use this file except in compliance with
  19.    - the License. You may obtain a copy of the License at
  20.    - http://www.mozilla.org/MPL/
  21.    -
  22.    - Software distributed under the License is distributed on an "AS IS" basis,
  23.    - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  24.    - for the specific language governing rights and limitations under the
  25.    - License.
  26.    -
  27.    - The Original Code is mozilla.org code.
  28.    -
  29.    - The Initial Developer of the Original Code is
  30.    - Netscape Communications Corporation.
  31.    - Portions created by the Initial Developer are Copyright (C) 1998
  32.    - the Initial Developer. All Rights Reserved.
  33.    -
  34.    - Contributor(s):
  35.    -   Adam Lock <adamlock@netscape.com>
  36.    -   William R. Price <wrprice@alumni.rice.edu>
  37.    -   Henrik Skupin <mozilla@hskupin.info>
  38.    -   Jeff Walden <jwalden+code@mit.edu>
  39.    -   Johnathan Nightingale <johnath@mozilla.com>
  40.    -
  41.    - Alternatively, the contents of this file may be used under the terms of
  42.    - either the GNU General Public License Version 2 or later (the "GPL"), or
  43.    - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  44.    - in which case the provisions of the GPL or the LGPL are applicable instead
  45.    - of those above. If you wish to allow use of your version of this file only
  46.    - under the terms of either the GPL or the LGPL, and not to allow others to
  47.    - use your version of this file under the terms of the MPL, indicate your
  48.    - decision by deleting the provisions above and replace them with the notice
  49.    - and other provisions required by the LGPL or the GPL. If you do not delete
  50.    - the provisions above, a recipient may use your version of this file under
  51.    - the terms of any one of the MPL, the GPL or the LGPL.
  52.    -
  53.    - ***** END LICENSE BLOCK ***** -->
  54.  
  55. <html xmlns="http://www.w3.org/1999/xhtml" class="blacklist">
  56.   <head>
  57.     <link rel="stylesheet" href="chrome://global/skin/netError.css" type="text/css" media="all" />
  58.     <link rel="icon" type="image/png" id="favicon" href="chrome://global/skin/icons/blacklist_favicon.png"/>
  59.  
  60.     <script type="application/javascript" src="chrome://global/content/strres.js"/>
  61.     <script type="application/javascript"><![CDATA[
  62.       // Error url MUST be formatted like this:
  63.       //   about:blocked?e=error_code&u=url
  64.       
  65.       // Note that this file uses document.documentURI to get
  66.       // the URL (with the format from above). This is because
  67.       // document.location.href gets the current URI off the docshell,
  68.       // which is the URL displayed in the location bar, i.e.
  69.       // the URI that the user attempted to load.
  70.  
  71.       function getErrorCode()
  72.       {
  73.         var url = document.documentURI;
  74.         var error = url.search(/e\=/);
  75.         var duffUrl = url.search(/\&u\=/);
  76.         return decodeURIComponent(url.slice(error + 2, duffUrl));
  77.       }
  78.  
  79.       function getURL()
  80.       {
  81.         var url = document.documentURI;
  82.         var index = url.search(/u\=/);
  83.  
  84.         // index == -1 if not found; if so, return an empty string
  85.         // instead of what would turn out to be portions of the URI
  86.         if (index == -1)
  87.           return "";
  88.  
  89.         return decodeURIComponent(url.slice(index + 2));
  90.       }
  91.       
  92.       /**
  93.        * Attempt to parse the result of getURL and extract a hostname.  Fail back
  94.        * to getURL so that we always return something meaningful.
  95.        */
  96.       function getHostString()
  97.       {
  98.         return document.location.hostname;
  99.       }
  100.       
  101.       function initPage()
  102.       {
  103.         // Handoff to the appropriate initializer, based on error code
  104.         switch(getErrorCode()) {
  105.           case "malwareBlocked" :
  106.             initPage_malware();
  107.             break;
  108.           case "phishingBlocked" :
  109.             initPage_phishing();
  110.             break;
  111.         }
  112.       }        
  113.       
  114.       /**
  115.        * Initialize custom strings and functionality for blocked malware case
  116.        */
  117.       function initPage_malware()
  118.       {
  119.         // Remove phishing strings
  120.         var el = document.getElementById("errorTitleText_phishing");
  121.         el.parentNode.removeChild(el);
  122.  
  123.         el = document.getElementById("errorShortDescText_phishing");
  124.         el.parentNode.removeChild(el);
  125.  
  126.         el = document.getElementById("errorLongDescText_phishing");
  127.         el.parentNode.removeChild(el);
  128.  
  129.         // Set sitename
  130.         document.getElementById("malware_sitename").textContent = getHostString();
  131.         document.title = document.getElementById("errorTitleText_malware")
  132.                                  .innerHTML;
  133.       }
  134.       
  135.       /**
  136.        * Initialize custom strings and functionality for blocked phishing case
  137.        */
  138.       function initPage_phishing()
  139.       {
  140.         // Remove malware strings
  141.         var el = document.getElementById("errorTitleText_malware");
  142.         el.parentNode.removeChild(el);
  143.  
  144.         el = document.getElementById("errorShortDescText_malware");
  145.         el.parentNode.removeChild(el);
  146.  
  147.         el = document.getElementById("errorLongDescText_malware");
  148.         el.parentNode.removeChild(el);
  149.  
  150.         // Set sitename
  151.         document.getElementById("phishing_sitename").textContent = getHostString();
  152.         document.title = document.getElementById("errorTitleText_phishing")
  153.                                  .innerHTML;
  154.       }
  155.     ]]></script>
  156.     <style type="text/css">
  157.       /* Style warning button to look like a small text link in the
  158.          bottom right. This is preferable to just using a text link
  159.          since there is already a mechanism in browser.js for trapping
  160.          oncommand events from unprivileged chrome pages (BrowserOnCommand).*/
  161.       #ignoreWarningButton {
  162.         -moz-appearance: none;
  163.         background: transparent;
  164.         border: none;
  165.         color: white;  /* Hard coded because netError.css forces this page's background to dark red */
  166.         text-decoration: underline;
  167.         margin: 0;
  168.         padding: 0;
  169.         position: relative;
  170.         top: 23px;
  171.         left: 20px;
  172.         font-size: smaller;
  173.       }
  174.       
  175.       #ignoreWarning {
  176.         text-align: right;
  177.       }
  178.     </style>
  179.   </head>
  180.  
  181.   <body dir="&locale.dir;">
  182.     <div id="errorPageContainer">
  183.     
  184.       <!-- Error Title -->
  185.       <div id="errorTitle">
  186.         <h1 id="errorTitleText_phishing">&safeb.blocked.phishing.title;</h1>
  187.         <h1 id="errorTitleText_malware">&safeb.blocked.malware.title;</h1>
  188.       </div>
  189.       
  190.       <div id="errorLongContent">
  191.       
  192.         <!-- Short Description -->
  193.         <div id="errorShortDesc">
  194.           <p id="errorShortDescText_phishing">&safeb.blocked.phishing.shortDesc;</p>
  195.           <p id="errorShortDescText_malware">&safeb.blocked.malware.shortDesc;</p>
  196.         </div>
  197.  
  198.         <!-- Long Description -->
  199.         <div id="errorLongDesc">
  200.           <p id="errorLongDescText_phishing">&safeb.blocked.phishing.longDesc;</p>
  201.           <p id="errorLongDescText_malware">&safeb.blocked.malware.longDesc;</p>
  202.         </div>
  203.         
  204.         <!-- Action buttons -->
  205.         <div id="buttons">
  206.           <!-- Commands handled in browser.js -->
  207.           <xul:button xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  208.                       id="getMeOutButton" label="&safeb.palm.accept.label;"/>
  209.           <xul:button xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  210.                       id="reportButton" label="&safeb.palm.report.label;"/>
  211.         </div>
  212.       </div>
  213.       <div id="ignoreWarning">
  214.         <xul:button xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  215.                     id="ignoreWarningButton" label="&safeb.palm.decline.label;"/>
  216.       </div>
  217.     </div>
  218.     <!--
  219.     - Note: It is important to run the script this way, instead of using
  220.     - an onload handler. This is because error pages are loaded as
  221.     - LOAD_BACKGROUND, which means that onload handlers will not be executed.
  222.     -->
  223.     <script type="application/javascript">initPage();</script>
  224.   </body>
  225. </html>
  226.