This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-09-26 12:59:14

dcleal
Scratcher
Registered: 2008-11-30
Posts: 1

Launch browser under Linux

It would be quite easy to implement browser launching under linux (currently works under OSX and Windows but not Ubuntu). This just requires a change near the top of the file unixScratchOps.c. Below is my implementation (just the changed part of the file shown) based on the plugin source code from the Scratch website. This works fine, for me at least, on my Ubuntu 10.04 box.

- Dave

Code:

#include "scratchOps.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void OpenURL(char *url) {
    char* command = malloc(strlen("xdg-open ") + strlen(url) + 1);
    sprintf(command, "xdg-open %s", url); 
    system(command);
}

...

Offline

 

Board footer