Is there any way IE can be closed programmatically?
I am trying to build a simple login system for the school I am working at in which a pupil would sign in using a HTML form and when they click the submit button the window will close automatically.
I have tried this using JavaScript (close() seems to be redundant now), VBScript (.Quit) and trying to run a .cmd file to close it externally (Windows Script Host). None of these have worked.
I am not doing this maliciously and I have absolutely no bad intentions of using this code. I understand that it is a universal standard for web browsers not to be closed by client/server side scripts. But, I am, nonetheless, wondering whether this would be possible and how (preferably without installing any other applications).
Is there any way IE can be closed programmatically?
Sure. Find the right IE instance in the SHELL.WINDOWS collection, then QUIT that instance. Or find the right process in Win32_Process, then TERMINATE that process. Or probably dozens of other ways.
None of which will necessarily help, unless you provide a ton more information about what you are actually doing! But that's the consequence of asking "Can I do 'X'?", instead of: "I need to achieve result 'Y', what is the best way to do that?"
You've told us 'X', but not 'Y'.
JavaScript cannot close windows that were not opened via JavaScript.
If websites could close people's browsers, a lot of people would be angry. Your non-malicious intent is unknown to the browser.
Related
This question already has answers here:
How to detect if browser console / inspector is *open*?
(3 answers)
Closed 3 years ago.
I've been searching high and low but all I could find are ways to detect chrome Dev Tools and FireBUG Dev Tools. Is there a way to detect, on Firefox, that the Inspect Element/console/Dev Tool is open?
It is impossible to actually hide your client side source code without actually removing said code from being accessed client side. The simple reason for this is the fact that the code has to be downloaded to the client for it to be used. Once downloaded, it's visible to the user. No exceptions. You can do things like 'security through obscurity', but that too is not going to prevent people from downloading/viewing the source. It's just going to make the code harder to read.
If you want to prevent users from seeing your code, you're basically forced to handle the parts of the code you wish to hide server side. This way, only the input and output are visible to users, while hiding the logic that processes it.
There are some other tricks you could potentially do to make it harder to acces your code (not impossible by a long shot), but I wouldn't recommend those either. Those are usually reliant on browser security settings, easily prevented through broswer add-ons, etc.
If instead you want to prevent users from seeing your code, because you're handling security sensitive operations client side, I suggest you go back to web development 101 and check why that's an inherently bad idea.
EDIT: To purely detect if DevTools is open, you can use this: https://github.com/sindresorhus/devtools-detect and simply follow the readme.
Is it possible to launch new IE process each time when we open new window through Javascript?
Its not possible to do from a in-browser JS, without installing additional stuff on the clients machine!
I mean, for real. Do you really want a website to be able to control the process management of your browser? Think about the performance and security risks! Believe me, you really don't want this!
If you are just in-browser JS, you are just a website. If one website could do this, every website could do this! So its not possible, and thats for a reason!
It would be interesting why u actually wanna do that! I general it's a bad idea to hack around default process management of a application, written by people who know more then you. (like the IE)
If you really wanna do that, and you can run code on another way on the clients, for example by installing software, you some possibilities.
For example, you could use a IE addin, call that addin from JS and let this adding open a new IE process with the new website.
Or you create run a local deamon service, who is opening a HTTP listener on a certain port on localhost. Then every website can call that deamon via AJAX and let it open a new IE with a specific website. Be careful with that! Make sure that only a new IE can be opened, and share a secret key between your website and that deamon, so that only websites who know that secret key can open a new Process!
In every way, remind that its very easy to make mistakes on the implementation who can leak massive security issues! Always think twice about what you make, and be prepared to fix a bug immediately.
We have a new client at work that wants our call center to fill out applications on their website. We have all the data for the people calling into the call center and my boss wants me to make their application prepopulate with the name and other info from our database. Problem is their programmer is "under water" and at this time is not able or willing to change their form to help me out in any way.
I know plain old Javasccript can't do it (Same origin policy)..
But I have considered forcing everyone to use FireFox and writing a greasemonkey script.
I have also considered attempting to use PHP's cURL, but I'm not even sure that would work..
Both of those are really dirty solutions though.
Does any one have any creative solutions? I've been looking at this too long and could really use some outside input.
Thanks for looking
EDIT..
I should specify that we would be loading their application in a frame/iframe
Write a script in JavaScript and then run it in Chrome with web security disabled:
http://davfxx.wordpress.com/2012/08/22/how-to-disable-same-origin-policy-security-on-chrome/
You'll have to start Chrome from a terminal, but this can easily be explained in a brief set of instructions. In my experience, it is much easier to disable the same-origin policy on Chrome than on other browsers.
Is there any possibility to set the Internet Explorer settings by running Javascript file..?
I want to set the following settings in IE through javascript/Jquery
Go to, ‘Tools’ -> ’Internet options’.
Under ‘General’ tab, click the ‘Settings’ button in the ‘Browsing History’ section.
Choose the radio button "Every time I visit the webpage".
Click ‘OK’ and restart the IE.
This is not possible - it'd be a bit of a security hole if sites were able to do this...
Firstly, the short answer is no: You can't do what you're asking for.
Javascript within the browser is heavily restricted to only being able to access resources for the actual page being viewed. This is an important security feature.
You cannot access other pages or other tabs. You cannot access parts of the browser UI outside of the page itself. You cannot run external programs.
Even if you could, the way you've described it wouldn't work anyway: The settings page you've described is specific to one particular version of IE. So your hypothetical program wouldn't work in any other browser or even any other version of IE.
However, more importantly, you need to ask yourself why you're asking for this.
The thing is that you're trying to solve a problem with your site. You've found something that resolves it, and you've asked a question about how to automate that. But you need to work backward a bit -- stop trying to work out how to automate this particular solution: you need to ask yourself whether there might be a different way of solving the original problem, which could be automated.
The fact is this: the config setting you're trying to change is for handling how the browser deals with caching of files. There are ways of changing the behaviour of caching that can be scripted by your site. You might want to look at questions like this one for example.
The lesson here is this: Don't simply ask how to do something; explain why you're trying to do it as well. There might be an alternative solution that's better than the one you've thought of.
No, it's not possible to do using JavaScript.
This is not what Javascript designed to do. There is only a way to read browser setting from JS - using signed scripts.
Firstly, is it possible to access Firefox add-ons/extensions from JavaScript? If so, how to execute Multifox commands from JavaScript?
I'm trying to isolate sessions in Firefox so that more than one user can login to a website simultaneously. I found multifox as a solution but I don't know how to launch page with multifox support. Let me know if better option is available.