Update debian/changelog
[browser-switch] / launcher.c
index 3ea9f80..a2aec71 100644 (file)
@@ -32,8 +32,7 @@
 #include "launcher.h"
 #include "dbus-server-bindings.h"
 
-#define DEFAULT_BROWSER "/usr/bin/tear"
-#define LAUNCH_DEFAULT_BROWSER launch_tear
+#define LAUNCH_DEFAULT_BROWSER launch_microb
 
 static void launch_tear(struct swb_context *ctx, char *uri) {
        int status;
@@ -84,6 +83,8 @@ void launch_microb(struct swb_context *ctx, char *uri) {
        if (!uri)
                uri = "new_window";
 
+       printf("launch_microb with uri '%s'\n", uri);
+
        /* Launch browserd if it's not running */
        status = system("pidof /usr/sbin/browserd > /dev/null");
        if (WIFEXITED(status) && WEXITSTATUS(status)) {
@@ -135,8 +136,10 @@ static void launch_other_browser(struct swb_context *ctx, char *uri) {
 
        if (!uri || !strcmp(uri, "new_window"))
                uri = "";
-       urilen = strlen(uri);
-       if (urilen > 0) {
+
+       printf("launch_other_browser with uri '%s'\n", uri);
+
+       if ((urilen = strlen(uri)) > 0) {
                /* Quote the URI to prevent the shell from interpreting it */
                /* urilen+3 = length of URI + 2x \' + \0 */
                if (!(quoted_uri = calloc(urilen+3, sizeof(char))))
@@ -223,12 +226,8 @@ void update_default_browser(struct swb_context *ctx, char *default_browser) {
                return;
 
        if (!default_browser) {
-               /* No default_browser configured -- use DEFAULT_BROWSER if
-                  installed, otherwise launch MicroB */
-               if (!access(DEFAULT_BROWSER, X_OK))
-                       ctx->default_browser_launcher = LAUNCH_DEFAULT_BROWSER;
-               else
-                       ctx->default_browser_launcher = launch_microb;
+               /* No default_browser configured -- use built-in default */
+               ctx->default_browser_launcher = LAUNCH_DEFAULT_BROWSER;
                return;
        }