<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>
<channel>
	<title>Comments on: Released: Modify Headers 0.6.3</title>
	<atom:link href="http://www.garethhunt.com/2008/01/06/released-modify-headers-063/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.garethhunt.com/2008/01/06/released-modify-headers-063/</link>
	<description>Firefox Addons, Mobile Web and living in the USA</description>
	<pubDate>Wed, 07 Jan 2009 10:18:37 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: crono</title>
		<link>http://www.garethhunt.com/2008/01/06/released-modify-headers-063/comment-page-1/#comment-1081</link>
		<dc:creator>crono</dc:creator>
		<pubDate>Tue, 22 Jan 2008 15:25:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.garethhunt.com/index.php/2008/01/06/released-modify-headers-063/#comment-1081</guid>
		<description>Hi Gareth,

very nice - thanks for the info :-)

bye</description>
		<content:encoded><![CDATA[<p>Hi Gareth,</p>
<p>very nice - thanks for the info <img src='http://www.garethhunt.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>bye</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gareth</title>
		<link>http://www.garethhunt.com/2008/01/06/released-modify-headers-063/comment-page-1/#comment-1077</link>
		<dc:creator>gareth</dc:creator>
		<pubDate>Mon, 21 Jan 2008 21:03:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.garethhunt.com/index.php/2008/01/06/released-modify-headers-063/#comment-1077</guid>
		<description>Hi Crono, A feature similar to this is already on the roadmap.</description>
		<content:encoded><![CDATA[<p>Hi Crono, A feature similar to this is already on the roadmap.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: crono</title>
		<link>http://www.garethhunt.com/2008/01/06/released-modify-headers-063/comment-page-1/#comment-1076</link>
		<dc:creator>crono</dc:creator>
		<pubDate>Mon, 21 Jan 2008 20:39:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.garethhunt.com/index.php/2008/01/06/released-modify-headers-063/#comment-1076</guid>
		<description>Hi,
I found your extension today and think it's really great. It would be perfect for me when I could specify which headers are sent to which url (with regex). 

Example: 
x-test0 = 0000 @ http://[a-z\./]*
x-test = 1234 @ https://localhost/*
x-test2 = 5678 @ http://www\.mozilla\.org/*

and so on... Just an idea :-)</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I found your extension today and think it&#8217;s really great. It would be perfect for me when I could specify which headers are sent to which url (with regex). </p>
<p>Example:<br />
x-test0 = 0000 @ <a href="http://a-z" onclick="javascript:pageTracker._trackPageview('/outbound/comment/http://a-z');" rel="nofollow">http://a-z</a>\./]*<br />
x-test = 1234 @ <a href="https://localhost/" onclick="javascript:pageTracker._trackPageview('/outbound/comment/https://localhost/');" rel="nofollow">https://localhost/</a>*<br />
x-test2 = 5678 @ <a href="http://www" onclick="javascript:pageTracker._trackPageview('/outbound/comment/http://www');" rel="nofollow">http://www</a>\.mozilla\.org/*</p>
<p>and so on&#8230; Just an idea <img src='http://www.garethhunt.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NettiCat</title>
		<link>http://www.garethhunt.com/2008/01/06/released-modify-headers-063/comment-page-1/#comment-1064</link>
		<dc:creator>NettiCat</dc:creator>
		<pubDate>Sat, 19 Jan 2008 23:30:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.garethhunt.com/index.php/2008/01/06/released-modify-headers-063/#comment-1064</guid>
		<description>This may not be of interest for bloggers, but as all postings will be reviewed I'll post it anyway :-)
I made a small extension (BetterCache). It is a working demo concerning modification of response headers. You may use it in your own project:


function RespHeaderObserver()
{
  this.register();
}

RespHeaderObserver.prototype = {
  observe: function(subject, topic, data) {
      if (topic == "http-on-examine-response") {
					var headers = new Array();
					headers[0] = "Age";
					headers[1] = "Cache-Control";
					headers[2] = "Date";
					headers[3] = "ETag";
					headers[4] = "Expires";
					headers[5] = "Last-Modified";
					headers[6] = "Pragma";
					headers[7] = "Vary";
					//headers[8] = "Set-Cookie"; //not anti-cache, but a better testpattern :-)
          var httpChannel = subject.QueryInterface(Components.interfaces.nsIHttpChannel);
					//need to test every (above defined) header for existance. If not existant, getResponseHeader will throw an exception.
					for(i = 0; i &#60; headers.length; i++){
	        	var headerval = "";
						var replacement = "";
						try{
							headerval = httpChannel.getResponseHeader (headers[i]);
								if(i == 6)//special case Pragma
										replacement = headerval.replace(/no\-cache/g, "");
								httpChannel.setResponseHeader(headers[i], replacement, false);
						  	//alert(headers[i]+'='+headerval);
						}catch(e){}//NS_ERROR_(header_)NOT_AVAILABLE
					}
    			headers = null;
          return;
      }
  },

  register: function() {
    var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
    observerService.addObserver(this, "http-on-examine-response", false);
  },
  unregister: function() {
    var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
    try{
			observerService.removeObserver(this, "http-on-examine-response");
		}catch(e){}
  }
}
//observer needs to be registered only once, so better use a XPT file
window.addEventListener("load", function(evnt) { observer = new RespHeaderObserver(); }, true);
window.addEventListener("unload", function(evnt) { observer.unregister(); }, true);</description>
		<content:encoded><![CDATA[<p>This may not be of interest for bloggers, but as all postings will be reviewed I&#8217;ll post it anyway <img src='http://www.garethhunt.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
I made a small extension (BetterCache). It is a working demo concerning modification of response headers. You may use it in your own project:</p>
<p>function RespHeaderObserver()<br />
{<br />
  this.register();<br />
}</p>
<p>RespHeaderObserver.prototype = {<br />
  observe: function(subject, topic, data) {<br />
      if (topic == &#8220;http-on-examine-response&#8221;) {<br />
					var headers = new Array();<br />
					headers[0] = &#8220;Age&#8221;;<br />
					headers[1] = &#8220;Cache-Control&#8221;;<br />
					headers[2] = &#8220;Date&#8221;;<br />
					headers[3] = &#8220;ETag&#8221;;<br />
					headers[4] = &#8220;Expires&#8221;;<br />
					headers[5] = &#8220;Last-Modified&#8221;;<br />
					headers[6] = &#8220;Pragma&#8221;;<br />
					headers[7] = &#8220;Vary&#8221;;<br />
					//headers[8] = &#8220;Set-Cookie&#8221;; //not anti-cache, but a better testpattern <img src='http://www.garethhunt.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
          var httpChannel = subject.QueryInterface(Components.interfaces.nsIHttpChannel);<br />
					//need to test every (above defined) header for existance. If not existant, getResponseHeader will throw an exception.<br />
					for(i = 0; i &lt; headers.length; i++){<br />
	        	var headerval = &#8220;&#8221;;<br />
						var replacement = &#8220;&#8221;;<br />
						try{<br />
							headerval = httpChannel.getResponseHeader (headers[i]);<br />
								if(i == 6)//special case Pragma<br />
										replacement = headerval.replace(/no\-cache/g, &#8220;&#8221;);<br />
								httpChannel.setResponseHeader(headers[i], replacement, false);<br />
						  	//alert(headers[i]+&#8217;='+headerval);<br />
						}catch(e){}//NS_ERROR_(header_)NOT_AVAILABLE<br />
					}<br />
    			headers = null;<br />
          return;<br />
      }<br />
  },</p>
<p>  register: function() {<br />
    var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);<br />
    observerService.addObserver(this, &#8220;http-on-examine-response&#8221;, false);<br />
  },<br />
  unregister: function() {<br />
    var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);<br />
    try{<br />
			observerService.removeObserver(this, &#8220;http-on-examine-response&#8221;);<br />
		}catch(e){}<br />
  }<br />
}<br />
//observer needs to be registered only once, so better use a XPT file<br />
window.addEventListener(&#8221;load&#8221;, function(evnt) { observer = new RespHeaderObserver(); }, true);<br />
window.addEventListener(&#8221;unload&#8221;, function(evnt) { observer.unregister(); }, true);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NettiCat</title>
		<link>http://www.garethhunt.com/2008/01/06/released-modify-headers-063/comment-page-1/#comment-1055</link>
		<dc:creator>NettiCat</dc:creator>
		<pubDate>Fri, 18 Jan 2008 18:14:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.garethhunt.com/index.php/2008/01/06/released-modify-headers-063/#comment-1055</guid>
		<description>P.S.

ACString getResponseHeader(in ACString header);

void setResponseHeader(in ACString header, in ACString value, in boolean merge);

http://developer.mozilla.org/en/docs/nsIHttpChannel</description>
		<content:encoded><![CDATA[<p>P.S.</p>
<p>ACString getResponseHeader(in ACString header);</p>
<p>void setResponseHeader(in ACString header, in ACString value, in boolean merge);</p>
<p><a href="http://developer.mozilla.org/en/docs/nsIHttpChannel" onclick="javascript:pageTracker._trackPageview('/outbound/comment/http://developer.mozilla.org/en/docs/nsIHttpChannel');" rel="nofollow">http://developer.mozilla.org/en/docs/nsIHttpChannel</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NettiCat</title>
		<link>http://www.garethhunt.com/2008/01/06/released-modify-headers-063/comment-page-1/#comment-1053</link>
		<dc:creator>NettiCat</dc:creator>
		<pubDate>Fri, 18 Jan 2008 17:47:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.garethhunt.com/index.php/2008/01/06/released-modify-headers-063/#comment-1053</guid>
		<description>Thank you! (for adding my request to the road map)</description>
		<content:encoded><![CDATA[<p>Thank you! (for adding my request to the road map)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gareth</title>
		<link>http://www.garethhunt.com/2008/01/06/released-modify-headers-063/comment-page-1/#comment-1023</link>
		<dc:creator>gareth</dc:creator>
		<pubDate>Tue, 08 Jan 2008 17:43:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.garethhunt.com/index.php/2008/01/06/released-modify-headers-063/#comment-1023</guid>
		<description>Hi NettiCat.  I had always thought that response headers are immutable, but I had a look at the documentation and it looks possible.  I've added an enhancement request here: https://www.mozdev.org/bugs/show_bug.cgi?id=18455

Feel free to add yourself as a CC on this.

I have a lot of other features to add first, but I'll add this to the roadmap for version 0.8 or 0.9.</description>
		<content:encoded><![CDATA[<p>Hi NettiCat.  I had always thought that response headers are immutable, but I had a look at the documentation and it looks possible.  I&#8217;ve added an enhancement request here: <a href="https://www.mozdev.org/bugs/show_bug.cgi?id=18455" onclick="javascript:pageTracker._trackPageview('/outbound/comment/https://www.mozdev.org/bugs/show_bug.cgi?id=18455');" rel="nofollow">https://www.mozdev.org/bugs/show_bug.cgi?id=18455</a></p>
<p>Feel free to add yourself as a CC on this.</p>
<p>I have a lot of other features to add first, but I&#8217;ll add this to the roadmap for version 0.8 or 0.9.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NettiCat</title>
		<link>http://www.garethhunt.com/2008/01/06/released-modify-headers-063/comment-page-1/#comment-1022</link>
		<dc:creator>NettiCat</dc:creator>
		<pubDate>Tue, 08 Jan 2008 15:59:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.garethhunt.com/index.php/2008/01/06/released-modify-headers-063/#comment-1022</guid>
		<description>First reading about the "Modify Headers" extension I thought: That's what I 'm looking for.
But after installing the extension, it revealed to modify outging (request-) headers only. No possibility to modify or remove server-sided response headers. Yes, I should have read your extension-description more carefully, you mentioned it.
Ok, you may ask, why should I want to filter response headers? Answer: There are several reasons why you may want to filter server headers. One of them is to force caching in firefox.
Many servers send anti-cache headers, preventing firefox to cache documents and/or pictures, so there will always be a (full) reload when pushing the back button. That's really annoying. Anti-cache headers may be AGE, CACHE-CONTROL, EXPIRES, ETAG, PRAGMA, VARY and even more headers.
I really would appreciate adding that feature.</description>
		<content:encoded><![CDATA[<p>First reading about the &#8220;Modify Headers&#8221; extension I thought: That&#8217;s what I &#8216;m looking for.<br />
But after installing the extension, it revealed to modify outging (request-) headers only. No possibility to modify or remove server-sided response headers. Yes, I should have read your extension-description more carefully, you mentioned it.<br />
Ok, you may ask, why should I want to filter response headers? Answer: There are several reasons why you may want to filter server headers. One of them is to force caching in firefox.<br />
Many servers send anti-cache headers, preventing firefox to cache documents and/or pictures, so there will always be a (full) reload when pushing the back button. That&#8217;s really annoying. Anti-cache headers may be AGE, CACHE-CONTROL, EXPIRES, ETAG, PRAGMA, VARY and even more headers.<br />
I really would appreciate adding that feature.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
