Tech Sharing Blog

Computer knowledge, news, product, SEO, earn money online sharing place

Advertisement

Archive for the ‘ Internet Explorer ’ Category

Just come across with my company SQA team where they request us to do the disable right click features on our front end web site. The initial javascript which exists in our script only work with Microsoft Internet Explorer but not Firefox.

So Google around and found the following javascript which working for both the browser (Firefox and Internet Explorer are the major browser use by our visitor)

Just include this script in our top of the page which you wish to disable the right click function.

<script type="text/javascript">

function md(e)
{
  try { if (event.button==2||event.button==3) return false; }
  catch (e) { if (e.which == 3) return false; }
}
document.oncontextmenu = function() { return false; }
document.ondragstart   = function() { return false; }
document.onmousedown   = md;

</script>

Popularity: 1% [?]

Last whole week working with a project which involve the integration with 3th party API through the HTTPS secure channel using coldfusion CFHTTP. I come across with the following error message:


I/O Exception: peer not authenticated

coldfusioncerterror Import the server or CA certification in coldfusion server


Try to Google it for some time and find out that I need to import the 3th party certificate into my Coldfusion server by using some keytool certificate import tools. Trying few times but still can’t get it work until I found a blog which showing a very effective way and free tools for import the certificate.


These instructions are for Windows based machines but the concepts and tools should work on Mac or Unix based platforms.


1. Install tools

Download and install Portecle JVM certificate manager

(portecle-1.5.zip) You do not need the source (src) version

https://sourceforge.net/projects/portecle

The easiest way to install Portecle is to unzip the contents of the zip file to a directory such as C:\Program Files\portecle-1.5\ Then find the file “Portecle.jar”, right click it and send it to your desktop as a shortcut. You can then use this shortcut to launch Portecle. (optionally you can also change the name of the shortcut and change the icon to use the portecle.ico file for the icon)


2. Extract the certificate

The easy way to get the certificate is ask from the issuer, but if you unable to do so, you may have another alternative solution which you open the https page in your browser and double click on the lock logo at bottom left of the browser (the lock appear just beside the url addrss for Google Chrome)


Double click on the lock –> click the certificate information button –> go to details –> click the copy to file button –> Follow the wizard and select the base-64 encoded X.509 (.cer) format –> save the file


3. Install Certificate to Java Virtual Machine and/or ColdFusion server

Start Portecele.

On the [File] menu, select [Open Keystore File] navigate to and locate the keystore you are interested in.

For many java installations this will be located in your “jre\lib\security” directory and might be named “cacerts”

For the ColdFusion 8 default developer install the path will be “c:\coldfusion8\runtime\jre\lib\security\cacerts”

You will have to enter the password for the keystore. The default password is “changeit”


Now you are ready to import the key.

From the [Tools] menu select [Import Trusted Certificate]

Navigate to and locate the certificate you saved and click [Import]

You will need to reenter the keystore password.

You can change the alias if you desire but I would recommend leaving it as the default

Note: You may also be prompted to “trust” the certificate.


Click on the save button at the top of the portecle


4.       Restart you Java Virtual Machine/coldfusion application server.

For ColdFusion not installed on top of JRun you just need to restart the ColdFusion service. If you are running on top of JRun you also need to restart JRun.


Up to now, you already successfully import your partner certificate to your coldfusion/java server.


Please feel free to leave your suggestion if any. Click here for more information regarding Protecle

Popularity: 2% [?]

Proxy server is a server that sites between a client application, such as a web browser and a real server. It intercepts all requests to the real server to see if it can fulfill the requirests it self. If not, it forwards request to the real server.

There main purposes for using the proxy server are:

  • to keep machines behind it anonymous (mainly for security)
  • to speed up access to a resource (via caching). It is commonly used to cache web page from a web server
  • to censor network services or content
  • to forge transmitted content before delivery, eg: to insert advertisements


There are diff types of proxy server in generals:

  • Transparent Proxy: it identifies itself as a proxy server and also make the original IP address available through the http headers. The generally use to cache websites but do not effectively provide any anonymity to those who use them.
  • Anonymous Proxy: it identifies it self as a proxy server, but does not make the original IP address available. of proxy server is detectable, but provides reasonable anonymity for most users.
  • Distorting Proxy: This type of proxy server identifies itself as a proxy server, but make an incorrect original IP address available through the http headers.
  • High Anonymity Proxy: This type of proxy server does not identify itself as a proxy server and does not make available the original IP address.


You may easily get the free proxy server list from the Internet by Google it with the key word of “Free Proxy server list”. Or you may just access the following web site for the free Proxy server list:


Please bear in mind that when you use the free public proxy server, your transmitted data through the Proxy server may capture or monitor by some body including your login detail and password.

Step to set up the Proxy on difference browser:

Mozilla Firefox:

Tools -> Options -> Advanced -> Network -> Settings -> Manual proxy configuration -> enter the Proxy server IP and Port number

setting proxy for firefox Proxy Server and browser configuration


Google Chrome:
Options -> Under the Hood -> Change proxy settings -> Connections -> LAN Settings -> Proxy Server -> check the “use a proxy….” -> enter the proxy server IP and port number

* Google Chrome is share the same Proxy server setting with Internet Explorer

google chrome set proxy step 1 Proxy Server and browser configuration

google chrome set proxy step 2 Proxy Server and browser configuration

Internet Explorer:
Tools -> Internet Option -> Connections -> LAN Settings -> Proxy Server -> check the “use a proxy….” -> enter the proxy server IP and port number

google chrome set proxy step 2 Proxy Server and browser configuration

Opera:
Tools -> Preferences -> Network -> Proxy Server… -> Select what ever Protocol to use the Proxy Server -> enter the proxy server IP and port number

opera set proxy Proxy Server and browser configuration

Popularity: 2% [?]

Most of the developer who working in MS platform will be used to the javascript window.attachEvent.


But maybe some of you don’t know that window.attachEvent is only working on IE7+ and Opera only. Your coding will hit an javascrpit error when running at IE 6 or any version of firefox.


To resolve this issue, you may need to modify your code as such:

Original Code:

window.attachEvent(“onload”, Page_load);

function Page_load(){
//function code
}


Modify code:

//set page event handlers
if (window.attachEvent) {

//IE and Opera
window.attachEvent(“onload”, Page_load);

} else if (window.addEventListener) {

// IE 6
window.addEventListener(“load”, Page_Unload, false);

} else {

//FireFox
document.addEventListener(“load”, Page_Unload, false);

}

function Page_load(){

//function code

}


Popularity: 1% [?]

SEO Powered by Platinum SEO from Techblissonline