views:

137

answers:

1

How to write a simple Opera plugin?

I'd like to develop a plugin that would change the Referer header of a request based on request's url data.

Opera's website says plugins should be developed using [Netscape4 Plug-in API][1]. However there's not so much information about it available. I looked up in my c:/program files/opera/program/plugins and it seems like Opera's plugins are .dlls. What programming language should be used for Opera Plugin Development and do you know of any walk-through about it?

+2  A: 

If you only want to modify HTTP requests, it may be easiest to write a proxy server that does that (e.g. hack Squid and configure Opera to use it).

Opera's plugins are only for handling specific media types, e.g. Flash or Quick Time videos and are invoked only via <object>, <embed> or opening of specific file. They're not general-purpose plugins.

Opera has another extension mechanism - UserJS - which is JavaScript ran on every page (similar to Greasemonkey in Firefox). You could use it to modify document.referrer in JavaScript, but not in HTTP headers.

porneL