Skip to content
A WebKit plugin written in MacRuby, adding ruby power to the web kid!
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

WebKit plugin example using MacRuby

A WebKit plug-in implemented in MacRuby. The plug-in’s view is a NSTextField subclass, text entered in the textfield is eval'ed as Ruby code. The sample also illustrates how to use the WebView's UIDelegate to call back to the application.

The custom view from the plugin is loaded in test.html with the following tag:

The MIME-type is defined by the plugin itself, see the plugin’s Info.plist.

The plug-in in action:

Purpose of this example

The main purpose of this example is to show how to use custom NSView classes in a WebView in a MacRuby application that uses a WebView for its interface.

Theoretically these plugins can be used with any WebKit based application, but only if they support garbage collection.

TL;DR, so how do I use it in [insert favorite browser]?!

Whoa, hold your horses, son. Because this brings us to the most important note, and will most probably be sad news to you, which is that none of the common WebKit based browsers support this... This means no Safari nor Chrome.

The latter could possibly be compiled with garbage collection support, it’s completely open-source after all, but I was not able to do so in my quick attempts.

In case you'd like to have a go, I could not get ‘Chromium Framework.framework’ to support it. Let me know if you are successful.

So there’s no way to play with this in a web browser?

Sure there is. In this repo you will find, next to the WebViewBasedApp example, a simple web browser by MOApp. Select this ‘executable’ to install the plugin in the browser instead of WebViewBasedApp.

Alternatively you can install the plugin in one of these following locations:

  • ~/Library/Internet Plug-Ins
  • /Library/Internet Plug-Ins

Documentation regarding WebKit plugins

You can’t perform that action at this time.