I built a Web server myself, want to achieve the entire browser minimization,except "JAVA" and "JSP", what method can achieve this effect. There are a lot of examples of browser minimization using "JS" on the internet, but none of them worked for me. Some people mentioned that it might be the ActiveX controls. I don't know what the problem is. Please help me to solve the problem, because I am a rookie, please tell me detailed , thank you very much! Here is an example of using JS for browser minimization that I found on the Internet:

<object id="min" classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">
<param name="Command" value="Minimize">
</object>
<object id="max" classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">
<param name="Command" value="Maximize">
</object>

<input type="button" value="minimize" οnclick="min.Click()">
<input type="button" value="maximize" οnclick="max.Click()">

You must explain what you are doing here. https://www.google.com/search?&q=browser+minimization didn't tell me and I can't guess exactly what you want to do here.

If I take your last discussion as part of the goal this starts to sound like the rather awful advertisement schemes with hidden browser windows, popups or more.

-> Be clear in not only what you want to achieve but why so that there is no doubt in what your question is.

Why are you planning to do this? What purpose does minimizing the browser serve?

Also, ActiveX has been deprecated for over fifteen years - you shouldn't be using it at all. Internet Explorer 10 and later (circa 2012) dropped support for it,. and neither Firefox nor Chrome ever supported it in the first place AFAIK. No modern browsers support ActiveX.

As for the answer, I doubt that there is a single solution that would work on all or even most browsers.

commented: An example was "bitcoin in a web browser so minimize or hide the browser window." +16
commented: only reason I can think of for hiding a popup from the user is if it runs suspicious code in the background... +16

My answer may not be considered helpful in a programming sense, but dear god please don't do this. If there's a top-ten list of most obnoxious website behaviours, this should be on it.

Seriously, what do you want to actually achieve in the long run and why do you think this would help to do that? There may be an all-round better alternative that you haven't considered and may be more doable.

(Moderation Note: Put your company name in your profile and if you wish, tagline.)

I'm sorry that I didn't explain it clearly before, which made everyone misunderstand. My code is just a personal learning test and will not be posted to the internet. I found many browsers in my country, if you call "window.open" directly, it will be blocked, except you call "window.open" with "onclick" in the "button" tag. My purpose is that the people can see a prompt timing, and the prompt will calls the "window.open" of the "button" tag to open a new page, but doesn't affect the user's browsing until the prompt is up.I tried to implement sleep without the button page being closed to make the button page focus periodically,so the button icon will display timing, but failed.But when I tested it, I found that using "window.open" and made the button page at the bottom of all pages, when the browser was minimal ,the button page will become focus.

As part of the learning is what does and does not work. Because of prior bad behavior by advertisers you can't be sure that what you are trying will function. You should find differences across browsers too.

Since there are at least a dozen browsers and possible thousands of settings that can affect this along with pop-up blockers and add-ons when you find something that works (or not) it doesn't mean it will work or not for others.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.