(
Note: updated with a more reliable representation of the link.)
(
Note: updated again to support news:<newsgroup-name> links.)
Here's an obscure hack.
Firefox 3 supports web protocol handlers (f.e. sending mailto: links to Gmail), while Google Groups archives Usenet. But as far as I can tell, Google Groups doesn't support news: links, even though Firefox can send them to it. It does, however, support retrieving messages by their IDs or newsgroup names, which news: links contain.
So how could we get Google Groups to load news: links passed to it by Firefox?
The solution is to pass them to an intermediary that extracts the IDs/names from the links and passes them to Google Groups. Here's a data: URL that does that:
data:text/html,\
<html><body><script>\
var url = '%s';\
var stripPrefix = /^news:(\\/\\/[^\\/]+\\/)?/;\
if (/@/.test(url))\
window.location = 'http://groups.google.com/groups?selm='+url.replace(stripPrefix, '');\
else\
window.location = 'http://groups.google.com/group/'+url.replace(stripPrefix, '');\
</script></body></html>
Unfortunately, it isn't easy to configure Firefox to use this URL as the news: protocol handler. Manually hacking
mimeTypes.rdf is most unpleasant, while
window.navigator.registerProtocolHandler only registers http(s): URLs.
But it's possible to construct a javascript: URL that does the same thing registerProtocolHandler does, namely call the
handler service and register the handler with it directly.
The only trick is that you have to enter and run it in the Error Console, which has chrome privileges. Otherwise the URL won't have the privileges it needs to register the handler.
Here's a javascript: URL that registers the handler:
javascript: var Cc = Components.classes; var Ci = Components.interfaces; var handler = Cc['@mozilla.org/uriloader/web-handler-app;1'].createInstance(Ci.nsIWebHandlerApp); handler.name = 'Google Groups'; handler.uriTemplate = "data:text/html, <html><body><script> var url = '%s'; var stripPrefix = /^news:(\\/\\/[^\\/]+\\/)?/; if (/@/.test(url)) window.location = 'http://groups.google.com/groups?selm='+url.replace(stripPrefix, ''); else window.location = 'http://groups.google.com/group/'+url.replace(stripPrefix, ''); </script></body></html>"; var eps = Cc['@mozilla.org/uriloader/external-protocol-service;1'].getService(Ci.nsIExternalProtocolService); var handlerInfo = eps.getProtocolHandlerInfo('news'); handlerInfo.possibleApplicationHandlers.appendElement(handler, false); handlerInfo.alwaysAskBeforeHandling = true; var hs = Cc['@mozilla.org/uriloader/handler-service;1'].getService(Ci.nsIHandlerService); hs.store(handlerInfo); window.location = "data:text/html, <body> <p>The news: link handler for Google Groups has been installed. Try it with these links:</p> <ul> <li><a href='news:mozilla.support.firefox'>news:mozilla.support.firefox</a></li> <li><a href='news://news.mozilla.org/mozilla.support.firefox'>news://news.mozilla.org/mozilla.support.firefox</a></li> <li><a href='news:37604264.65F502CD@netscape.com'>news:37604264.65F502CD@netscape.com</a></li> <li><a href='news://news.mozilla.org/37604264.65F502CD@netscape.com'>news://news.mozilla.org/37604264.65F502CD@netscape.com</a></li> </ul> </body>";
To use it, copy the URL, open the Error Console (Tools > Error Console or Ctrl/Command+Shift+J), paste the URL into the evaluation field, and press the Evaluate button.
Once you've done that, try it out with these links:
When you click one, Firefox will ask you what you want to do with the link, and Google Groups should be an option on the list.
For the curious, here's a nicely formatted version of the code inside that javascript: URL, which is based on
WCCR_addProtocolHandlerButtonCallback:
javascript:
var Cc = Components.classes;
var Ci = Components.interfaces;
var handler = Cc['@mozilla.org/uriloader/web-handler-app;1'].createInstance(Ci.nsIWebHandlerApp);
handler.name = 'Google Groups';
handler.uriTemplate = "data:text/html,\
<html><body><script>\
var url = '%s';\
var stripPrefix = /^news:(\\/\\/[^\\/]+\\/)?/;\
if (/@/.test(url))\
window.location = 'http://groups.google.com/groups?selm='+url.replace(stripPrefix, '');\
else\
window.location = 'http://groups.google.com/group/'+url.replace(stripPrefix, '');\
</script></body></html>";
var eps = Cc['@mozilla.org/uriloader/external-protocol-service;1'].getService(Ci.nsIExternalProtocolService);
var handlerInfo = eps.getProtocolHandlerInfo('news');
handlerInfo.possibleApplicationHandlers.appendElement(handler, false);
handlerInfo.alwaysAskBeforeHandling = true;
var hs = Cc['@mozilla.org/uriloader/handler-service;1'].getService(Ci.nsIHandlerService);
hs.store(handlerInfo);
window.location = "data:text/html,\
<body>\
<p>The news: link handler for Google Groups has been installed.\
Try it with these links:</p>\
<ul>\
<li><a href='news:mozilla.support.firefox'>news:mozilla.support.firefox</a></li>\
<li><a href='news://news.mozilla.org/mozilla.support.firefox'>news://news.mozilla.org/mozilla.support.firefox</a></li>\
<li><a href='news:37604264.65F502CD@netscape.com'>news:37604264.65F502CD@netscape.com</a></li>\
<li><a href='news://news.mozilla.org/37604264.65F502CD@netscape.com'>news://news.mozilla.org/37604264.65F502CD@netscape.com</a></li>\
</ul>\
</body>";
Of course Google Groups could make this hack moot by simply supporting news: links and protocol handler registration natively. For info on how to do that, Google Groups, see the news: URL standard in
RFC 1738 and
these subsequent IETF drafts, then read the Devmo docs on
window.navigator.registerProtocolHandler.