Extension support browser.runtime.connectNative - runtime

We want to use extension replace with plugin, but we need use extension to download files and launch the file such as exe file.
Is there a method to do?
As pages said, Firefox extension will compate with Chrome's extension, we found Firefox support most APIs, but do not support runtime.connectNative() and some native APIs.
Does Firefox support them? If support, when will support? And how to support Native's extension?

The native messaging API is not yet implemented in Firefox WebExtensions, but it's on the future roadmap.
In the meantime, you can use the older SDK API system/child_process to communicate with external binaries over a pipe interface.
Also, if you want to contribute an implementation of native messaging to Firefox WebExtensions, I will happily introduce you to people who can help with mentoring and code review.

The Firefox WebExtension API will support connectNative() from version 50 on. The documentation is already available. You can try out the API using Firefox Developer Edition 50.

Related

FirefoxOS and Gecko SDK on Windows

I am trying to get my hands dirty of firefox OS apps. I tried to follow instructions on https://developer.mozilla.org/en/docs/Gecko_SDK
to get the SDK. I downloaded Gecko 22.0 (Firefox 22.0) zip file for windows.
Could anyone please tell me how to build it on windows system. The details given on the website are not as clear as I expected(I had expected them to be like that on android's site). Or is there a binary available for the SDK?
No SDK needed, it is all HTML5. If people talk about SDKs in that context, its often frameworks or maybe tools that can export to HTML5. But generally, you can use all the languages that work in a browser and use them without any framework or SDK to make an app.
The developer docs on Marketplace have this great intro on app development and testing: https://marketplace.firefox.com/developers/docs/quick_start
Happy Hacking!
The "SDK" you are looking for is probably the Firefox OS Simulator Addon for the Mozilla Firefox browser. Actually, all you need to test your applications for most hosted ones is a browser of some sort, but the Simulator (also called as R2D2B2G) lets you preview most of the phones' functionality, API-s and install packaged apps.
Besides installing and testing your applications you will also get a feel of Gaia - the user interface of Firefox OS, written, too, in HTML5.
Like many of the answers here, there's no real SDK, as Firefox OS apps are basically HTML5 web pages with a manifest.webapp The firefox OS Simulator mentioned by Flaki is great to test your app.
I recommend watching this short video from Robert Nyman, one of Mozilla's FFos evangelists on getting started with it: http://www.youtube.com/watch?v=hqyrldlSx_o
And this is a good tutorial on developing an app: https://hacks.mozilla.org/2013/06/building-a-todo-app-for-firefox-os-part-1/

How can I send a message from Google Chrome extension to desktop application?

I have a Windows desktop application which must work in collaboration with my Chrome extension.
Can I send a message to my desktop app somehow from Google Chrome extension?
Which IPC objects can I use?
I see three options:
You could use the internet. You can have a remote service that both the chrome extension and your desktop app talk to, to communicate.
You could have your desktop app have a simple server built into it so that the chrome extension can make local http requests to it to communicate with it.
Use the Google NPAPI plugin functionality to have full access to the computer. Now deprecated
These days you would use Chrome's native messaging API to send the message from your extension to a native messaging host. The latter can be a "real" executable that then passes the message on to your desktop application.
Documentation: http://developer.chrome.com/extensions/messaging#native-messaging-host
chrome extension has a native massage api to communicate to native process,
see here:
https://developer.chrome.com/apps/nativeMessaging
This almost certainly requires a custom NPAPI plugin and cannot be done with the basic extension API. NPAPI development is fairly daunting and outside my area of expertise, but feel free to read over Google's documentation on the subject.
As an alternative, perhaps you can have your desktop application poll the internals of the extension. For example, the extension's could have a file in its sandboxed filesystem where it leaves messages for the desktop application to find. This approach is suboptimal, since it requires polling instead of pushing, but it does save you the hassle of coding an NPAPI plugin.

Are there standalone libraries for Firefox Sync?

For example, I'd like to write a script that retrieves all my bookmarks that contain the word "html5" in the title, and adds the tag "web-development" to those bookmarks.
I know there is an Client API specification, but it seems like a complicated protocol, and I figure someone must have developed a library already. It's hard to see which documentation and libraries are up-to-date. There's this page on the Mozilla Wiki, but it has this message:
Warning: Most of the information on this page is outdated. Weave has been renamed Firefox Sync and is now part of Firefox 4. Many APIs documented here have evolved.
What's the current version of the Firefox Sync protocol used?
I've found this code inside Android Sync (a month old), and weaveclient-python (2 years old). Are there any standalone libraries I can use in my own programs?
It seems no stand-alone lib to use. You can also check shaman's project page
https://github.com/emergentdotorg/shaman
Hope this can help.
There is a FirefoxData-android library which can help you to integrate an Android app with Firefox Sync https://github.com/mozilla-mobile/FirefoxData-android

Is there an Adobe AIR like product for just HTML5 (no flash) on Windows

I would like to create a Windows desktop app using HTML5 features, specifically H.264 video,Web SQL Database,FileReader API. I don't want to use AIR (which currently does not support the video tag, instead uses Flash). Ideally I would like an exe file that just wraps the latest version of webkit in a basic window. It should be stand alone, not rely on the user having Chrome etc. installed. It could load an index.html file in the same directory as the exe. That is it.
I have been unable to find anything like this. I was going to build it myself using QTWebkit but the latest version (4.8.0) does not support the Video tag due to some kind of build issue. I assume the 4.8.1 version will fix this.
Does anyone out there know of something like this that is available now?
For anyone coming across this, Titanium for desktop is no longer supported by Appcelerator, but the project is still supported as an open source initiative. As of today (10/14/2012), it is called TideSDK. According to their Twitter account, they're behind in the 1.3 release due to some sponsored work that will end up in the code base.
Additional options not yet mentioned include AppJS (OSS, requires node.js) and Sencha Desktop Packager (quite pricey).
I think titanium is not totally gone. There is this stuff called tideSdk
I couldn't try it out yet also , so video support and the codec are open for your exploration. Here is how they say:
Create multi-platform desktop apps with HTML5, CSS3 and JavaScript
TideSDK is the new standard for creating beautiful and unique desktop
apps using your web development skills.
I recently thought about doing the same thing, you can still do it with air without using flash, but you could also use Chrome Packaged apps, mozilla prism (although inactive today) or Microsoft HTA (html application).
You can think of using a framework that does the browser embedding for you like Titanium. It's mostly used for creating apps that can be published to iphone, android, and windows devices. It will create a windows MSI install.
Another option is to use the CEF project ( Chromium Embedded Framework for C/C++). I havn't looked at it much, so I can't tell you how difficult/easy it is to work with. Their main site also has wrappers for Java, .NET, and other languages.

What are the advantages/disadvantages of using the Add-on SDK to develop my Firefox extension?

I am developing (yet another) password manager add-on for Firefox. My add-on needs to:
Add two context menu items to each password field.
Open a dialog box or floating panel when the menu item is selected.
Access a specific method of a specific XPCOM component.
Fill the password field.
Include a preferences window.
Be compatible with Firefox 4.0.
Preferably, also:
Run on Firefox 3.5 and 3.6.
Some users don't update to the latest version.
Firefox 4.0 won't run on a PowerPC Mac.
Install without a restart on Firefox 4.0.
Allow for localization.
I have tried the Add-on SDK (formerly known as Jetpack), and it makes it very easy to start developing. However, I find that HTML cannot easily create "native looking" dialog boxes and that the SDK is rather heavyweight. (It takes many kilobytes to build a simple extension; that includes an XPCOM component!)
What are the advantages and disadvantages of using the Add-on SDK to develop my Firefox extension? Is it ready for "serious" extension development?
Advantages:
Jetpack API exposes high level APIs for most of the things you mentioned:
Add two context menu items
floating panel
API for password manager
Jetpack based add-ons are restart-less.
Jetpack based add-ons are future proof in a sense that high level APIs will remain unchanged
for the coming versions of FF.
You may be able to use some community developed modules for APIs that are not exposed by SDK.
If this is not the last extension you're planning to build there is a potential for code reuse,
by building third party modules as ones mentioned in 4 (see docs for details)
Support for mobile FF is coming in post 1.0 version of Addon-SDK which may mean that your
extension can be made compatible with mobile version of FF with minimal to zero effort.
Jetpack comes with build-in unit testing framework.
Has a better security model, which will ease add-on review process.
Jetpack support commonjs modules / packages that which means that some of the code can be borrowed
from other projects like nodejs for example.
Disadvantages:
Jetpack no longer supports FF<4.
Does not yet have support for localization.
Has no API for building preference panels, but can be developed as third party module and shared
with rest of the community.
Add-on will contain code with layers of abstractions, that will increase size of add-on (there is
ongoing work that will reduce xpi size by excluding files that are not used by add-on).

Resources