Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

18
LINES

< > BotCompany Repo | #1008415 // openPlatformBrowser

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (9668L/53K).

1  
static swappable void openPlatformBrowser(S url) ctex {
2  
  if (isHeadless()) ret;
3  
  /*if (isLinux()) {
4  
    nohup(print(firstCmdOnPATH_mandatory("xdg-open") + " " + platformQuote(url)));
5  
  } else {*/
6  
    print("Opening platform-specific browser on: " + url);
7  
    //try {
8  
      Desktop.getDesktop().browse(uri(url));
9  
    /*} catch print e {
10  
      startFirefox(url);
11  
    }*/
12  
  //}
13  
}
14  
15  
svoid openPlatformBrowser(URL url) {
16  
  if (url == null) ret;
17  
  openPlatformBrowser(str(url));
18  
}

Author comment

Began life as a copy of #1008412

download  show line numbers  debug dex  old transpilations   

Travelled to 17 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ekrmjmnbrukm, gwrvuhgaqvyk, ishqpsrjomds, iveijnkanddl, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1008415
Snippet name: openPlatformBrowser
Eternal ID of this version: #1008415/11
Text MD5: e9d9b30c6fdf977ff5d1caae67f8680c
Transpilation MD5: a3ab881c70e06e13a0369818d024dda5
Author: stefan
Category: javax / desktop
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-11-26 17:16:45
Source code size: 492 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 629 / 882
Version history: 10 change(s)
Referenced in: [show references]