Mac Xulrunner multiple application issue - Mozilla

This is a discussion on Mac Xulrunner multiple application issue - Mozilla ; We have a Xul based application which is running fine on windows. Recently we have ported it on Mac. I launch application using below command /Users/Mike/TestApp.app/Contents/MacOS/xulrunner www.xyz.com Note: www.xyz.com is a argument to a xulrunner This application gets invoked from ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Mac Xulrunner multiple application issue

  1. Mac Xulrunner multiple application issue


    We have a Xul based application which is running fine on windows.
    Recently we have ported it on
    Mac.
    I launch application using below command

    /Users/Mike/TestApp.app/Contents/MacOS/xulrunner www.xyz.com

    Note: www.xyz.com is a argument to a xulrunner


    This application gets invoked from firefox browser using java script.
    So user
    just click on hyperlink and buttons on Html page. A java script pass
    user
    selected url as argument to XUL application.

    On windows. we can pass to argument to xulrunner.exe. So it opens a
    new xul window.

    but Mac doesn't allow to open multiple application.
    so if I can get some control where i can detect that application is
    running and than pass that url to already
    running application. So than application will open a new chrome window
    with URL argument

    Can anybody let me know how to do this on Mac.





  2. Re: Mac Xulrunner multiple application issue

    On Aug 18, 7:40*pm, Benjamin Smedberg wrote:
    > On 8/18/09 10:22 AM, Raj wrote:
    >
    > > but Mac doesn't allow to open multiple application.
    > > so if I can get some control where i can detect that application is
    > > running and than pass that url to already
    > > running application. So than application will open a new chrome window
    > > with URL argument

    >
    > > Can anybody let me know how to do this on Mac.

    >
    > Arguments to running mac applications typically don't flow directly through
    > command-line invocation: they come from apple events.
    >
    > A useful way to open a URL in a new or already-running application is to use
    > `open` (see `man open` for details):
    >
    > bsmedberg $ /usr/bin/open -a /Applications/Firefox.apphttp://benjamin.smedbergs.us/
    >
    > This should work for other applications which handle apple events. I believe
    > this ends up transformed into a -url command line invocation, at least in
    > XULRunner 1.9.2. I'm not sure whether this made it into 1.9.1 or not.
    >
    > --BDS


    Hi Benjamin

    I have tried 1.9.2 pre release of Mac version to pass URL . but still
    the same issue persist.
    I want firefox on Mac kind of implementation. On mac Firefox , you can
    pass url to firefox as argument and it will check if firefox is
    running or not.
    if not system launch firefox and open a URL.
    If firefox is running then it opens a new tab/window and open a URL


    it seems that you can not open two firefox instance from Mac terminal
    but you can pass argument and invoke browser with two tabs from
    terminal.

    Could you help how this implementation is done.

    I have also tried below approach but couldn't succeed.
    https://developer.mozilla.org/en/Chrome/Command_Line

    if Apple Event is the solution then can you point me some web url or
    demo application. i am new to c++/c

    Thanks a lot

  3. Re: Mac Xulrunner multiple application issue

    On Aug 19, 8:36*pm, Benjamin Smedberg wrote:
    > On 8/19/09 11:23 AM, Raj wrote:
    >
    > > I have tried 1.9.2 pre release of Mac version to pass URL . but still
    > > the same issue persist.

    >
    > What exactly did you try, and what issues persists?
    >
    > > I want firefox on Mac kind of implementation. On mac Firefox , you can
    > > pass url to firefox as argument and it will check if firefox is
    > > running or not.

    >
    > No you can't. If you try to launch
    > /Applications/Firefox.app/Contents/MacOS/firefox-bin twice it will refuseto
    > launch because the app is already open. It will only work if you use the
    > `open` command.
    >
    > Unlike Windows and Linux, where Firefox is responsible for sending the URL
    > to the already-open instance, on mac the operating system is responsible for
    > sending the URL to the already-open instance, which is why use need to use
    > `open` instead of launching the application directly.
    >
    > > I have also tried below approach but couldn't succeed.
    > >https://developer.mozilla.org/en/Chrome/Command_Line

    >
    > You tried the approach and what happened? Was your command-line handler called?
    >
    > --BDS


    Regarding XULRunner 1.9.2 Consider Mac application is Test.app which
    has xulrunner 1.9.2 in Framework folder.
    I tried below command on mac. both failed to launch test.com
    1. /Applications/Test.app/Contents/MacOS/xulrunner www.test.com
    2. open Test.app www.test.com


    /Applications/Firefox.app/Contents/MacOS/firefox-bin twice will fail.
    i agree that it will open URL using 'open' command.
    How does Mac sends the URL to the already-open instance. If i want
    similar implementation how can i do that.


    I tried https://developer.mozilla.org/en/Chrome/Command_Line approach
    to pass argument. it was invoked before my applicaiton gets control.
    But if one instance is already running then i can not invoke second
    applicaiton instance. Now i understand that it can be handled by Mac
    OS using open command.

    I will make my application as tabbed browser so everytime a user pass
    a new url to my already running applicaiton, i will open a new tab and
    render that URL.

    Could you help me how can I handle mac open command

    Thanks a lot

+ Reply to Thread