Adjusting the size of Internet Explorer 11 with Java

I am facing difficulty resizing IE11 in kiosk mode. Launching in kiosk mode forces it to go fullscreen, but turning off kiosk mode shows the toolbar & navbar, which I want to prevent a user from editing the URL. Is there a way to achieve this without using JavaScript? My attempts with JS have been unsuccessful so far.

One of my attempts involved using ProcessBuilder, but it resulted in a save file dialog instead of resizing the window as intended.

I also tried another approach using

javascript:moveTo(0,0);resizeTo(1024,768);}
, but couldn't figure out the issue due to console being disabled in kiosk mode.

My current setup is utilizing 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();
        }
        }

Answer №1

Resizing the IE kiosk window is not a feature that is supported. Kiosk mode operates by running the browser in a fullscreen window, so it would be contradictory to try and resize it to a non-fullscreen window simultaneously. It simply doesn't align logically.

If you're looking for more information on this topic, you may find answers in this resource.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Exploring the ios ios predicate strategy for XCUIElement in Appium

Currently, I am working on implementing mobile autotest using appium 1.6.0-beta1 with Xcode 8, iPhone iOS 10 simulator, and java. I am interested in locating elements without using xpath. In previous versions like appium 1.5.3, I could utilize Ios Automat ...

Is your website's Google analytics event tracking not giving you the feedback you need

Here's what I'm trying to achieve in the code below: Set up Google Analytics on the page Add a jQuery click event based on specific query strings and domain characters Trigger a Google Analytics tracking event with the click event Implement cod ...

Building Individual Elements in Angular 2

My task involves creating two distinct components in Angular 2, the Users component and the Clients component. These components are not nested and do not have any relationship. To call these components separately, I typically use main.ts as the main entry ...

Combining outcomes from two separate jQuery AJAX requests and implementing deferred/promise functionality

I am struggling to combine the outcomes of two jQuery AJAX requests. Despite reviewing similar questions here, none seem to provide a solution. Each ajax call (2 in total) has a success function that calls the createStatusView function and passes it the ...

Steps to rotate a jpeg image selected from an HTML input field and then convert it into a base64 string

My current project involves using Angular to display an HTML image file. I have access to the EXIF data and am looking for a way to rotate the image client-side based on this information. Right now, I am saving the image as a base 64 string but need to i ...

What is the best way to integrate an admin template into a website without relying on popular CMS platforms like WordPress?

Do I need to use a WordPress system in the backend in order to utilize an admin template? I've noticed that there are several sleek web admin templates available in Bootstrap. I'm interested in using one of them but unsure how to do so without re ...

Issue with Pop Up not redirecting correctly after a successful login in Azure AD

I recently integrated Azure AD with my web application. When clicking on the login window, a pop-up appears with the URL . It prompts for the Azure AD username and password. However, after successfully logging in, a code is returned as a parameter but the ...

What is the most efficient approach to completing everyday tasks directly in a Vuex store?

Currently, I am working on making API calls from within a Vuex store action object. Here's an example of one of my actions: /** * Check an account activation token * */ [CHECK_ACTIVATION_TOKEN] ({commit}, payload) { Api.checkActivationToken(payl ...

What is the best way to deploy a nodejs expressjs application to a server?

I have successfully developed a nodejs and express application that works perfectly on my localhost. To start the application, I simply run the command npm start or node index.js. Recently, I uploaded all the necessary files, including node_modules, to a ...

Having trouble with the DOM className property inside the setTimeout() function?

I'm currently in the process of developing a React component that has the ability to display either a "peg" or a "nopeg" (essentially just an empty space with no peg). This functionality is achieved by simply toggling the class of the Peg component. I ...

Adjustable <a> component

There is this element: <a id="lnkViewEventDetails" class="psevdo calendar-event event" style="height: 126px;" href="/someurl/895?responseType=5" onclick="event.stopPropagation();"> I am trying to make it resizable using JQuery UI: $("#lnkViewEvent ...

Creating Responsive Image Map Areas in HTML

Implementing image maps on my website has been a challenge because of the lack of responsiveness. I am struggling to adjust the size of map areas when resizing the window. If anyone can help with this issue, I am open to using either JavaScript or CSS met ...

Issue with dynamically added inputs rendering Jquery Masked Input ineffective

Currently facing a challenge while creating a signup form for a project. The issue lies in the functionality of my form which allows users to click an "add contact" button to dynamically generate more input boxes on the page for entering additional user in ...

Array Not Defined

I am attempting to create a for loop using a variable, but it seems like I'm running into an issue. No matter what I try, the length of tempArray always remains undefined. I can't figure out why this is happening. Can anyone offer some assistance ...

Is there a way to have an audio file start playing in a Java method, and then stop that file from playing when the method is called again?

Currently, I am working on developing a guitar simulator project. The goal is to have a method that plays a note every time it is called, with the capability to stop any previously playing notes when called again. public class ytst { public s ...

Add the content of a JavaScript variable to a label without using any scripting

Is there a way to concatenate the value of a JavaScript variable with a label without utilizing jQuery? For example: Var global_message = "1234"; <label id="my-label">Test</label> I desire the concatenated value "Test1234" to be displayed o ...

substitute a component with a different one if it is present

I'm currently working on a script that will automatically replace one element with another as soon as it is created, even when the page loads. Despite my attempts to use MutationObserver, I haven't been successful. var target = document.querySe ...

How to Implement a Loop Inside a JavaScript Alert or Prompt?

Seeking clarity: Is it possible to embed code into an alert() or prompt()? For example, is there a way to include a loop or add data to the alert() or prompt just before execution or during execution? -Appreciate any help ...

Invoking an instance of a class from a separate entity

Displayed in the flowchart are three classes that I have created: Main Class Left Adapter Right adapter The main class includes a horizontal scroll view with two fragments as its children (left & right adapters). The left adapter features an inter ...

Converting dynamic text enclosed in asterisks (*) into a hyperlink on a webpage with the use of JavaScript

I'm facing a unique situation where I need to transform specific text on an HTML page into anchor tags using JavaScript/jQuery. The text format is as follows: *www.google.co.uk/Google* *www.stackoverflow.com/StackOverflow* The desired outcome should ...