Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Disable JavaScript

Posted on 2001-06-09
4
Medium Priority
?
2,396 Views
Last Modified: 2007-12-19
How can i disable Internet Explorers (4.0/5.0) JavaScript using C++ ?

Does anyone know the registry entrys which i need to change ?
0
Comment
Question by:brain3000
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 5

Expert Comment

by:djbusychild
ID: 6171753
well, do you mean disable javascript for your own app that uses the webbrowser control ? do you just mean disable javascript on IE itself? You can just do that through Tools->Internet Options->Security->Custom Level->Disable Active Scripting
0
 

Author Comment

by:brain3000
ID: 6171769
i like to disable javascrip on ie. and ill do this automatically using cpp code. is there any way other than simulating a keystroke sequence for disabling js ?
0
 
LVL 49

Accepted Solution

by:
DanRollins earned 600 total points
ID: 6175071
I found that I can enable and disable via the reg key:

HKCU\Software\Microsoft\Windows\CurrentVersion\
Internet Settings\Zones\3\1400

and setting DWORD value to 0=enable and 3= disable.

I'm not 100% sure how general this is (it seems to work OK on Win98, but NT or 2K is still a question).  And it has a distinct flaw that it seems to only affect the next *new* IE that you open.

Here is EnabScript.JS (JavaScript) file I keep on my desktop for double click access:

oShell= new ActiveXObject("WScript.Shell")
var DISABLE= 3, ENABLE= 0;
var nRet= oShell.Popup(
  "Do you want Scripting?\n"
  +"Yes to Enable, No to Disable",  0,
  "Enable/Disable IE5 Scripting", 35
);
if (nRet==2) WScript.Application.Quit();  // 2= cancel
if (nRet==6) nNewVal= ENABLE;  // 6 is YES
if (nRet==7) nNewVal= DISABLE; // 7 is  NO

sName=
"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\"
+"Internet Settings\\Zones\\3\\1400"

oShell.RegWrite(sName, nNewVal,"REG_DWORD" );

WScript.Application.Quit();  

-- Dan
0
 

Author Comment

by:brain3000
ID: 6177873
thanks for this answer. i tried on my win2k system and it works fine :)
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question