Changeset 37622


Ignore:
Timestamp:
2023-04-07T14:58:56+12:00 (13 months ago)
Author:
anupama
Message:

The gs3-server app would not open a new tab in an existing firefox window on my assigned linux, but if firefox was entirely closed, the firefox command that the gs3-server app runs to raise a new tab does work to launch a new firefox window with the tab opened on the specified URL. I could not test any of this on the VM, as I don't know how to get graphics working especially with the jump host intermediary. A new firefox command suggested in an AskUbuntu page however does now consistently work to open a new tab in an already open firefox window on my regular linux machine. So I'm committing this updated command just for when the available browser is firefox, but not when it's mozilla, as the older raise command apparently used to work for both firefox and mozilla and may potentially still work for other mozilla browsers for all I know, so I don't want to risk breaking it for them.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/util/BrowserLauncher.java

    r31665 r37622  
    101101                // mozilla and netscape, try using a remote command to get things in the same window
    102102        String new_command = prog_name +" -raise -remote openURL("+url+",new-tab)";
     103       
     104        // In 2023, firefox using above command wouldn't open a new tab if a firefox was already open
     105        // This command works however to open a new tab in existing firefox window:
     106        // firefox --new-tab --url <URL>
     107        // from https://askubuntu.com/questions/1123803/opening-a-new-tab-in-firefox-through-the-terminal
     108        if(lower_name.indexOf("firefox") != -1) {
     109            new_command = prog_name +" --new-tab --url "+url;
     110        }
     111       
    103112        logger.info(new_command);
    104113        Runtime rt = Runtime.getRuntime();
Note: See TracChangeset for help on using the changeset viewer.