Run firefox extensions in xulrunner - firefox-addon

I am just wondering if is it possible to run extension like colorzilla / firebug in xulrunner.
In fact I am creating my own extension now and I was trying addon_sdk but this is very problematic to put extension icon/button next to location bar.
So I decided to work with xul, and I know that problem doesn't exist here. And Of course the best way to learn is analyze other code, a changing it. But I can't run any extension in xulrunner. Any hint / help ?

xulrunner is just a runtime or platform. You'd need an actual app on top of that. In that regard, Firefox, Thunderbird, Seamonkey, InstantBird, etc. can be considered (complex) xulrunner apps.
Existing extensions may run, with or without modifications in such a xulrunner app. Well, likely with modifications, as most extensions use APIs specific to Firefox or Thunderbird or ...
The add-on SDK is not generally isn't a good fit for generic xulrunner apps: It is too much tailered against Firefox specifically.

Related

How can I create hybrid apps on IOS?

I see on Android that apps exist to create android apps. I understand nothing like this exists on IOS because of apple's terms. On IOS however, some apps, pythonista for example, allow the user to create scripts that run similar to apps. Is this functionality currently available for hybrid frameworks, IE phonegap/cordova, react native, etc? Barring this, is there some method whereby I can code and test such apps on my iPhone/iPad?
Bottom line, I want to code apps while commuting, etc, on IOS. I understand I need a computer to compile the final product, that's ok, it's just the coding/testing process I want to do on IOS.
I am up for any hack you can think of to make this work, so long as it is accessible with VoiceOver, apple's screen reader, as I cannot see at all. One example of something I thought of that won't work is using remote desktop software, there is no such software that is accessible as it uses an image of the remote screen, I have no access to this.
I am looking forward to your creativity, so far this has me stumped.
Thanks in advance.
Similar to the playgrounds answer, but if you wanted to use Xamarin you could use Continuous .NET. It’s a C# IDE for iOS. You could then use Working Copy to to keep the version on your computer in line.
The other option is to VNC into your computer at home, but if you’re on the train that might not be a great option.
It's not a solution for your problem, but if you have an iPad, you can write parts of apps in Swift Playgrounds. There you have access to all the UIKit stuff. Unfortunately some of the frameworks you can use in iOS are missing.

What would be the best way to create a firefox plugin for taking desktop screenshots?

I need to create a firefox plugin that allows a user to take screenshots of any part of their desktop and have them uploaded to a server. There seems to be lots of plugins for screen capturing a webpage, but nothing for capturing anything outside of firefox. So after a little research I have not found much information on how this might be possible. I don't want to resort to a using a java applet but I will if that is my only option.
Does anyone have advice on how I might create such a feature?
Thanks
I don't think a Firefox addon is the most appropriate approach here. Maybe split the task into a Firefox addon to offer the "upload to a server" component and a native app to do the desktop screenshot (or just integrate with existing screenshot tools).
If you're worried about complicating the installation process for end users, you could look into bundling the addon component and native app into a single installer (e.g. MSI on Windows, RPM on Linux, etc.). You'll have to come up with different apps for each platform you want to support (and maybe even each version - e.g. Windows XP vs Windows 10).
Whatever you decide, you'll probably need to create a more specific question to get further help here (there's no simple Firefox.Addons.API.TakeScreenShot() answer I'm afraid).
Also make sure you're using the right terminology - a plugin is the deprecated NPAPI approach whereas addons are still supported.
I'm actually working on taking native desktop screenshots just in the last coupel of days. I'm using js-ctypes. My work goal is the same exact thing to, upload to server. If you would like to collaborate I am very open to it! We can chat about it on #jsctypes irc channel :) irc://moznet/jsctypes (Mibbit IRC WebApp) If you don't know js-ctypes thats ok i can handle that while you can handle uploading techniques, and an editor on canvas :) The editor is a huge part of it, you can see my ideas/plans here: https://github.com/Noitidart/NativeShot/wiki/NativeShot
I'm really really interested in a collab on this!
I'm still working on windows right now, the color is messed up: https://github.com/Noitidart/NativeShot/tree/digitanks-method
I was just about to start OSX work following this example here: https://developer.apple.com/library/mac/samplecode/SonOfGrab/Introduction/Intro.html and here: Take ScreenShot without Window
You can install the addon from that branch and click the icon that gets added to the toolbar, it will take a screenshot with 3sec delay and then append it to the body of the selected tab. (Windows only right now)
Doneskis baby check it out: https://addons.mozilla.org/en-US/firefox/addon/nativeshot/
Got some quirks. Released it as v1.0 though. I'm working on Android support, pretty close. I need to flesh out the editor tools. Please let me know if you're willing to collaborate.

Can i use XULRunner to create executable that acts like a phonegap app (WebView and fullscreen?) on the desktop (Windows/Linux/OSX)?

Story:
I have written a HTML Merge Compiler that can merge resource's/assets into one single HTML file (minify it to the max) and compiles Javascript with the google enclosure compiler. I have written this compiler to speed up loading and interpreting the code and to obfuscate the code to protect a little bit (script kiddie protection). Major reason was/is speed and to make it compact.
This is working OK with reliable results and i use this in PhoneGap applications/games. I have also written a javascript library that encapsulate all platforms that works with standard HTML/CSS without the need to change the code, it works also in the browser, with a touchscreen or without or on any device or operating system. Write once, publish many ;-). The idea around it is that is working always, always operate the same but can use device specific things when available but does never fail (when something is not there, for example a vibrate functionality).
Anyway, most frameworks (like PhoneGap) concentrate on Mobile Platforms but i want to port it also to desktop platforms like Windows, OSX and maybe Linux. For Windows I have wrote an Delphi Application that loads the HTML in a TEmbeddedWB object (is Internet Explorer actually) but the 'problem' is that it is only suitable to Windows and IE is not the fastest browser around, especially when it is embedded (do not why it is slower than the browser itself). For example, when i load the compiled code in Firefox and/or Google Chrome it is blazing fast (you do not notice it is javascript ;-)).
EDIT:
Pre release of IE10 for Windows 7 is just launched, installed it and lag is gone!
You can download it from here:
http://www.microsoft.com/en-us/download/details.aspx?id=35709
Introduction to my question:
I have tried XULRunner of Mozilla a long time ago but the first time was not a pleasure to me and also i tried it today again but can't get it to work. Get a parse error in the main xul file of the project, window is an undefined entity. ??? I create a sample project like: http://mdn.beonex.com/en/Getting_started_with_XULRunner.html
I do not know what to do about this error. Also i think documentation is not up-to-date? Most documentation is from around 2006.
The question, what i want to know:
Before i am going to waste my time (see also introduction), is it
possible to create frameless (full-screen) desktop executables with
use of XULRunner like with PhoneGap?
Is it possible to create cross-platform applications with XULRunner, i mean, does it really work seamless. Where can i find a ready-to-publish example of a XULRunner project and is it possible to load local HTML file(s) like in PhoneGap?
It is possible and allowed to access external resources?
Long story, but maybe there is somebody that have tried this before and can lead me to choose the right direction.
is it possible to create frameless (full-screen) desktop executables with use of XULRunner like with PhoneGap?
Yes. You use disablechrome attribute to remove the window frame and sizemode="maximized" to have it open full-screen. Alternatively you can use the full-screen API if you want your application to run in a normal window and only switch to full-screen mode on request.
Is it possible to create cross-platform applications with XULRunner
Yes. There are things like menus that work very differently on OS X but most of the time you don't need to care what operating system your application runs on (Windows, Linux and Mac OS X supported).
Where can i find a ready-to-publish example of a XULRunner project
See documentation for a XULRunner application example. For "ready-to-publish" you would need an installer which doesn't come with the platform.
is it possible to load local HTML file(s) like in PhoneGap?
Yes. The top-level window has to be XUL but you can use some very minimal code here - essentially a single <iframe flex="1"/> tag. You can load HTML pages into that frame then.
It is possible and allowed to access external resources?
Yes, XULRunner applications have full privileges and can access files on disk as well as web resources without any restrictions.

Questions on backwards compatibility of Firefox Addons/Extensions

Background info:
Over the past week, I have been messing around with Chrome extensions and had no problem creating my extension. Great, Chrome rocks for making the development process very easy to learn, and, well... just easy!
Now I have it in my mind that I'd like to create this extension for as many browsers as I can, so I decided on Firefox next.
What a mess! There documentation has done nothing but give me a headache and waste my time so far, VERY convoluted and just generally unorganized.
I have managed to locate a code sample for a simple extension that I think I can use as a starting point and have begun messing around with - fine...
I have learned that this sample extension will not work with anything less than Firefox 4, as it uses the bootstrap technique to make the extension installable without a browser restart. Ughhhhhh....
Now we arrive at my questions:
Is it possible to develop an extension for Firefox 7 that will work with previous versions of Firefox? I don't even care about anything prior to Firefox 4, if that's the cutoff point for restart-less installations. It would be nice to know that what I am spending all this time making will work consistently and for more than a week when the user is prompted to upgrade next.
How about the reverse? Can I create an extension that is compatible with Firefox 3.5 through Firefox 7? I realize it would require a restart to install, but that would be acceptable if it resulted in a working extension regardless of the version.
Can anyone with experience on this stuff share a bit of what I'm getting myself into here? It seems like this is a nightmare of a platform to develop on, and that I will be constantly fixing my extension.
One last piece of relevant information:
The extension I am developing is purely javascript based - this stuff should work (I think?) because it's dependent on just one feature "content scripts" that really shouldn't be changing in implementation between versions at this point... right?
So what exactly am I missing? How do you create easily manageable Firefox extensions that will work in all versions of the browser?
Thanks everyone! :)
You have to distinguish between "traditional" extensions and extensions built with the Add-on SDK. The former are far more powerful given that they have direct access to all APIs the browser uses - but that's also the reason why they are more complicated to write and why the documentation is rather unordered (there are simply very many things that you could do, far more than you could with Chrome). They are also more likely to break as the browser changes. The Add-on SDK on the other hand gives you a limited API much like Chrome. The Add-on SDK currently supports everything from Firefox 4 onwards (yes, because of restartless installation), with the promise that browser changes will merely require your add-on to be recompiled with a newer version of the Add-on SDK. In fact, that recompiling will likely happen automatically in future for add-ons hosted on addons.mozilla.org. On to your questions:
Is it possible to develop an extension for Firefox 7 that will work with previous versions of Firefox?
Sure it is. The Add-on SDK currently marks your add-on as compatible with anything between Firefox 4 Beta 7 and Firefox 8 Alpha 1. Even as traditional add-ons go - starting with Firefox 4 the differences between particular browser versions are rather small, most things work in all of them. You can also stay compatible with Firefox 3.x but depending on what you do it might require some effort. Important information:
Firefox 4 for developers
Firefox 5 for developers
Firefox 6 for developers
Firefox 7 for developers
How about the reverse? Can I create an extension that is compatible with Firefox 3.5 through Firefox 7?
It doesn't matter which way you go. I wouldn't recommend spending much time on Firefox 3.x support however. With Firefox 3.5 no longer supported the only relevant version is Firefox 3.6. According to the statistics of my add-ons roughly 18% of the Firefox users continue using it. In the next few months this percentage will get significantly smaller, especially when Mozilla announces end-of-life for this branch. So for a new add-on supporting it is usually not justified.
Can anyone with experience on this stuff share a bit of what I'm getting myself into here?
Depends on how complicated your add-on will be. Given that you are developing an equivalent to a Chrome extension, you will most likely be using the Add-on SDK which means that there won't be any compatibility problems. As traditional add-ons go, simple add-ons that don't rely on some obscure implementation details also typically don't have any trouble staying compatible (I have two add-ons that didn't need a single adjustment since Firefox 3.5). Add-ons that go deep down into the system are more problematic of course.

Firefox extension: native code execution?

Is it possible to write an extension that runs native, platform-dependent code? I'm an extension-newbie (what a phrase!) :), can you please point me towards good material on this subject? (good keywords to feed to Google are enough)
(I would like to put a GtkMenu in Firefox)
Edit:
I started checking out the Gecko SDK, and it's a rather big subject, and I'm not sure this is what I want.
I'd be happy with a friendly manual (which is not a raw reference, but rather some kind of tutorial on how to make extensions that utilize XPCOM (if that is the way). Good keywords are still appreciated.
Check out the Gecko SDK.
You can use it make portable C++ native code firefox extensions which I believe are XPCOM objects with JavaScript wrappers in the .xpm zip file.
I haven't tried it, but you can go the usual route and write the plugin, I mean extension, in javascript also.
Native Client doesn't quite offer the breadths of API firefox extensions offer, but it's still well worth checking out for your purposes IMHO.
Yes, you can. Witness the Cooliris extension, that makes (heavy) use of your 3D graphics card, and is Windows specific.

Resources