Javascript allows you to add trusted sites, modify activex security settings, disable pop-up blocking programs, and disable jsactivex.

Source: Internet
Author: User

Javascript allows you to add trusted sites, modify activex security settings, disable pop-up blocking programs, and disable jsactivex.

To add a website to a trusted site, you do not need to be prompted in the pop-up window by using system controls. You can achieve this through the following method:

First, understand the values and meanings that can be set.

Registry Key Directory of a trusted site

HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ ZoneMap \ Ranges \ Range [*]

ActiveX Control Registry Key Directory

HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ Zones \ [0-4] \ [*]

Description:

ActiveX Control Setting Value Meaning: 3 is disabled, 0 is enabled, 1 is prompt

Definition of the Directory [0-4] in the Registry key

Value Set
0 My computer
1 Local Intranet Region
2 Trusted site REGION
3 Internet region
4 Restricted Site Area

Meaning of [*] in registry key

Value Set
1001 Download the signed ActiveX Control
1004 Download unsigned ActiveX Controls
1200 Run ActiveX controls and plug-ins
1201 Initialize ActiveX controls that are not marked as secure and run scripts
1405 Execute scripts on ActiveX controls marked as secure scripts
2201 ActiveX Control prompt **

The Registry Key of the blocked program appears.

HKEY_CURRENT_USERHKCU \ Software \ Microsoft \ Internet Explorer \ New Windows \ PopupMgr

The specific script is as follows:

<Script language = "JavaScript"> <! -- Var WshShell = new ActiveXObject ("WScript. shell "); // Add a trusted site or IP address WshShell. regWrite ("HKCU \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ ZoneMap \ Ranges \ Range100 \", ""); WshShell. regWrite ("HKCU \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ ZoneMap \ Ranges \ Range100 \ http", "2 ", "REG_DWORD"); WshShell. regWrite ("HKCU \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ ZoneMap \ Ranges \ Range100 \: Range", "www.jb51.net "); wshShell. regWrite ("HKCU \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ ZoneMap \ Ranges \ Range101 \", ""); WshShell. regWrite ("HKCU \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ ZoneMap \ Ranges \ Range101 \ http", "2 ", "REG_DWORD"); WshShell. regWrite ("HKCU \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ ZoneMap \ Ranges \ Range101 \: Range", "www.example.com "); // modify the Security Settings of IE ActiveX WshShell. regWrite ("HKCU \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ Zones \ 3 \ 1001", "0", "REG_DWORD "); wshShell. regWrite ("HKCU \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ Zones \ 3 \ 1004", "0", "REG_DWORD "); wshShell. regWrite ("HKCU \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ Zones \ 3 \ 1200", "0", "REG_DWORD "); wshShell. regWrite ("HKCU \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ Zones \ 3 \ 1201", "0", "REG_DWORD "); wshShell. regWrite ("HKCU \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ Zones \ 3 \ 1405", "0", "REG_DWORD "); wshShell. regWrite ("HKCU \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ Zones \ 3 \ 2201", "0", "REG_DWORD "); // disable the WshShell blocking program in the pop-up window. regWrite ("HKCU \ Software \ Microsoft \ Internet Explorer \ New Windows \ PopupMgr", "no"); alert ("trusted site settings, ActiveX control security settings, the pop-up window is successfully set. "); // --> </SCRIPT>

For example, you can add www.jb51.net to your trusted website.

1. Open the Registry (Run regedit), first open the following directories in sequence

HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ ZoneMap \ Domains

2. Create an item in the directory: "jb51.net"

3. Create another item under jb51.net: "www"

4. A two-byte sub-key with the new key at www: "*" (indicating any protocol, or setting it to a single protocol such as "http" or "ftp)

5. Double-click the newly created double-byte sub-key "*", make sure that the base is in hexadecimal format, and enter "2 (indicating a trusted site)" in the numeric data type )"

6. Disable Registry

<Script language = "JavaScript"> <! -- Var WshShell = new ActiveXObject ("WScript. shell "); WshShell. regWrite ("HKCU \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ ZoneMap \ Domains \ jb51.net", ""); WshShell. regWrite ("HKCU \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ ZoneMap \ Domains \ jb51.net \ www", ""); WshShell. regWrite ("HKCU \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ ZoneMap \ Domains \ jb51.net \ www \ http ", "2", "REG_DWORD"); alert ("jb51.net is successfully written to a trusted site"); // --> </SCRIPT>

The above js implementation adds a trusted site, modifies activex Security Settings, and disables the pop-up blocking program, which is all the content that xiaobian shares with you. I hope to give you a reference, we also hope that you can support the customer's home.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.