xpcom

Accessing Firefox cache from an XPCOM component

Does anybody know how to get local path of file cached by Firefox based on its URL from an XPCOM component? ...

How do I copy image data to the clipboard in my XUL application?

I have a XULRunner application that needs to copy image data to the clipboard. I have figured out how to handle copying text to the clipboard, and I can paste PNG data from the clipboard. What I can't figure out is how to get data from a data URL into the clipboard so that it can be pasted into other applications. This is the code I use...

How to get reliable HTTP messages via Firefox XPCOM in Javascript

Hello, I am trying to program a small server+client in Javascript on Firefox, using XPCOM. To get the HTTP message in Javascript, I am using the nsIScriptableInputStream interface. This f**ing component through the read() method randomly cut the message and I cannot make it reliable. Is anybody know a solution to get reliably the info...

Firefox XPCOM component - Permission denied to call method UnnamedClass

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(...

Can the overall implementation of a component be divided in two objects?

I've seen with Microsoft COM and XPCOM, at least from what I've read and gathered so far, that the implementations of interfaces in a component have to essentially be in the single class that derives all the virtual interfaces. Is this correct? What am I missing? Is there a way to have multiple objects (possibly in separate DLL's) each ...

Mozilla/XPCOM - Getting URI from nsIDOMEvent

I'm using XPCOM, and I want to get the URI of the portion of a page the user clicks (e.g., a user right-clicks on a frame, and I want to display the URL of that frame). So I've set up a mouse listener (nsIDOMEventListener) and then when a click occurs, the handleEvent callback gives me access to the nsIDOMEvent. My question is, how do ...

Batch file called from Javascript/XPCOM doesn't show command prompt window

I am calling a batch file from Javascript in this fashion: function runBatch(){ var exe = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile); exe.initWithPath("C:\\test.bat"); var run = Components.classes['@mozilla.org/process/util;1'].createInstance(Components.interfaces.nsIPr...

popen equivalent in XPCOM?

I'm trying to use XULRunner to add a GUI to a command line based program. One solution would be to use something like popen from the XUL application to interact with the command line program. Does XPCOM have popen? Alternatively, does XPCOM have enough primitives to create popen? Is there another approach that gives access to the standar...

Beginning XUL & XPCOM development with XULRunner?

I am planning to design an application XUL & XPCOM for proprietary system. So i have decided to use C/C++ but how can I start the development as a beginner in this field I cannot find a good guide to start around. It will be good if you can give some links and books. I also would like to know how to prevent the user from modifying the co...

[Firefox Extension Development] Beginner Assistance - Where does this code belong?

I'm trying to develop a firefox extension that inserts additional HTTP header fields into outgoing HTTP requests (to interface with an apache extension i'm concurrently developing). While I understand the individual components of an extension and understand the basic tutorials that are presented on the web, I'm finding it difficult goin...

http-on-examine-response observer - possible to block response from further processing?

I am attempting to implement a firefox extension which filters incoming HTTP responses and handles them accordingly. I wish to block HTTP responses containing a specific header. Having read through some of the MDC articles, it appears the most common way of observing HTTP responses is by registering an http-on-examine-response observer....

Do I need to create an interface for every self-created class I use in XPCOM?

Hi, I'm a noob to XPCOM development. In the course of writing XPCOM code in C++, I need to create addtional classes for use inside my XPCOM component. Do I need to create another XPCOM component for such classes? Can't I just add the new class in the header file? ...

Finding mac window id/number from firefox

Is there any way to figure out a firefox window's ID ("windowNumber") on mac OSX from within firefox? Either via JavaScript (unlikely) or XPCOM code. I can easily enumerate the NSWindows but I can't figure out a way to connect the dots between a firefox DOM and the platform specific window. For clarity: I need some way to talk to the Ja...

How to distribute XPCOM component via XPI for FireFox 3?

I wrote an XPCOM component and an extension that uses it. XPCOM loads arbitrary DLL for its purposes. How can I include XPCOM and DLL into XPI package? ...

how do I get nsIEmbeddingSiteWindow in firefox?

From an XPCOM object in firefox, how would I get a nsIEmbeddingSiteWindow for each open window? ...

How to HTML encode a string in JavaScript from a Firefox extension

So I know I can write my own HTML-encoding function like this: function getHTMLEncode(t) { return t.toString().replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;"); } But I was wondering if there were any native facility for this that is available to XPCOM components. I'm writing a component, not ...

Problems Registering XPCOM component

Hi, I'm working on my first XPCOM component. Unfortunately, I can't register it successfully. Building is ok. Here's the makefile CXX = g++ CPPFLAGS += -fno-rtti \ -fexceptions \ -shared \ -fshort-wchar # Change this to point at your Gecko SDK directory. GECKO_SDK_PATH = /path/to/gecko/sdk # GCC onl...

Event fired when a link open a new window?

Hello, I am writing an application in which the user can browse the web with tabs (like a browser). Using XULRunner/XPCOM/Javascript, I am able to know when a new document is loaded and so display the title of the page in the tab. My problem is when the user clicks a link that loads a page IN A NEW WINDOW. I don't know how to catch th...

XPCOM tab based variable.

When user clicks on of the button in toolbar it opens an url in the browser windows. user can process that content on clicking on some other button on the toolbar. However it creates a problem when i have multiple tabs opened and each tab contains different url (so when i send a request to the server through toolbar actions it takes id ...

Mozilla extension: create tab/window with DOM document instead of URI?

I have a web service that requires special headers to be sent in the request. I am able to retrieve expected responseXMLs using an XMLHttpRequest and setRequestHeader(). Now I would like to create a new tab (or window) containing the response document. I would like the default XMLPrettyPrint.xsl file applied to it and when the source is...