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

10
LINES

< > BotCompany Repo | #1026326 // startChromeAppWithWindowBounds

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

Libraryless. Click here for Pure Java version (4887L/31K).

1  
// use keepFile := true if you are exiting the JVM really quickly after using this function
2  
svoid startChromeAppWithWindowBounds(S url, Rect bounds, O... _) {
3  
  optPar bool keepFile;
4  
  if (bounds == null) ret with startChromeApp(url);
5  
  File f = keepFile ? cacheProgramFile("chrome-app.html") : createTempFileWithExtension(".html");
6  
  saveTextFile(f, hjavascript(
7  
    javascript_setWindowBounds(bounds) + "\n"
8  
      + "window.location=" + jsQuote(url) + ";"));
9  
  startChromeApp(f);
10  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1026326
Snippet name: startChromeAppWithWindowBounds
Eternal ID of this version: #1026326/2
Text MD5: f8f42b5aa8858708255839bec65c24aa
Transpilation MD5: e3ba3b7c197330b57c5f0b6af2083f56
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-12-21 13:38:16
Source code size: 492 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 196 / 280
Version history: 1 change(s)
Referenced in: [show references]