Automatically disable JavaScript on Web Browser - browser

I need a way to "disable JavaScript" / "not run JavaScript" in the web browser.
Is it possible to do it using JavaScript or some other automatic way?
Update: reason for this? Easy, there are some "online TV sites" where they use several iframes pointing to "cross site urls" and it is annoying to get several "advertising" pop ups all the time. By coding my own webbrowser "add-on/extension" I've tried to "delete" html nodes and some Javascript and it works for the "main page" code, not for iframe "Cross Domain URL".... so I think disabling javascript AFTER the movie starts, would be a nice solution.
Update 2:
The video I want is a result of a iframe cascade chain.... I've tried all the way to "catch" the final "url" result using fiddler and other tools, but its getting hard since this different "cross domain" communication is sharing "runtime keys" to avoid what I want to accomplish (perhaps with more time I can do it) but this is why I thought that an easy and fast solution would be just disable javascript after the movie starts.
NOTE: other extensions such as Adblock and similars DO NOT work, since the website detect it and the video never loads.

No, it is not possible to programmatically disable the JavaScript on a user's browser using another JavaScript add-on/extension.
However, it may be possible if you use PHP as a proxy to intercept the pages you want, and strip out all script tags. You might even be able to extract the video URL you want and play it using another (flash?) player.
If you are a system administrator and want to disable JavaScript on all your network's computers, please post on SuperUser instead.

You can't disable, but you can overwrite the javascript functions.
alert = function(){}
alert("hello")
You can even kill those iframes by tag name.

Related

Way to launch a browser w/ specific webpage without using ShellExecute? (Visual C++)

I want to add a button to my visual C++ form that will open with a specific browser. So far for links I've been using:
System::Diagnostics::Process::Start("UrlHere")
Which, as standard, opens with whatever your default browser is.
I'm wondering what the process would be to force the URL to open with a specific browser and if it's possible without the use of ShellExecute?
Edit - You are correct, this is C++/CLI. Removed the C++ Tag.
Edit Edit - Apologies if it came across as misleading. Some slight elaboration;
The buttons will launch to application URL's, some of which can only be used in Internet Explorer, others that CAN (and should) be used in Chrome. This is why I need to avoid using the default browser and have different buttons using different browsers when launching URLs
Before answering the 'how', I'd like to ask the question "should you be implementing this?"
By not launching the user's default browser, you are subverting the user's decision.
Perhaps the user prefers a particular interface, and is willing to live with the incorrect renderings that come with it.
Perhaps the user has a browser addon that they really need, such as a screen reader for the blind.
You are requiring additional software installed that the user may or may not want.
Perhaps the user doesn't want Chrome. Perhaps the user prefers FireFox.
You are saying that you know which browser is best, now and forever.
What if the next version of IE makes it work with the sites that are currently Chrome-only? What if the next version of Chrome fixes the sites that are currently IE-only?
What if the site changes so that it works in more browsers?
Do you go back and release a new version of your software that changes the browser for particular sites?
You're trying to solve a problem that may already be fixed.
Both Chrome and Firefox support a addon that will render a tab using the IE engine. It can be set to automatically activate when certain URLs are seen.
Perhaps there is a browser that already works with all your sites, that you don't know about.
Therefore, my recommendation is no, do not do this. The user has decided which browser they want to use, respect that decision and use the default browser.
That said, here's how you would do it: You could use the CreateProcess method, but you're in managed-land, so you might as well use it. Use the Process class to launch the new process for you.
Process^ browserProcess = gcnew Process();
browserProcess->StartInfo->UseShellExecute = false;
browserProcess->StartInfo->FileName = "C:\\Program Files (x86)\\Internet Explorer\\iexplore.exe";
browserProcess->StartInfo->Arguments = "http://www.google.com";
browserProcess->Start();

Why I cannot use two or more "browser_action", "page_action" or "app" together?

Is there any good reason why I can't use two of them together?
browser_action
page_action
app
I can't think why single extension can't use browser and page specific actions together. Why should I have to write single extension for each action ...
For a browser that boasts about its simplicity I believe that is the clearest explanation. To prevent clutter.
Packaged Apps is the easiest to explain as they are basically an alternative to Hosted Apps for developers that don't wish to host a service or wish to make their app fully integrated in to Chrome and/or work offline. However, since packaged apps are bundled as extensions this prevents them from adding anything to the browser's chrome since hosted apps don't have this ability.
Regarding the action choice, I can only imagine this restriction is to help prevent extensions from overcrowding the address bar and the toolbar with duplication.
In a lot of cases using badges and the onClicked event correctly can replicate a lot of the functionality of page actions in browser actions while using a combination of content scripts and message passing to trigger changes.
The StumbleUpon extension rotates its browser action's behavior depending on whether or not its toolbar is currently displaying.

How can I programmatically control a browser such as chrome in linux and execute javascript per each tab?

I have been given a task of toggling nearly 200 users' permissions in an admin. I have access to the database, and I'm sure I can do this in SQL but I'm curious to find out how to do it this way as well, plus I suspect it will be less work because I don't have to study the SQL that's going on and I know exactly what to do after I get access to the browser instance and know how to execute javascript programmatically in the context of the web page open.
I basically want to provide a list of urls which will open ( 195 ) and then execute javascript to toggle checkboxes, then submit the form.
As I stated, I want to use firefox or chrome and I'm on linux.
This is basically what greasemonkey does.
Or, if you can do it all while staying on the same page, you can also just type in arbitrary JS code by hand in the firebug console or its Chrome equivalent. This could work if combined with some iframe trickery.
If you use Chrome, it has built in support for user automation scripts: http://userscripts.wikidot.com/, http://www.chromium.org/developers/design-documents/user-scripts
I think a cleaner solution would be for you to figure out what is the url and the parameters to pass to do what you need. Then you can just use curl to make those requests.
I use CJS Chrome extension. I add a short script take loads a script from my localhost server and executes it. The executed script can also send results back to the server.

Is it possible to use a script to block adware recursive links in a browser window?

There are client-side solutions for nasty adware and their recursive links, but is it possible to use a script in the html to prevent the links from displaying in a user's browser who has adware on their machine and is visiting my web site?
I am NOT a programmer. I am designer, and I know just enough to create problems that send me to forums like this.
I doubt it. Malware like that injects links and creates popups by manipulating the internals of the browser.

Always using google chrome frame meta tag for standard compliant page, is good idea?

I was thinking to add meta tag always in all the websites.
That will trigger google chorme frame to load for users who already installed. I can see the benefits but is there any concerns or facts that I should know before I do that?
Testing in google chrome is enough or testing in google chrome frame explicitly required?
Thanks
Note: please do not mention current know problems "print" and "download" issue. I'm sure those will get fixed soon :)
The only argument against chrome frame that I have seen so far is Microsoft's - "Google Chrome Frame running as a plugin has doubled the attach area for malware and malicious scripts."
Also, you may run into problems with frames. If you have chrome frame on your page and someone has that page iframed on their site you may run into some problems. More info:
http://groups.google.com/group/google-chrome-frame/browse_thread/thread/d5ffe442658bc60e/e6d7a4c1c179c931?lnk=gst&q=iframe
You should only need to test in Chrome Frame for (X)HTML, CSS, and JavaScript...basic stuff. If you are using AJAX (while trying not to break the back button), worried about caching, cookies (accessed via javascript), or other potentially browser-specific browser interactions I suggest testing on the IE+CF platform...at least until the CF team announces 100% interoperability between CF and IE.
Check out the CF Google group for more issues.
Are there any concerns or facts you should know? Yes: Not everyone has Google Chrome Frame installed.
You are adding a new user agent that you will need to test and debug against, without removing the need to test and debug the user experience for other browsers (notably plain IE by itself).
If you don't make the IE user experience equivalent to the Google Chrome experience, then you are alienating a significant percentage of users. Depending on your website and its expected users, the impact of this may range from undesirable to unacceptable. If you do make the user experience equivalent, then there is no point in adding the meta tag.

Resources