Google SSL zz

// Google SSL
// Modified from SSL Certificates Pro
//z 2011-12-29 8:59 AM is2120@csdn : reader,calendar
// ==UserScript==
// @name????????Google SSL
// @namespace?? http://raychow.info/
// @version???? 2.1.2
// @description 強制 Google 使用安全連接。
//
// @include???? https://www.google.com/
// @include???? https://www.google.com/webhp?*
// @include???? https://www.google.com/search?*

// @include???? https://encrypted.google.com/
// @include???? https://encrypted.google.com/webhp?*
// @include???? https://encrypted.google.com/search?*

// @include???? https://webcache.googleusercontent.com/search?*
//
// @include???? http://www.google.com.hk/search?*
// @include???? http://www.google.com/
// @include???? http://www.google.com/webhp?*
// @include???? http://www.google.com/search?*
//
// @include???? http://www.google.com/accounts*
// @include???? http://www.google.com/bookmarks*
// @include???? http://www.google.com/calendar*
// @include???? http://www.google.com/contacts*
// @include???? http://www.google.com/dictionary*
// @include???? http://www.google.com/finance*
// @include???? http://www.google.com/history*
// @include???? http://www.google.com/notebook*
// @include???? http://www.google.com/preferences*
// @include???? http://www.google.com/profiles*
// @include???? http://www.google.com/reader*
// @include???? http://www.google.com/webmasters/tools*
// @include???? http://www.google.com/voice*
// @include???? http://checkout.google.com*
// @include???? http://gmail.google.com*
// @include???? http://mail.google.com*
// @include???? http://sites.google.com*
// @include???? http://*.googleusercontent.com*
// @include???? http://groups.google.com*
// @include???? http://reader.google.com*
// @include???? http://calendar.google.com*
// ==/UserScript==

// 如果需要指定搜索語言,請修改 defaultLanguage 變量。
// If you need to specify the language of Google Search, please modify the defaultLanguage variable.
// 示例 / Example :
// var defaultLanguage = 'zh-CN';
var?defaultLanguage =?'zh-CN';

function?selectNodes(query)?{
????return?document.evaluate?(
????????query,
????????document,
????????null,
????????XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
????????null);
}

function?addgbar()?{
????var?gog = selectNodes("//div[@id='gog']").snapshotItem(0);
??gog.innerHTML =?'<div id="gbar"><nobr>'?+?
????'<a href="https://encrypted.google.com/search?tab=ww" οnclick="gbar.qs(this)" class="gb1">Web</a> '?+?
????'<a href="http://www.google.com/images??tab=wi" οnclick="gbar.qs(this)" class="gb1">Images</a> '?+?
????'<a href="https://encrypted.google.com/search?tbs=vid:1&amp;tab=wv" οnclick="gbar.qs(this)" class="gb1">Videos</a> '?+?
????'<a href="http://maps.google.com/maps?tab=wl" οnclick="gbar.qs(this)" class="gb1">Maps</a> '?+?
????'<a href="https://encrypted.google.com/search?tbs=nws:1&amp;tab=wn" οnclick="gbar.qs(this)" class="gb1">News</a> '?+?
????'<a href="http://www.google.com/products?tab=wf" οnclick="gbar.qs(this)" class="gb1">Shopping</a> '?+?
????'<a href="https://mail.google.com/mail/?tab=wm" class="gb1">Gmail</a> '?+?
????'<a href="http://www.google.com/intl/en/options/" οnclick="this.blur();gbar.tg(event);return !1" aria-haspopup="true" class="gb3"><u>more</u> <small>▼</small></a>'?+?
????'<div class="gbm" id="gbi">'?+?
????'<a href="http://www.google.com/search?tbs=bks:1&amp;tab=wp" οnclick="gbar.qs(this)" class="gb2">Books</a> '?+?
????'<a href="https://www.google.com/finance?tab=we" οnclick="gbar.qs(this)" class="gb2">Finance</a> '?+?
????'<a href="http://translate.google.com/translate_t?tab=wT" οnclick="gbar.qs(this)" class="gb2">Translate</a> '?+?
????'<a href="http://scholar.google.com/scholar?tab=ws" οnclick="gbar.qs(this)" class="gb2">Scholar</a> '?+?
????'<a href="https://encrypted.google.com/search?tbs=blg:1&amp;tab=wb" οnclick="gbar.qs(this)" class="gb2">Blogs</a> '?+?
????'<div class="gb2"><div class="gbd"></div></div>'?+?
????'<a href="http://www.youtube.com/results?tab=w1" οnclick="gbar.qs(this)" class="gb2">YouTube</a> '?+?
????'<a href="https://www.google.com/calendar/render?tab=wc" class="gb2">Calendar</a> '?+?
????'<a href="http://picasaweb.google.com/lh/view?tab=wq" οnclick="gbar.qs(this)" class="gb2">Photos</a> '?+?
????'<a href="https://docs.google.com/?tab=wo" class="gb2">Documents</a> '?+?
????'<a href="https://www.google.com/reader/view/?tab=wy" class="gb2">Reader</a> '?+?
????'<a href="https://sites.google.com/?tab=w3" class="gb2">Sites</a> '?+?
????'<a href="https://groups.google.com/groups?tab=wg" οnclick="gbar.qs(this)" class="gb2">Groups</a> '?+?
????'<div class="gb2"><div class="gbd"></div></div>'?+?
????'<a href="http://www.google.com/intl/en/options/" class="gb2">even more ?</a> '?+?
????'</div></nobr></div>'?+ gog.innerHTML;
}

var?locationProtocol =?window.location.protocol;
if?(locationProtocol ==?'http:')?{
????if?(window.location.href ==?'http://www.google.com/'?||?window.location.href.indexOf('http://www.google.com/webhp?')?==?0)?{
????????var?sslLinkNode =?document.createElement('a');
????????sslLinkNode.href =?'https://www.google.com/';
????????sslLinkNode.className =?'gb1';
????????sslLinkNode.textContent =?'SSL';
????????var?gbar = selectNodes("//div[@id='gbar']/nobr").snapshotItem(0);
????????gbar.appendChild(document.createTextNode(' '));
????????gbar.appendChild(sslLinkNode);
????}?else?if?(window.location.host ==?'www.google.com.hk')?{
????????var?iframe =?document.createElement('iframe');
????????iframe.id =?'ncr';
????????iframe.src =?'https://www.google.com/ncr';
????????iframe.setAttribute('style',?'display: none');
????????document.body.appendChild(iframe);
????????iframe.addEventListener('load',?function(){
????????????var?searchHref =?'https://encrypted.google.com/search'?+?window.location.search;
????????????if?(defaultLanguage.length >?0)
????????????????if?(searchHref.indexOf('hl=')?<?0)
????????????????????searchHref +=?'&hl='?+ defaultLanguage;
????????????window.location.href = searchHref +?'#sl';
????????},?false);
????}?else?if?(!window.location.href.indexOf('http://www.google.com/search?'))?{
????????window.location.href =?'https://encrypted.google.com/search'?+?window.location.search;
????}?else?{
????????window.location.href =?window.location.href.replace(/http:/,?'https:');
????}???????
}?else?if?(locationProtocol ==?'https:')?{
????var?nodes, thisNode;
????if?(window.location.href ==?'https://www.google.com/'?||?window.location.href.indexOf('https://www.google.com/webhp?')?==?0?||?window.location.href ==?'https://encrypted.google.com/'?||?window.location.href.indexOf('https://encrypted.google.com/webhp?')?==?0)?{
????????if?(!selectNodes("//div[@id='gbar']").snapshotItem(0))
????????????addgbar();
????????nodes = selectNodes("//div[@id='gbar']");
????????thisNode = nodes.snapshotItem(0);
????????thisNode.style.display =?'inline';
????}?else?if?(window.location.host ==?'webcache.googleusercontent.com')?{
????????nodes = selectNodes("//a[starts-with(@href, 'http://webcache.googleusercontent.com')]");
????????for?(var?i=0; i < nodes.snapshotLength; i++)?{
????????????thisNode = nodes.snapshotItem(i);
????????????thisNode.href = thisNode.href.replace(/http:/,?'https:');
????????}?
????}?else?if?(window.location.href.indexOf('https://encrypted.google.com/search?')?==?0)?{
????????if?(!selectNodes("//div[@id='gbar']").snapshotItem(0))
????????????addgbar();
????????nodes = selectNodes("//span[@class='gl']/a[starts-with(@href, 'http://webcache.googleusercontent.com')]");
????????for?(var?i=0; i < nodes.snapshotLength; i++)?{
????????????thisNode = nodes.snapshotItem(i);
????????????thisNode.href = thisNode.href.replace(/http:/,?'https:');
????????????thisNode.removeAttribute('onmousedown');
????????}
????????if?(window.location.href.indexOf('#sl')?>=?0)?{
????????????var?cStat, cEnd, prefCookie;
????????????if?(document.cookie.length >?0)?{
????????????????cStart =?document.cookie.indexOf('PREF=');
????????????????if?(cStart >=?0)?{?
????????????????????cStart +=?5;
????????????????????cEnd =?document.cookie.indexOf(';', cStart);
????????????????????if?(cEnd <?0)?cEnd =?document.cookie.length;
????????????????????prefCookie =?document.cookie.substring(cStart, cEnd);
????????????????????var?useLanguage =?'', locationHref =?document.location.href;
????????????????????cStart = locationHref.indexOf('hl=');
????????????????????if?(cStart >=?0)?{
????????????????????????cStart +=?3;
????????????????????????cEnd = locationHref.indexOf('&', cStart);
????????????????????????if?(cEnd <?0)?cEnd = locationHref.length -?3;
????????????????????????useLanguage = locationHref.substring(cStart, cEnd);
????????????????????????}
????????????????????if?(useLanguage.length ==?0)?useLanguage = defaultLanguage;
????????????????????if?(useLanguage.length >?0)?{
????????????????????????cStart = prefCookie.indexOf('LD=');
????????????????????????if?(cStart <?0)?{
????????????????????????????prefCookie +=?':LD='?+ useLanguage;
????????????????????????}?else?{
????????????????????????????cStart +=?3;
????????????????????????????cEnd = prefCookie.indexOf(':', cStart);
????????????????????????????if?(cEnd <?0)?cEnd = prefCookie.length;
????????????????????????????prefCookie = prefCookie.substring(0, cStart)?+ useLanguage + prefCookie.substring(cEnd, prefCookie.length);
????????????????????????????var?exdate =?new?Date();
????????????????????????????exdate.setDate(exdate.getDate()?+?365);
????????????????????????????document.cookie =?'PREF='?+ prefCookie +?';expires='?+ exdate.toGMTString()?+?';domain=.google.com';
????????????????????????}
????????????????????}
????????????????}?
????????????}
????????????
????????}
????}
}

轉載于:https://www.cnblogs.com/IS2120/archive/2011/12/29/6745962.html

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/380029.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/380029.shtml
英文地址,請注明出處:http://en.pswp.cn/news/380029.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

阿諾德.施瓦辛格 訓練方法

阿諾德.施瓦辛格 訓練方法七次“奧林匹亞先生”獲得者、著名影星阿諾德.施瓦辛格&#xff0c;是廣大健美愛好者崇拜的偶像。即使在今天&#xff0c;他那無與倫比的二頭肌和胸肌仍為人們津津樂道。本文是他通過親身體會&#xff0c;講述了怎樣鍛煉才能增長肌肉的觀點和方法&…

ADC和SBB命令

ADC 帶進位加法指令 用法&#xff1a; adc 操作數1&#xff0c;操作數2相當于&#xff1a; 操作數1操作數2進位標志CF->操作數1現在的eax是0&#xff0c;C1&#xff0c;用adc指令直接會是0x6 SBB 帶進位減法指令 用法&#xff1a; sbb 操作數1&#xff0c;操作數2相當…

Java——集合(輸入一串字符串,統計字符串中每個字符出現的次數)

A&#xff1a;案例演示 需求&#xff1a;輸入一串字符串&#xff0c;統計字符串中每個字符出現的次數** 分析&#xff1a;1&#xff0c;定義一個需要被統計字符的字符串2&#xff0c;將字符串轉化為字符數組&#xff0c;才能拿到每一個字符3&#xff0c;定義雙列集合存儲字符串…

entry數組_數組entry()方法以及JavaScript中的示例

entry數組JavaScript entry()方法 (JavaScript entries() method) entries() method is used to create an iterator object of an array to access the keys (index) and values. entry()方法用于創建數組的迭代器對象&#xff0c;以訪問鍵(索引)和值。 Syntax: 句法&#xf…

mul和div指令(8位,16位,32位)

MUL 無符號乘法指令&#xff0c;默認操作數與eax相乘&#xff08;這里只說32位&#xff0c;其他與下面的div類似&#xff09; 格式&#xff1a; mul 操作數 //操作數只有一個操作數與eax相乘&#xff0c;結果共有16位&#xff08;這里的16位是16進制數&#xff09;&#xff…

2011年年終盤點

不知不覺又到了年底&#xff0c;我坐在電腦前&#xff0c;竭力的回憶&#xff0c;卻發現回憶中一片空白&#xff0c;能記起也就那么幾件事。 一、在暑假做了一個多月的電子商務 在這個過程中&#xff0c;我了解到電子商務的基本流程&#xff0c;以及一些銷售技巧&#xff0c;還…

ASP.NET Application,Session,Cookie和ViewState等對象用法和區別

ASP.NET Application,Session,Cookie和ViewState等對象用法和區別 在ASP.NET中&#xff0c;有很多種保存信息的內置對象&#xff0c;如:Application,Session,Cookie,ViewState和Cache等。下面分別介紹它們的用法和區別。 方法 信息量大小 作用域和保存時間 應用…

Java——集合(HashMap與Hashtable的區別)

* HashMap和Hashtable的區別* 共同點&#xff1a;* 底層都是哈希算法&#xff0c;都是雙列集合* 區別&#xff1a;* 1&#xff0c;HashMap是線程不安全的&#xff0c;效率高* Hashtable是線程安全的&#xff0c;效率低 * 2&#xff0c;HashMap可以存儲null鍵和null值* Has…

判斷字符串是否構成回文_構成字符串回文的最小刪除數

判斷字符串是否構成回文Problem statement: 問題陳述&#xff1a; Given string str find the minimum number of deletions such that the resultant string is a palindrome. 給定的字符串str找到最小的刪除數&#xff0c;以使最終的字符串成為回文。 Input:Each input con…

imul和idiv指令

imul 有符號乘法指令&#xff0c;分單操作數&#xff0c;雙操作數和但操作數 單操作數&#xff1a;此形式與mul指令使用完全相同&#xff0c;操作數乘以al、ax、或eax寄存器中的值&#xff0c;乘積分別存儲到ax、dx&#xff1a;ax或edx&#xff1a;eax中 執行指令&#xff1a…

Ajax的注冊應用

最近發現Ajax在用戶注冊表單和用戶登錄表單方面應用&#xff0c;最能體現Ajax的交互特點&#xff0c;因此又是寫了一個習作&#xff01; 演示效果 新開窗口地址&#xff1a; http://www.klstudio.com/demo/ajax/reg.htm 下載地址:http://www.klstudio.com/demo/ajax/reg.rar &…

Java——集合(模擬斗地主洗牌和發牌進行排序)

//改進版&#xff0c;沒有進行按牌的地位從小到大排序 package com.yy.test;import java.util.ArrayList; import java.util.Collections;public class Test2 {/*** * A&#xff1a;案例演示* 模擬斗地主洗牌核發牌&#xff0c;牌沒有排序* * 分析&#xff1a;* 1&#xff0c;…

應用程序控件

活動指示器 當任務或進程已經完成時&#xff0c;活動指示器就會消失。推薦您使用這種默認行為&#xff0c;因為用戶期望在有動作發生時看到活動指示器&#xff0c;而且他們會將靜止不動的活動指示器與停滯的進程聯想到一起。 要了解如何顯示網絡活動指示器&#xff0c;請參考UI…

離散數學與集合論_離散數學中的集合論和集合類型

離散數學與集合論集合論 (Set theory) The set is a well-defined collection of definite objects of perception or thought and the Georg Cantor is the father of set theory. A set may also be thought of as grouping together of single objects into a whole. The ob…

XADD和NEG命令

XADD 交換相加指令&#xff0c;先交換然后相加 比如說&#xff1a; xadd eax&#xff0c;ecx /* 相當于&#xff1a;先執行&#xff1a;xchg eax,ecx然后執行&#xff1a;add eax,ecx */此時eax2&#xff0c;ecx3&#xff0c;執行完&#xff1a;eax5&#xff0c;ecx2 neg …

Visual C# 2008+SQL Server 2005 數據庫與網絡開發--11.3.2 LINQ to SQL對數據庫建模

Visual Studio 2008版本中為LINQ to SQL提供了一個特別的設計器&#xff0c;使用這個設計器可以很方便的將數據庫可視化地轉換為LINQ to SQL對象模型。在LINQ to SQL中&#xff0c;設計器在關系數據庫的數據模型和開發語言之間建立一座橋梁。當應用程序運行時&#xff0c;LINQ …

Java——異常處理(鍵盤錄入一個整數,輸出其對于二進制)

例題&#xff1a; 鍵盤錄入一個int類型的整數&#xff0c;對其求二進制表現形式 如果錄入的整數過大&#xff0c;給予提示&#xff0c;錄入的整數過大&#xff0c;請重新錄入一個整數BigInteger 如果錄入的是小數&#xff0c;給予提示&#xff0c;錄入的是小數&#xff0c;請…

認清SQL_Server_2005的基于行版本控制的兩種隔離級別

--認清SQL_Server_2005的基于行版本控制的兩種隔離級別--By:zc_0101 Date:2010-03-31--快照隔離級別(snapshot)和已提交讀快照隔離級別(read committed snapshot)--特點&#xff1a;在這兩種隔離級別下&#xff0c;讀取數據時不再請求共享鎖&#xff0c;而且永遠不會與修改進程…

Java SecurityManager checkPermission()方法與示例

Syntax: 句法&#xff1a; public void checkPermission(Permission perm);public void checkPermission(Permission perm, Object cntxt);SecurityManager類的checkPermission()方法 (SecurityManager Class checkPermission() method) checkPermission() method is availa…

匯編test指令

功能&#xff1a;將兩個操作數進行邏輯與運算&#xff0c;并根據運算結果設置相關的標志位&#xff0c;并不改變操作數1和操作數2的值 test 操作數1&#xff0c;操作數2我們經常用test來判斷一個值是否為0&#xff0c;用法&#xff1a; test 操作數1&#xff0c;操作數1比如我…