xpcom

Ideas needed. Javascript+XPCOM+C++ add-on

。_饼干妹妹 提交于 2019-12-04 06:21:27
问题 So, there is a WebRTC inside Firefox and there is a convenient class for making RTC communication possible called RTCPeerConnection which can be instantiated and used from the JavaScript app. You can find some decent example of it on [1]. And here am I with my custom transport (if you're interested - [2]) would like to use it for RTC communication. Briefly, I need to "substitute" the transport layer of WebRTC engine by my custom transport while providing the same RTCPeerConnection-like

How can I implement a content converter in Firefox for all page elements?

拈花ヽ惹草 提交于 2019-12-04 05:48:31
I'm attempting to port over an Internet Explorer plugin to Firefox, but I'm not sure where to look for what I need. Basically I need to be able to filter all content that is received by the browser with a certain Content-Type header. I tried implementing a stream converter, and this works, but only for the top-level document in the page, frame, or iframe. I had the same problem with IE, and getting around it was really hacky, and since I would ideally like this to be cross platform I would really like to be able to do this in Firefox without resorting to vtable hacks. The content is served

Using Java/Python libraries in programming Firefox/Chrome Extensions

≡放荡痞女 提交于 2019-12-03 20:15:01
I have an idea of studying user behavior on the browser, for which I intend to make a Chrome/Firefox extension to study the behavior dynamically. I have some predefined libraries in Java and Python to analyze the results, which will be impossible to program in plain JavaScript. Now for my question: is it possible to use third party libraries, especially those of Python or Java like plain function calls? I have a vague idea about something like Java XPCOM or PyXPCOM for Firefox. However, for a beginner, it all looks so scary. I started making Add-On for Firefox, but got lost somewhere in the

how to change firefox proxy settings using xpcom

眉间皱痕 提交于 2019-12-03 14:12:38
问题 I have a proxy server running on localhost (127.0.0.1) and i have grown tired of having to train users on how to switch proxies in firefox to bypass blocked websites. I decided to write an addon. I wonder how to use xpcom to tell firefox to use a certain proxy eg for http, use 127.0.0.1 port 8080. Examples on the internet are scarce. Thanks 回答1: Proxy settings are stored in the preferences. You probably want to change network.proxy.type , network.proxy.http and network.proxy.http_port

How to overwrite built in XPCOM component in Firefox addon?

喜你入骨 提交于 2019-12-03 08:35:28
I'm taking a foray into Firefox extension development for the first time, and so far it's been pretty comfortable going, but I'm running into a problem; one of the things I need to do overwriting the built-in nsIPromptService and replacing it with something of my own instead. I walked through the basic XPCOM component creation tutorial here and got the hello world one working: https://developer.mozilla.org/en/creating_xpcom_components And everything in that seems to work fine, but nothing I've been able to find or research shows how I can overwrite an interface from javascript. I've seen

Use registerProtocolHandler without contentWindow

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-02 20:31:20
问题 I'm trying to install hotmail to my mailto handlers: This is accomplished with this code from webpage scope: navigator.registerProtocolHandler('mailto','http://mail.live.com/secure/start?action=compose&to=%s','Live Mail'); From XPCOM we would have to use this: MXR ::WebContentConverter.js#369) . So from searching github code I figure you import it like this: var nsiwchr = Cc["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"].getService(Ci.nsIWebContentHandlerRegistrar); So I

Observe for highlight?

巧了我就是萌 提交于 2019-12-02 13:22:58
问题 Is it possible to use nsISelectionController to watch when a a highlight/selection is made? I know that there are different selection scopes. I want to watch when a user makes a selection in the default scope seen at MXR - nsISelectionController Constants. Kind of like an addEventListener on select change but on the text nodes of the document. Thanks 回答1: I found a solution but it doesn't use nsIController as @Neil had recommended in a SO topic HERE to look at viewSource.js. Im still

Use registerProtocolHandler without contentWindow

核能气质少年 提交于 2019-12-02 08:32:26
I'm trying to install hotmail to my mailto handlers: This is accomplished with this code from webpage scope: navigator.registerProtocolHandler('mailto','http://mail.live.com/secure/start?action=compose&to=%s','Live Mail'); From XPCOM we would have to use this: MXR ::WebContentConverter.js#369) . So from searching github code I figure you import it like this: var nsiwchr = Cc["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"].getService(Ci.nsIWebContentHandlerRegistrar); So I would register it like this: nsiwchr.registerProtocolHandler('mailto','http://mail.live.com/secure

Observe for highlight?

狂风中的少年 提交于 2019-12-02 03:33:08
Is it possible to use nsISelectionController to watch when a a highlight/selection is made? I know that there are different selection scopes. I want to watch when a user makes a selection in the default scope seen at MXR - nsISelectionController Constants . Kind of like an addEventListener on select change but on the text nodes of the document. Thanks Noitidart I found a solution but it doesn't use nsIController as @Neil had recommended in a SO topic HERE to look at viewSource.js. Im still interested in a nsIController solution if possible, im trying to understand that sucker it confuses me.

Firefox XPCOM component - Permission denied to call method UnnamedClass

橙三吉。 提交于 2019-12-02 01:50:58
问题 Can a firefox XPCOM component read and write page content across multiple pages? Scenario: A bunch of local HTML and javascript files. A "Main.html" file opens a window "pluginWindow", and creates a plugin using: netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); var obj = Components.classes[cid].createInstance(); plugin = obj.QueryInterface(Components.interfaces.IPlugin); plugin.addObserver(handleEvent); The plugin that has 3 methods. IPlugin.Read - Read data from