This website is using a scripted window error in ie - javascript

Internet Explorer stops the scripts to run.
How to allow javascript codes to run without showing this "This website is using a scripted window" in internet explorer?
Help me in advance.

Are you trying to use prompt()? If so, there's a setting in Internet Options to allow pages to use scripted windows to prompt for information.
You should't rely on prompt() anyway, really. Use a form.

You need to change your security settings in IE to allow JavaScript to run. The message is designed to warn users that JavaScript is being used. You can't disable this programmatically, since that would negate the whole purpose of the warning.

Related

Browser extensions cause errors on website

Extensions installed on Chrome and IE sometimes cause errors on my website. I want that extensions do not affect my website, can I block them with JavaScript? And I know it sounds a little bit stupid :) Anyway any suggestions are welcome
You cannot block extensions using javascript but you may check if the user has a certain extension installed and displaying a warning or error regarding the extension like "uploads won't work when XY is enabled"
How to do this has already been discussed on SO
Check whether user has a Chrome extension installed
How to detect if an Internet Explorer plugin is already installed using JavaScript
No, there isn't any way to block extensions from a webpage.

firefox disable/enable add-on in a specific page

I'm programming a system to work with in firefox, based on high end javascript.
The users sometimes uses add-ons that conflict with the system.
Is there a way i can control from my web-site to disable or enable specific firefox add-ons in a page?
Thanks.
You can do it inside an add-on, prior to Firefox 4 there was the nsIExtensionManager interface, starting with Firefox 4 there is the AddonManager object
I would say no, I wouldn't want sites I browse doing anything to my browser add-ons unless I said they could.
With things like Firebug you CAN detect them though and warn the user, then it's down to them to turn them off and not you.
And here's another thought...imagine me turning off your Adblock because my site doesn't work well with it ;)

Is there a way using jQuery or Javascript to force a page to open in Firefox?

Is there a way using jQuery or Javascript to force a page to open in Firefox? For example, if the user has their default browser set to internet explorer, but they have firefox on their computer - open a new firefox window with the intended page. If so, I would need to check to see if they have firefox on their machine; otherwise, redirect to the mozilla firefox download site...
any suggestions?
The answer, simply, is no. They don't have file system access like that for security reasons. You can probably imagine what would happen if, say you wrote a program that could crack open QuickBooks and take a look around. If you're worried about compatibility, you can use JavaScript checks to notify them that your page needs to be viewed with Firefox and refuse continuation until they get that settled.
http://www.quirksmode.org/js/detect.html
Or, you know, do it the old fashioned way and build a web page that is cross-browser compatible.
Alternatively, ActiveX might be able to do it, but the user has to accept permissions, and this is highly shady activity.
No. Web browsers do not provide information on other applications installed on a system. It would have security ramifications, such as presenting a fake McAfee antivirus dialog to folks who had McAfee antivirus installed.

Javascript to open multiple tabs in single browser

Does anyone know how to open multiple URL's in a single browser.
Instead of opening multiple windows, I want the urls to open in tabs in IE.
I am trying to approach this using JavaScript.
This strictly is a user preference in the browser and never try to override that.
For actual browser tabs, the only thing you can do is add the target="_blank" attribute to links. This may open tabs, but it may open windows instead. It's a user preference, like phoenix said. (By the way, Firefox, Chrome and Opera all opens "blank" targets in tabs by default.)
The other solution is to use Javascript tabs within the page itself. If you use jQuery, there are some plugins mentioned on this article I just read. Otherwise, do a bit of Googling for pure JS solutions.
What about if it's Internet Explorer only?
Also, Greg's original question was about JavaScript but would it be possible to make a simple ActiveX/.NET object that could do this and you could call from JavaScript and pass URL as a parameter?
You can say "never try to override that" but if the user is in a closed environment in which the browser us under control of the administrator, then the user has no choice. Browsers are used for much more than the web. A browser on a corporate site does not belong to the user, it belongs to the corporation.

Finding the currently logged in user from a Firefox extension

I'm writing a Firefox extension that needs to know what the username of the currently logged in user is in Windows, Mac, or Linux. So if I'm logged into my machine as "brh", it'll return "brh". Any idea how to do that from extension JavaScript?
Firefox extensions play by different rules to normal JavaScript running in the page: finding the current user is absolutely possible.
Open your Error Console (in Tools) and enter this:
Components.classes["#mozilla.org/process/environment;1"].getService(Components.interfaces.nsIEnvironment).get('USER')
The environment variables Firefox was started with are available through that NsIEnvironment XPCOM component.
You may have to customise this per platform. If all else fails, you might be able to create an NsIFile in ~ then look at its .path; I'm not sure if shell expressions are honoured there, though...
The flagged correct answer works fine. I use this in our extension on Firefox 38. I also use events so that the page can communicate with the extension and retrieve windows properties from the extension.
getWindowsProperty: function(prop){
return Components.classes["#mozilla.org/process/environment;1"].getService(Components.interfaces.nsIEnvironment).get(prop);
},
Don't think that's possible, seems like it would be a security hole if it were.
Yea, not possible... Javascript runs in a secure enviroment, and all FF extensions are javascript so you wont be able to be doing much interaction with the OS... but ill stick around to see if someone knows a way(it would be VERY cool...)

Categories

Resources