From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David De La Harpe Golden Newsgroups: gmane.emacs.devel Subject: Re: An Emacs plug-in for a browser (Firefox?) Date: Fri, 05 Sep 2008 01:16:32 +0100 Message-ID: <48C07A60.5020700@harpegolden.net> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1220573839 26255 80.91.229.12 (5 Sep 2008 00:17:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 5 Sep 2008 00:17:19 +0000 (UTC) Cc: emacs-devel@gnu.org To: pmr@pajato.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 05 02:18:13 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KbP1g-0008JT-J6 for ged-emacs-devel@m.gmane.org; Fri, 05 Sep 2008 02:18:12 +0200 Original-Received: from localhost ([127.0.0.1]:50019 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KbP0h-0005t0-0v for ged-emacs-devel@m.gmane.org; Thu, 04 Sep 2008 20:17:11 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KbP0F-0005n7-U3 for emacs-devel@gnu.org; Thu, 04 Sep 2008 20:16:43 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KbP0F-0005mg-3e for emacs-devel@gnu.org; Thu, 04 Sep 2008 20:16:43 -0400 Original-Received: from [199.232.76.173] (port=58521 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KbP0F-0005md-0t for emacs-devel@gnu.org; Thu, 04 Sep 2008 20:16:43 -0400 Original-Received: from harpegolden.net ([65.99.215.13]:53555) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KbP0E-00084Q-PX for emacs-devel@gnu.org; Thu, 04 Sep 2008 20:16:42 -0400 Original-Received: from golden1.harpegolden.net (unknown [86.45.10.133]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "David De La Harpe Golden", Issuer "David De La Harpe Golden Personal CA rev 3" (verified OK)) by harpegolden.net (Postfix) with ESMTP id 8EEAA81DE; Fri, 5 Sep 2008 01:16:40 +0100 (IST) User-Agent: Mozilla-Thunderbird 2.0.0.16 (X11/20080724) In-Reply-To: X-Enigmail-Version: 0.95.0 X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:103539 Archived-At: Paul Michael Reilly wrote: > For example, > "emacs://x.y.z/some/file/or/other.txt" when presented to the browser > would fire up a tab on the browser with a full blown Emacs instance > "embedded/buried" in it and edit the file other.txt with the full > power of Emacs immersed in the browser. Sandbox issues aside, what > other issues need to be overcome to create such a browser plugin? > Probably lots for full generality and security; but emacs IIRC already supports the xembed protocol on X11 (--parent-id command line arg?), so making a basic plugin for firefox should be straightforward on X11 platforms, since firefox also supports xembedding as part of its extended plugin api on X11. http://developer.mozilla.org/En/Plugins - tells you how to write plugins. http://developer.mozilla.org/en/XEmbed_Extension_for_Mozilla_Plugins - tells you how to use xembed with mozilla plugins on X11 platforms. On non-X11 platforms it's presumably quite a bit more awkward... *** Note that if you don't want to _embed_ emacs into firefox windows, just want the ability to type "emacs:filename" into the address bar, then you can just define an external protocol handler: Doing it this way is probably not entirely secure... go to about:config Following http://kb.mozillazine.org/Register_protocol#Linux_and_Mac add the following keys (right click -> new) Boolean -> network.protocol-handler.external.emacs -> True String -> network.protocol-handler.app.emacs /path/to/emacs-url-wrapper after making an emacs-url-wrapper that strips the leading "emacs:" from its arg e.g. (unsafe) #!/bin/bash exec emacs $(echo "$1" | sed 's/emacs://') Now, emacs:/tmp/blah.txt in the firefox address bar should pop up an emacs...