#StackBounty: #windows #google-chrome #browser Text indentation via Tab-key in the Windows Google Chrome browser without using extensio…

Bounty: 50

When trying to indent a block of text in an input textfield, for instance to emphasize Markdown code-blocks, the Tab key is already bound to a different action (switching to the next input element).

What is a straightforward way to overcome this issue without using extensions?

I found these two threads, but unfortunately don’t have a Numpad, and the answers presume installed extensions or applications:

How to use Tab key to indent within a textfield (instead of jumping to next element)?

Typing the tab character in browser text boxes

Without having a Numpad, one can use the following key-combination on Linux POSIX Systems:

Control+Shift+U9

I am looking for something similar on Windows.


Get this bounty!!!

#StackBounty: #networking #browser #dns #xmlhttprequest Stale host addresses in Chrome

Bounty: 50

I’m tracking down a problem with our web application whereby a CNAME record swap of our site’s domain is not picked up by Chrome for a long time, far exceeding the 300 second TTL of the DNS record. The remote address reported in Chrome inspector network tab for all XHR requests to our server is stale.

If I copy the XHR requests as curl and run it in the terminal then I can confirm it uses the IP addresses of the newly swapped-to domain, as expected. nslookup also reports the same addresses, so my local DNS cache appears to be fine.

In Chrome’s netlog viewer (catapult) I can see our website’s domain has an expired entry in the DNS cache with a TTL set to 10 seconds. I can also see requests made well after the entry expired, so it seems like Chrome isn’t even checking the cache at all!

Curiously, when I flush the idle sockets on chrome://net-internals/#sockets then the host resolver does trigger as part of the SSL handshake and the new IP address is picked up.

My feeling is this is our web application is doing something to cause this weird behaviour. I’ve checked another one of our sites but cannot reproduce the problem. I thought we might be hanging on to a connection somewhere, but we’re not using websockets and I can’t see any other hanging network requests.

Any help greatly appreciated!


Get this bounty!!!

How to make a dropdown as readonly in html

I encountered a problem where in it was required to make a drop down readonly.

While searching over internet i found THIS
But the solution mentioned there, didn’t appeal me much. As i had to make server side code changes while saving the value using the hidden field.

How do we do this? The common thought is to disable the drop down menu. Well, yes, but there’s a choice

When you use disabled, it prevents the user from using the drop down, or form element. You can see the year, but it is grayed out. Your mouse can’t select or change it, and you can’t tab to it with the keyboard. Disabled is used a lot with checkboxes. Sounds like just what we want, but you unknowingly might have caused yourself a small development problem.

The problem is “disabled” does just that. Disabled means that in your $_POST or $_GET that element will not show up in your controller. If you want to use the year in your controller, you won’t be able to recover it from that form. All you can do it look at the value on the web page.

What if we want to read the year, prevent the user from changing the year, and recover the year in the form data sent back to the controller. The solution for this is

Make a replica of your dropdown with a different name and different id.

Hide your original drop down with
This makes the element available in the form, so it will flow to the server side as well.
At the same time, it will give a look and feel of disabled to the user.

Example :



            
                  
            




            
      

How to make my browser trust my server certificate?

Hi Guys,

I was exploring the SSL thing, and wanted to know what are the steps involved in making my browser trust the server certificate that server is sending.

First of all you need to generate a keystore (This needs to be done on server side).

C:localhostCerts>keytool -genkey -alias server-alias -keyalg RSA -keypass welcome -storepass welcome -keystore localhost.jks
What is your first and last name?
[Unknown]: localhost
What is the name of your organizational unit?
[Unknown]: NSEL
What is the name of your organization?
[Unknown]: NSEL
What is the name of your City or Locality?
[Unknown]: NOIDA
What is the name of your State or Province?
[Unknown]: UP
What is the two-letter country code for this unit?
[Unknown]: IN
Is CN=localhost, OU=NSEL, O=NSEL, L=NOIDA, ST=UP, C=IN correct?
[no]: yes


C:localhostCerts>dir
Volume in drive C has no label.
Volume Serial Number is CE67-DC0D

Directory of C:localhostCerts

15-Apr-2012 01:10 PM .
15-Apr-2012 01:10 PM ..
15-Apr-2012 01:10 PM 1,338 localhost.jks
1 File(s) 1,338 bytes
2 Dir(s) 343,529,140,224 bytes free

The above command has generated a keystore (on the server side)

Now convert this into a server certificate (and send it to client side)

C:localhostCerts>keytool -export -alias server-alias -storepass welcome -file server.cer -keystore localhost.jks
Certificate stored in file

C:localhostCerts>dir
Volume in drive C has no label.
Volume Serial Number is CE67-DC0D

Directory of C:localhostCerts

15-Apr-2012 01:11 PM .
15-Apr-2012 01:11 PM ..
15-Apr-2012 01:10 PM 1,338 localhost.jks
15-Apr-2012 01:11 PM 563 server.cer
2 File(s) 1,901 bytes
2 Dir(s) 343,560,626,176 bytes free

Make the changes in server.xml

Make changes as given on http://javakafunda.blogspot.in/2012/04/how-to-configure-tomcat-to-support-ssl.html in step 2.
(Take care of the file name)

Saved the server.xml on server and restart Tomcat, access to https://localhost:8443/

You’ll see a page as given below

As you see the google chrome doesn’t trusts the certificate that was provided by the server.

Check untrusted certificate on client side

If you open server.cer (provided by the server) by double clicking, you can see the message as given below

This CA Root certificate is not trusted. To enable trust, install this certificate in the Trusted Root Certification Authorities Store

How to add this certificate to Trusted Root Certification Authorities on Google Chrome??

  1. Tools -> Settings
  2. Click on Show advanced settings at the bottom of the page
  3. Click on Manage Certificates
  4. Click on Trusted Root Certification Authorities tab
  5. Click on import
  6. Select server.cer from your machine
  7. Next, Next, and Finish
  8. You should get a import successful message

Again open the server.cer, and now you should see the certificate as follows.

if you open https://localhost:8443/ in IE or google chrome you will NOT see the warning and in the address bar, you’ll notice the lock.