Set the address in the Google search result link to the original address directly.

Source: Internet
Author: User
javascript:(function (){var ol = document.getElementById('rso');var len = ol.childNodes.length;for(var i=0;i<5;i++){var li = ol.childNodes[i];if(li.nodeName!='LI') continue;var div = li.childNodes[0];var h3 = div.childNodes[4];var a = h3.childNodes[0];a.onmousedown = null;}})();
Google's search is fast, if the connection is not reset. however, when you click search results, Google needs to First connect to its own website and then go to the real page. This process greatly reduces the speed of opening, and even makes it impossible to open. this code is used to set the link as a real Web Page Link without connecting to the Google server. usage: You can use the code as a browser's bookmarks. The usage of the bookmarks has not been set. You can set the address to the code starting with "javascript. every time you use the https://google.com.hk to search, click the bookmarks button, the complex address in the link is set to a simple original address. the principle is very simple, but it is highly coupled with Google's search page (a bit hard-coded). If Google updates the page, this Code may also need to be upgraded.
javascript:function view(node){ for(var i=0;i<node.childNodes.length;i++){ var cn = node.childNodes[i]; if(cn.childNodes.length>0) view(cn); if(cn.nodeName=='A'){ var href = cn.href; var pref = 'http://www.google.com.hk'; var index = pref.length; if(href.indexOf(pref)==0){ href = 'https://www.google.com.hk'+href.substr(index); } cn.onmousedown = null; } } } (function(){ var ol = document.getElementById('rso'); view(ol); })();

This is the second version of the update, Google search results in the format of a subtle difference, hard encoding compatibility is very poor, now changed to automatic retrieval of each link, if you start with the http://google.com.hk, automatically replaced with the https://google.com.hk, encrypted transmission speed is also fast. there is no issue that cannot be opened. now it is the third edition. js code is loaded to the browser as a plug-in. In this way, everything is automatic and manual buttons are not required. manual conversion is often unsuccessful if the page is being loaded. the plug-in runs automatically after the page is loaded. installation Method: I only use it in the Chrome browser, and other browsers can also load it. The specific method is researched by myself, and each browser is different. 1. save the JS Code as Google. user. JS. The preceding name is required. user. js.2. in chrome, click Settings, click "Extended Program" on the left, click "Developer mode", and drag and drop the saved file. A window will pop up for more information. Q: Click OK. Disable "Developer mode. (This installation method is alternative, but it is indeed very simple ). 3. this program is only valid for the https://www.google.com.hk link, but the browser default search may be http:/www.google.com.hk (that is, non-encrypted transmission ). therefore, you need to set the default search engine. Similarly, open the settings and click "manage search engines" to pull down to the bottom to create a new search engine entry or use a unused entry, modify the third content. google's default search engine is like this: {Google: baseurl} search? {Google: rlz} {Google: acceptedsuggestion} {Google: originalqueryforsuggestion} {Google: searchfieldtrialparameter} sourceid = chrome & Ie = {inputencoding} & Q = % s is complex,
This is not encrypted, the beginning of the {Google: baseurl} into the https://www.google.com.hk/, is the following: https://www.google.com.hk/search? {Google: rlz} {Google: acceptedsuggestion} {Google: originalqueryforsuggestion} {Google: searchfieldtrialparameter} sourceid = chrome & Ie = {inputencoding} & Q = % s,
Set as default search engine. Complete. js code:

function view(node){for(var i=0;i<node.childNodes.length;i++){var cn = node.childNodes[i];if(cn.childNodes.length>0) view(cn);if(cn.nodeName=='A'){var href = cn.href;var pref = 'http://www.google.com.hk';var index = pref.length;if (href.indexOf(pref) == 0) {href = 'https://www.google.com.hk'+href.substr(index);cn.href = href;            }cn.onmousedown = null;}}}(function() {    if (document.URL.indexOf("https://www.google.com.hk") != 0) return;    var ol = document.body; //getElementById('rso');    view(ol);})();

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.