Secure connections on sites

By JoeSimmons Last update Nov 19, 2008 — Installed 1,645 times.

There are 6 previous versions of this script.

// ==UserScript==
// @name           Secure connections on sites
// @namespace      http://userscripts.org/users/23652
// @description    Forces known sites to use a secure connection
// @include        http://*paypal.com/*
// @include        http://www.google.com/accounts/ServiceLogin?service=mail*
// @include        http://addons.mozilla.org/*
// @include        http://*isohunt.com/*
// @include        http://*evernote.com/*
// @include        http://*binsearch.info/*
// @include        http://*binsearch.net/*
// @include        http://mail.google.com/*
// @include        http://www.google.com/calendar/*
// @include        http://docs.google.com/*
// @include        http://spreadsheets.google.com/*
// @include        http://www.google.com/reader/*
// @include        http://www.google.com/bookmarks/*
// @include        http://www.google.com/history/*
// @include        http://www.google.com/notebook/*
// @include        http://groups.google.com/*
// @include        http://sites.google.com/*
// @include        http://*.amazon.com/*
// @include        https://*.amazon.com/*
// @include        https://*amazon.com/*
// @include        http://facebook.com/*
// @include        http://www.opendns.com/*
// @include        http://eztv.it/*
// @include        http://www.last.fm/* 
// @include        http://orkut.com/*
// @include        http://www.orkut.co.in/*
// @copyright      JoeSimmons
// ==/UserScript==

if(/^http:\/\//.test(window.location)) {
window.location.replace(location.href.replace(/^http:/, 'https:'));
}

if(/^https:\/\/www\.amazon\.com/.test(window.location)) {
var i, l, links;
links = document.evaluate("//a[starts-with(@href, 'http://')]", document, null, 6, null);
for(i=links.snapshotLength-1; i>=0; i--) {
l = links.snapshotItem(i);
l.href = l.href.replace(/^http:\/\//, "https://");
}
}