Skip to content

An example webextension that uses runtime.connectNative

Notifications You must be signed in to change notification settings

aswan/connectNative-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

wikimacs

This project contains a simple webextension to illustrate the use of native messaging. The webextension creates a page action that is activated when editing wiki pages on https://wiki.mozilla.org/. When the page action icon is clicked, the extension extracts the raw wiki markup from the page and launches the emacs editor on a temporary file containing the wiki markup. After editing the file and exiting emacs, the new contents are sent back to the webextension where they are placed into the editor on the original web page where they can be previewed, submitted, etc.

How to use it

The native application included here only works on MacOS and it requires that emacs has already been installed in /Applications/Emacs.app. You'll also need Firefox version 50 or newer (which as of June 2016 is only available in nightly builds.

First, to make the native application usable from Firefox, copy wikimacs.json from this directory into ~/Library/Application Support/Mozilla/NativeMessagingHosts/wikimacs.json. Edit the copy so that the path property contains the full path to wikimacs.py from this directory.

Then, start Firefox and navigate to about:debugging. Click the "Load Temporary Add-on" button and select any file from the extension/ subdirectory of this directory in the file chooser. You should see "wikimacs" appear in the list of installed extensions.

To actually use it, navigate to any page on https://wiki.mozilla.org and click on the "Edit" button (you need to be logged in to a wiki account for this option to appear). A new instances of emacs should be launched.

Questions?

Head on over to [irc://irc.mozilla.org/webextensions](#webextensions on irc.mozilla.org).

About

An example webextension that uses runtime.connectNative

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published