Skip to content

Commit

Permalink
Private protocol: show error message and usage example in case of wro…
Browse files Browse the repository at this point in the history
…ng URI

(related to #94)
  • Loading branch information
Infocatcher committed Aug 24, 2013
1 parent ed5e3cd commit 5aa07ac
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions protocolRedirect.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<!DOCTYPE HTML>
<meta charset="utf-8" />
<title>Private Tab: Redirect…</title>
<div id="output"></div>
<div id="usage" style="display: none;">
Usage example: <a href="private:///#https://addons.mozilla.org/">private:///#https://addons.mozilla.org/</a>
</div>
<script>
try {
var spec = location.hash.substr(1);
Expand Down Expand Up @@ -80,6 +84,13 @@
}
catch(e) {
document.title = "Private Tab: Can't redirect";
var out;
if(!spec)
out = "Missing URI";
else if(!uri)
out = "Malformed URI: " + spec;
out && document.getElementById("output").appendChild(document.createTextNode(out));
document.getElementById("usage").style.display = "";
throw e;
}
</script>

0 comments on commit 5aa07ac

Please sign in to comment.