Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

316
Visualizações
Resizing IE11 using Java

I have an issue with trying to resizing IE11 in kiosk mode but launching in kiosk mode would force it to go fullscreen but if I turn off kiosk mode, the toolbar & navbar, etc. will all be visible which is not what I want to prevent user from editing the url, so I would I be able to achieve that? I tried using JS, but it didnt work. Is it possible to do it without using JS?

I tried Process p = new ProcessBuilder("cmd.exe", "/c", "start iexplore -k javascript:resizeTo(400,300)\"" + newUrl +"\"").inheritIO().start(); , but it prompt save file dialog, instead of resizing.

Tried this too javascript:moveTo(0,0);resizeTo(1024,768);}, cant find out what is wrong for that, since the console is disabled in kiosk mode.

Currently using java-8.


private static String newUrl = replaceUserID(url);

public static void main(String[] args) {
        try{
            Process p = new ProcessBuilder("cmd.exe", "/c", "start iexplore -k \"" + newUrl +"\"").inheritIO().start();
            resizeBrowser();
            try{    
                p.waitFor();
            }
            catch( InterruptedException ie ){
                System.out.println("InterruptedException " + ie.getMessage());
            }
            InputStream err = p.getErrorStream();
            int ctr = 0;
            if ( (ctr = err.available()) > 0 ){
                byte[] buf = new byte[ctr];
                System.out.println("Process failed with error:\n" + new String(buf, 0, ctr));
                }
            }
            catch(IOException ioe)
            {
                System.out.println("InterruptedException " + ioe.getMessage());
            }
    }

public static void resizeBrowser() {
        ScriptEngineManager scriptEngineManager = new ScriptEngineManager();
        ScriptEngine javaScript = scriptEngineManager.getEngineByName("nashorn");
        
        try {
            javaScript.eval("function resizeIE(){"
                    + "newWindow = window.open(\"" + newUrl +  "\", IEWindow, resizable);"
                    + "newWindow.resizeTo(500,400);}");
        }catch (ScriptException e) {
            e.printStackTrace();
        }
        }
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I'm afraid it's impossible to resize IE kiosk window. Kiosk mode means run browser in fullscreen window. You can't tell the browser to run in fullscreen and non-fullscreen window at the same time. That doesn't make any sense.

For similar thread, you can also refer to this link.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda