SummerOfCode/2012/LinuxNativeWebApps: Difference between revisions

 
(4 intermediate revisions by the same user not shown)
Line 64: Line 64:
== Weekly status reports ==
== Weekly status reports ==


I'll write here weekly reports about my work, starting from May 21.
I'll write here weekly reports about my work, starting from May 21. (The date format is DAY/MONTH).


=== 21/05 - 28/05 ===
=== 21/05 - 28/05 ===
Line 120: Line 120:


Thanks to the Linux Mozilla community, we now know that Web Apps are working on Cinnamon and KDE too (but we'll need the categorization to improve the integration of web apps in the menus).
Thanks to the Linux Mozilla community, we now know that Web Apps are working on Cinnamon and KDE too (but we'll need the categorization to improve the integration of web apps in the menus).
=== 11/06 - 18/06 ===
This week was pretty calm. We added a notification in the Marketplace after the installation of an application on Linux. I've registered an account on GitHub to do this.
If you have any idea on how to improve the message, feel free to comment on the pull request (https://github.com/mozilla/zamboni/pull/340#commitcomment-1459497).
I've started the work about moving the installation directory under $XDG_CONFIG_HOME and to support uninstallation through a desktop action.
Moving the installation to $XDG_CONFIG_HOME isn't so simple as I initially thought, because of the way Firefox handles profile directories: https://bugzilla.mozilla.org/show_bug.cgi?id=763183
Instead, supporting the uninstallation through a desktop action is pretty simple. I've developed a patch that is waiting for a review: https://bugzilla.mozilla.org/show_bug.cgi?id=761806
We've also found out two bugs related to re-installation of a running application (bug 763375 and bug 751898), that I think could be solved by disabling the re-installation of a running application by locking its profile (https://bugzilla.mozilla.org/show_bug.cgi?id=765380).
And we've found out that the installer was removing the profile directory for each re-installation (only on Windows and Linux), so if you tried to re-install an application, you would lose all its data (also the authorizations, like the geolocation one).
I've started to work on a patch to solve this problem: https://bugzilla.mozilla.org/show_bug.cgi?id=764172.
=== 18/06 - 02/07 ===
Sorry, I forgot to write a report for the last week. I'll now write a report for the last two weeks :)
I attended an Italian conference about free software with other Mozillians (you can read the report here: https://hacks.mozilla.org/2012/07/report-from-ancona-confsl-2012/).
I worked on some cross-platform problems about webapps reinstallation. This isn't a common use case, but it's however good to fix.
I've continued to work on webapps uninstallation through a specific desktop action (desktop actions are for now supported only by Unity, there's a bug in the GNOME bugzilla but no one is working on it and sadly, in my opinion, they will not support them in time for GNOME 3.6). I've also learned how Mozilla handles localization.
So we need to support uninstallation through about:apps, I'll find out if there's someone actively working on that page, otherwise I'll continue Fabrice's work: https://bugzilla.mozilla.org/show_bug.cgi?id=702363.
I hope about:apps could be finished in time for Firefox 16, otherwise a lot of Linux users won't be able to remove applications in a simple way.
During the last week, I've also studied for an exam: "Theory of Signals" (that I did on the 3rd of July).
=== 02/07 - 06/08 ===
I've worked to enable mochitests for the webapp runtime on Linux and Windows (with this work I've also seen how the mochitest works internally). It wasn't hard as the Mac OS X part was already implemented.
I've finished the work to support webapps uninstallation. I've split the work in several parts to ease the backport to Aurora (I'd like to backport the feature, that has landed in Firefox 17, to Firefox 16). Now there's support to uninstall the application by using a command-line argument (“-remove”) or through a specific page (about:apps or a web dashboard, like myapps.mozillalabs.com). Actually there's a function in the mozApps API (https://developer.mozilla.org/en-US/docs/Apps/Apps_JavaScript_API/navigator.mozApps.mgmt.uninstall) that removes the application (on Linux it removes the application from your computer, on the other platforms it currently removes the application only from your profile), and the dashboards use this function.
I've also finished the work to support categorization of web applications. Now the install function of the mozApps API (https://developer.mozilla.org/en-US/docs/DOM/Apps.install) accepts a JSON object, and in this JSON object you can pass the category (or the categories) of the application. We support the categories of the Mozilla Marketplace, you can see this patch (https://hg.mozilla.org/mozilla-central/rev/b8b948b3565a#l1.31) to see how we translate the Marketplace categories to standard freedesktop.org categories (I hope the translation was better, I'd like to have some user feedback about it).
The category isn't stored in the Application object (that you can retrieve using the getSelf mozApps API function), but you will be able to get it through install_data (that will be in the Application object in the future: https://bugzilla.mozilla.org/show_bug.cgi?id=760339).
I'm now working to move the installation to $XDG_CONFIG_HOME, but this isn't a high priority work. I've encountered many problems, but I've finally figured out what's their cause. I can change the profile directory through the “-profile” command-line argument (or through an environment variable, XRE_PROFILE_PATH), but even after that the “AppRegD” directory (that is the Application Registry Directory) and other  “special” directories still use the normal directory format (/home/user/.appname/). The “AppRegD” directory is used by the Crash Reporter.
During these weeks I've studied for other exams and I've been on vacation in Ponza (an Italian isle) and in Scotland.
=== 06/08 - 13/08 ===
I've managed to write a patch to support installation in $XDG_CONFIG_HOME, it involved some code changes in how Firefox finds the user data home directory.
https://bugzilla.mozilla.org/show_bug.cgi?id=763183
I've added a notification for add-ons (through https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsIObserverService) after the installation of a webapp. This way, add-ons could do something after installation, for example they could create a deb or rpm package and install it, or something else to better integrate the webapp with the underlying platform.
I've also started to work on the user notification (a graphic notification, not a low-level notification for addons) after a webapp removal. There are some opportunities (a GTK alert, nsIAlertsService, dbus, dlopen libnotify), the best way would be to use the nsIAlertsService, but it's also pretty hard. Maybe I'll start with a simpler solution to have something in place for Firefox 17 (the notification involves the creation of new localizable strings, the patches with those strings are less likely to be backported).
I've also ported a SDL C++ game (Ceferino) to JavaScript, using Emscripten. Here it is: http://marco-c.github.com/ceferinoweb/. Using Emscripten is really simple, it took me only a day to port the game.
I'm going to upload it to the Mozilla Marketplace.
63

edits