Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Writing a Firefox plugin for parsing a custom client-side language

Tags:

firefox

I had an idea for a client-side language other than JavaScript, and I'd like to look into developing a Firefox plugin that would treat includes of this new language in a page, like <script type="newscript" src="path/script.ns" />, just as if it were a natively supported language. The plugin would do all of the language parsing and ideally be able to perform every operation on the browser and the html and css within the web page just as JavaScript can.

I've done a bunch of Googling and have found some articles on writing basic Firefox plugins, but nothing as complicated as this.

Is this even possible?

like image 557
willurd Avatar asked Sep 16 '08 07:09

willurd


1 Answers

An interesting idea. Note that you don't actually need to write a browser-specific plugin to do this. Some people have experimented with using JRuby in an Applet to execute code embedded within <script type="text/ruby">. Such a solution may be slower on startup (due to the overhead of loading an entire JVM instance), but it will be much more flexible in the long run (cross-browser). Besides, it's a bit easier to build a custom language interpreter in a JVM language than it is to try to shoe-horn it into Gecko.

like image 72
Daniel Spiewak Avatar answered Sep 30 '22 16:09

Daniel Spiewak