mobile/android/chrome/content/blockedSite.xhtml

Wed, 31 Dec 2014 07:22:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:22:50 +0100
branch
TOR_BUG_3246
changeset 4
fc2d59ddac77
permissions
-rw-r--r--

Correct previous dual key logic pending first delivery installment.

     1 <?xml version="1.0" encoding="UTF-8"?>
     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/phishing.dtd">
    11   %blockedSiteDTD;
    12 ]>
    14 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    15    - License, v. 2.0. If a copy of the MPL was not distributed with this
    16    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
    18 <html xmlns="http://www.w3.org/1999/xhtml" class="blacklist">
    19   <head>
    20     <meta name="viewport" content="width=device-width; user-scalable=false" />
    21     <link rel="stylesheet" href="chrome://global/skin/netError.css" type="text/css" media="all" />
    22     <link rel="icon" type="image/png" id="favicon" sizes="64x64" href="chrome://browser/skin/images/blocked-warning.png"/>
    24     <script type="application/javascript"><![CDATA[
    25       // Error url MUST be formatted like this:
    26       //   about:blocked?e=error_code&u=url
    28       // Note that this file uses document.documentURI to get
    29       // the URL (with the format from above). This is because
    30       // document.location.href gets the current URI off the docshell,
    31       // which is the URL displayed in the location bar, i.e.
    32       // the URI that the user attempted to load.
    34       function getErrorCode()
    35       {
    36         var url = document.documentURI;
    37         var error = url.search(/e\=/);
    38         var duffUrl = url.search(/\&u\=/);
    39         return decodeURIComponent(url.slice(error + 2, duffUrl));
    40       }
    42       function getURL()
    43       {
    44         var url = document.documentURI;
    45         var match = url.match(/&u=([^&]+)&/);
    47         // match == null if not found; if so, return an empty string
    48         // instead of what would turn out to be portions of the URI
    49         if (!match)
    50           return "";
    52         url = decodeURIComponent(match[1]);
    54         // If this is a view-source page, then get then real URI of the page
    55         if (/^view-source\:/.test(url))
    56           url = url.slice(12);
    57         return url;
    58       }
    60       /**
    61        * Attempt to get the hostname via document.location.  Fail back
    62        * to getURL so that we always return something meaningful.
    63        */
    64       function getHostString()
    65       {
    66         try {
    67           return document.location.hostname;
    68         } catch (e) {
    69           return getURL();
    70         }
    71       }
    73       function initPage()
    74       {
    75         // Handoff to the appropriate initializer, based on error code
    76         switch (getErrorCode()) {
    77           case "malwareBlocked" :
    78             initPage_malware();
    79             break;
    80           case "phishingBlocked" :
    81             initPage_phishing();
    82             break;
    83         }
    84       }        
    86       /**
    87        * Initialize custom strings and functionality for blocked malware case
    88        */
    89       function initPage_malware()
    90       {
    91         // Remove phishing strings
    92         var el = document.getElementById("errorTitleText_phishing");
    93         el.parentNode.removeChild(el);
    95         el = document.getElementById("errorShortDescText_phishing");
    96         el.parentNode.removeChild(el);
    98         el = document.getElementById("errorLongDescText_phishing");
    99         el.parentNode.removeChild(el);
   101         // Set sitename
   102         document.getElementById("malware_sitename").textContent = getHostString();
   103         document.title = document.getElementById("errorTitleText_malware")
   104                                  .innerHTML;
   105       }
   107       /**
   108        * Initialize custom strings and functionality for blocked phishing case
   109        */
   110       function initPage_phishing()
   111       {
   112         // Remove malware strings
   113         var el = document.getElementById("errorTitleText_malware");
   114         el.parentNode.removeChild(el);
   116         el = document.getElementById("errorShortDescText_malware");
   117         el.parentNode.removeChild(el);
   119         el = document.getElementById("errorLongDescText_malware");
   120         el.parentNode.removeChild(el);
   122         document.title = document.getElementById("errorTitleText_phishing")
   123                                  .innerHTML;
   124       }
   125     ]]></script>
   126   </head>
   128   <body id="errorPage" class="blockedsite" dir="&locale.dir;">
   130     <div id="errorPageContainer">
   132       <!-- Error Title -->
   133       <div id="errorTitle">
   134         <h1 id="errorTitleText_phishing" class="errorTitleText">&safeb.blocked.phishingPage.title2;</h1>
   135         <h1 id="errorTitleText_malware" class="errorTitleText">&safeb.blocked.malwarePage.title;</h1>
   136       </div>
   138       <div id="errorLongContent">
   140         <!-- Short Description -->
   141         <div id="errorShortDesc">
   142           <p id="errorShortDescText_phishing">&safeb.blocked.phishingPage.shortDesc2;</p>
   143           <p id="errorShortDescText_malware">&safeb.blocked.malwarePage.shortDesc;</p>
   144         </div>
   146         <!-- Long Description -->
   147         <div id="errorLongDesc">
   148           <p id="errorLongDescText_phishing">&safeb.blocked.phishingPage.longDesc2;</p>
   149           <p id="errorLongDescText_malware">&safeb.blocked.malwarePage.longDesc;</p>
   150         </div>
   152         <!-- Action buttons -->
   153         <div id="buttons">
   154           <!-- Commands handled in browser.js -->
   155           <button id="getMeOutButton">&safeb.palm.accept.label;</button>
   156           <button id="reportButton">&safeb.palm.reportPage.label;</button>
   157         </div>
   158       </div>
   159       <div id="ignoreWarning">
   160         <button id="ignoreWarningButton">&safeb.palm.decline.label;</button>
   161       </div>
   162     </div>
   163     <!--
   164     - Note: It is important to run the script this way, instead of using
   165     - an onload handler. This is because error pages are loaded as
   166     - LOAD_BACKGROUND, which means that onload handlers will not be executed.
   167     -->
   168     <script type="application/javascript">initPage();</script>
   169   </body>
   170 </html>

mercurial