xpcom

Firefox 26 C++ Addon XPCOM dependency error

蓝咒 提交于 2019-12-13 05:09:22
问题 I prepare my C++ Firefox addon for the next Firefox - v.26 - but I can't build it with xulrunner-sdk 26 beta (it is OK with the previous major versions). Just as before, I link it against xpcomglue_staticruntime_s.lib, but I've got these errors: xpcomglue_staticruntime_s.lib(nsStringAPI.obj) : error LNK2019: unresolved external symbol _ imp _PR_sscanf referenced in function "public: __int64 __thiscall nsAString::ToInteger64(enum tag_nsresult *,unsigned int)const " (?ToInteger64@nsAString@@QBE

Can't create javascript XPCOM service for Firefox extension

╄→гoц情女王★ 提交于 2019-12-13 04:16:20
问题 I've been banging my head a against this particular brick wall now for more than two days. I am attempting to create an XPCOM service for use in a Firefox extension but am unable to initialise the component with the following error displayed in the error console in Firefox. Timestamp: 07/06/2012 09:23:28 Error: uncaught exception: [Exception... "Component returned failure code: 0x80570016 (NS_ERROR_XPC_GS_RETURNED_FAILURE) [nsIJSCID.getService]" nsresult: "0x80570016 (NS_ERROR_XPC_GS_RETURNED

XPCOM writeString error

十年热恋 提交于 2019-12-11 19:15:40
问题 I am using this function to write text to a file via iMacros addon in FireFox. //This function writes string into a file function WriteFile(path,string) { //import FileUtils.jsm Components.utils.import("resource://gre/modules/FileUtils.jsm"); //declare file var file = new FileUtils.File(path); //declare file path file.initWithPath(path); //if it exists move on if not create it if (!file.exists()) { file.create(file.NORMAL_FILE_TYPE, 0666); } var charset = 'EUC-JP'; var fileStream = Components

VirtualBox api :“take_screen_shot_to_array” function raise an unicode error only with python3, how to access XPCOMObject method to debug?

时光总嘲笑我的痴心妄想 提交于 2019-12-11 15:37:37
问题 The following code work fine in python2.7, but with python3.6, import virtualbox vbox = virtualbox.VirtualBox() vm = vbox.find_machine("my_vbox_machine_name") session = vm.create_session() display = session.console.display png = display.take_screen_shot_to_array(0,10,10,virtualbox.library.BitmapFormat.png) it's end with this error : Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/username/.local/lib/python3.6/site-packages/virtualbox/library.py", line 23684,

Gecko NSModule: ContractIDEntry “nsID const *”?

穿精又带淫゛_ 提交于 2019-12-11 14:54:00
问题 I created a FireFox addon a while a go, and noticed it stopped working on FireFox 3.6 Apparently, NSGetModule is being replaced with an NSModule structure, so I have to adapt. I'm coding my product with Delphi, so I have to port the new code to Object Pascal. If I look over this code: http://mxr.mozilla.org/mozilla-central/source/xpcom/components/Module.h I notice that the "cid" property of the ContractIDEntry struct, is defined as nsID const * Does this mean that there's a pointer to a nsID

Javascript write file without overwrite

前提是你 提交于 2019-12-11 08:44:27
问题 I am using XPCOM to read/write file(s) on my hard drive (since Java is no longer supported on FF16,17,18,+ I have to use this). I use it in my FireFox extension(s) (I use iMacros). On this document click I found this example. var string = '\u5909\u63db\u30c6\u30b9\u30c8'; file.initWithPath('C:\\temp\\temp.txt'); file.create(file.NORMAL_FILE_TYPE, 0666); var charset = 'EUC-JP'; var fileStream = Components .classes['@mozilla.org/network/file-output-stream;1'] .createInstance(Components

Mozilla XPCOM is not registered

橙三吉。 提交于 2019-12-11 06:42:33
问题 I'm trying to build an extension for Firefox. This extension uses an XPCOM component (a C++ dll). I'm compiling the DLL, compilation is OK. The next step would be to use the component in Javascript from my extension. I added the code to register my component from my c++ file : static const mozilla::Module::CategoryEntry kSampleCategories[] = { { JAVASCRIPT_GLOBAL_PROPERTY_CATEGORY, "greenfox", NS_SAMPLE_CONTRACTID }, }; In my manifest, I declare the XPCOM : component {03A6D0B4-22B9-11DF-B844

XPCOM Encrypt/Decrypt operation on file in Firefox Extension

半城伤御伤魂 提交于 2019-12-11 04:31:47
问题 My Firefox extension needs to; store user credentials in a file that will be stored in users local filesystem . when credentials are needed, decrypt file read values and encrypt it again. sometimes send encrypted file over http to a server. I cant find any XPCOM component to encrypt / decrypt a file . Should i write my own XPCOM object, or is there any other reasonable solution for that. [Note:] This may like Firefox's password management system. Firefox stores master password and keys in

XPCOM support in Android webkit browser?

僤鯓⒐⒋嵵緔 提交于 2019-12-11 04:18:32
问题 Does the Android WebKit supports the XPCOM framework or NPRuntime API`s as like Firefox? How to implement JavaScript in the Android WebKit plug-in? Update: I am writing a media player plug-in for the Android WebKit browser and my plug-in needs to get the command from the web page through JavaScript (some actions like play/pause/stop/resize are issued as JavaScript commands from the browser). My plug-in is written in native C code. Are there any examples or sample plug-in available for

What lib in the gecko 1.9.3 SDK do I link against to use moz_xmalloc()?

穿精又带淫゛_ 提交于 2019-12-11 02:08:34
问题 I'm trying to link my XPCOM extension against the 1.9.3a3pre SDK and I get the following: error LNK2001: unresolved external symbol _moz_xmalloc So, what lib do I need to link to? The documentation doesn't say. This is on Windows right now, but I'll need it to build on Mac and Linux (32bit/64bit) as well. Edit: Now with bounty. Edit: Update: Turns out FF3.7 was cancelled. So I don't have to worry about this until FF4. 回答1: define ' XPCOM_GLUE ' in C++ Preprocessor Definition property. It will