summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rwxr-xr-xsrc/chrome/content/foxri.xul4
-rwxr-xr-xsrc/components/xriProtocolHandler.js10
-rwxr-xr-xsrc/install.rdf4
3 files changed, 6 insertions, 12 deletions
diff --git a/src/chrome/content/foxri.xul b/src/chrome/content/foxri.xul
index dc1cc37..785cc0c 100755
--- a/src/chrome/content/foxri.xul
+++ b/src/chrome/content/foxri.xul
@@ -1,32 +1,28 @@
<?xml version="1.0"?>
<?xml-stylesheet href="foxri.css" type="text/css"?>
<overlay id="foxri" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<!--
<script type="application/x-javascript" src="chrome://foxri/content/xrdsHandler.js"/>
-->
<script>
function xriFix(event)
{
var txt = gURLBar.value;
if (/^(=|@|!)\S+/.test(txt)) {
gURLBar.value = "xri://" + txt;
}
}
</script>
- <toolbaritem id="urlbar-container">
<textbox id="urlbar" ontextentered="xriFix(); return handleURLBarCommand(param);" />
- </toolbaritem>
- <toolbaritem id="go-container">
<toolbarbutton id="go-button" oncommand="xriFix(); return handleURLBarCommand(event);" />
- </toolbaritem>
</overlay>
diff --git a/src/components/xriProtocolHandler.js b/src/components/xriProtocolHandler.js
index 7046cde..1105874 100755
--- a/src/components/xriProtocolHandler.js
+++ b/src/components/xriProtocolHandler.js
@@ -286,65 +286,65 @@ function renderService(srv, doc, qxri)
}
html_uris += "<a href=\""+u.nodeValue+"\">"
+ linkContent + "</a>";
html_uris += "</div>";
}
var html = "<div class=\"service srv_" + getServiceClass(knownServiceType) + "\">\n";
html += html_types;
html += html_paths;
html += html_mediatypes;
if (html_uris) {
html += "<strong>URI(s):</strong><br/>\n";
html += html_uris;
}
html += "</div>";
return html;
}
function isKnownServiceType(type)
{
if (type.toLowerCase() in SERVICE_CLASSES) {
return true;
}
return false;
}
function getServiceClass(type)
{
- if (isKnownServiceType(type)) {
+ if (type && isKnownServiceType(type)) {
return SERVICE_CLASSES[type.toLowerCase()];
}
return type;
}
function guessServiceTypeByURI(uri)
{
if (uri == null || uri == "") {
return "unknown";
}
if (uri.match(/^https?:/i)) {
return "www";
}
else if (uri.match(/^skype:/i)) {
return "skype";
}
else if (uri.match(/^aim:/i)) {
return "aim";
}
else if (uri.match(/^xmpp:/i)) {
return "jabber";
}
else if (uri.match(/^tel:/i)) {
return "tel";
}
else if (uri.match(/^callto:/i)) {
return "callto";
}
else if (uri.match(/^telnet:/i)) {
return "telnet";
}
@@ -768,101 +768,99 @@ XRIChannel.prototype = {
var ioService = Components.classesByID[kIOSERVICE_CID_STR].getService();
ioService = ioService.QueryInterface(nsIIOService);
var channel = ioService.newChannel(hxri, null, null);
if (this.scriptableInStream) {
dump("Hey! You can't possibly be reusing this handler?!\n");
return;
}
dump("making scriptableInStream\n");
this.scriptableInStream = Components.classes["@mozilla.org/scriptableinputstream;1"]
.createInstance(Components.interfaces.nsIScriptableInputStream);
this.buf = '';
dump("notificationCallbacks = " + this.notificationCallbacks + "\n");
dump("loadFlags = " + this.loadFlags + "\n");
dump("loadGroup = " + this.loadGroup + "\n");
dump("owner = " + this.owner + "\n");
dump("securityInfo = " + this.securityInfo + "\n");
// these nsIRequest attributes must be copied to the stub
// channel that we created
channel.notificationCallbacks = this.notificationCallbacks;
channel.loadGroup = this.loadGroup;
channel.loadFlags = this.loadFlags;
this.mChannel = channel;
channel.asyncOpen(this, null);
},
-/* public fields (nsIChannel implmentation) */
+/* public fields (nsIChannel implementation) */
allowPipelining: false,
redirectionLimit: 5,
referrer: "",
requestMethod: "GET",
requestSucceeded: true,
responseStatus: 200,
responseStatusText: "OK",
getRequestHeader: function(header) {
dump("getRequestHeader(" + header + ")\n");
var httpChannel = this.mChannel.QueryInterface(nsIHttpChannel);
try {
var val = httpChannel.getRequestHeader(header);
dump("getRequestHeader(" + header + ") = " + val + "\n");
return val;
}
catch (e) {
+ dump("getRequestHeader - got exception: " + e + "\n");
throw e;
}
},
getResponseHeader: function(header) {
dump("getResponseHeader(" + header + ")\n");
var httpChannel = this.mChannel.QueryInterface(nsIHttpChannel);
try {
var val = httpChannel.getResponseHeader(header);
dump("getResponseHeader(" + header + ") = " + val + "\n");
return val;
}
catch (e) {
+ dump("getResponseHeader - got exception: " + e + "\n");
throw e;
}
-/* XXX
- if (header == "Content-Type")
- return "text/html";
-*/
return null;
},
isNoCacheResponse: function() {
dump("isNoCacheResponse()\n");
var httpChannel = this.mChannel.QueryInterface(nsIHttpChannel);
return httpChannel.isNoCacheResponse();
},
isNoStoreResponse: function() {
dump("isNoStoreResponse()\n");
var httpChannel = this.mChannel.QueryInterface(nsIHttpChannel);
return httpChannel.isNoStoreResponse();
return true;
},
setRequestHeader: function(header, value, merge) {
dump("setRequestHeader(" + header + ", " + value + ")\n");
var httpChannel = this.mChannel.QueryInterface(nsIHttpChannel);
return httpChannel.setRequestHeader(header, value, merge);
},
setResponseHeader: function(header, value, merge) {
dump("setResponseHeader(" + header + ", " + value + ")\n");
var httpChannel = this.mChannel.QueryInterface(nsIHttpChannel);
return httpChannel.setResponseHeader(header, value, merge);
},
visitRequestHeaders: function(visitor) {
dump("visitRequestHeaders()\n");
},
visitResponseHeaders: function(visitor) {
dump("visitResponseHeaders()\n");
},
QueryInterface: function(iid)
{
diff --git a/src/install.rdf b/src/install.rdf
index a482755..507420c 100755
--- a/src/install.rdf
+++ b/src/install.rdf
@@ -1,40 +1,40 @@
<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>foxri@foxri.net</em:id>
- <em:version>1.1.1</em:version>
+ <em:version>1.1.2</em:version>
<em:type>2</em:type>
<!-- Target Application this extension can install into,
with minimum and maximum supported versions. -->
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>1.0</em:minVersion>
- <em:maxVersion>1.5.0.*</em:maxVersion>
+ <em:maxVersion>2.0.*</em:maxVersion>
</Description>
</em:targetApplication>
<em:targetApplication>
<Description>
<em:id>{a463f10c-3994-11da-9945-000d60ca027b}</em:id>
<em:minVersion>0.5</em:minVersion>
<em:maxVersion>0.8</em:maxVersion>
</Description>
</em:targetApplication>
<!-- Front End MetaData -->
<em:name>FoXRI</em:name>
<em:description>XRI Extension</em:description>
<em:creator>William Tan</em:creator>
<em:homepageURL>http://dready.org/projects/foxri</em:homepageURL>
<!--
<em:updateURL>http://dready.org/projects/foxri/update.rdf</em:updateURL>
-->
</Description>
</RDF>