Browser extensions cause errors on website - javascript

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.

Related

Website works in incognito and doesn't work in standart chrome's mode. How to fix

There is a situation when some Website is working in Chrome's Incognito mode and work with bugs on doesn't work at all in standard mode. Sometimes the reason for this problem is in installed chrome extensions (Javascript effect works in "Incognito mode" only (Chrome))
And in another place (note: link no longer works and is not archived on the wayback machine) it was told:
One of the elements had an id of "adcontent", which I am guessing is black-listed by either Chrome or one of the plugins.
So my question: Is there a list of bad Id's/classes/js functions etc. that can cause problems with chrome's extensions? Or maybe a list of rules to prevent this problem.
Update 1: I don't have URL of the website with this problem. I just came across this situation while was reading something else and decided to ask if there are some common rules for that.

How to check if Javascript is activated from Firefox extension?

I haven't found any info on that. I basically need to know from a Firefox extension if the browser has javascript enabled. Is that possible?
I am totally new to programming FF extensions -- actually this is my first one and among the requirements is this one I haven't been able to figure out.
Via #ChristianSonne: You could try
require("preferences-service").get("javascript.enabled")
in Jetpack-style addons.

This website is using a scripted window error in ie

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.

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 ;)

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