Archive for the ‘greasemonkey’ Category

My First User Script Tweak

Wednesday, September 27th, 2006

Securify stuff.

This is a tweak of Mark Pilgrim’s nice little GMail securing greasemonkey script. All it really does is replace “http” with “https” for urls matching a string. (All I did was add a couple urls to the list.)

It’s very handy for things like gmail & writely, which have ssl equivalents that aren’t used by default.

What caused me no end of trouble, that I finally figured out is that greasemonkey scripts need to end not with “.js” but with “.user.js”

Here ’tis… (again, note that all I did was add 2 include lines and change the name to “securify stuff”.)

// ==UserScript==
// @name Securify Stuff
// @namespace http://diveintogreasemonkey.org/download/
// @description force various sites to use secure connection
// @include http://gmail.google.com/*
// @include http://writely.com/*
// @include http://www.writely.com/*
// ==/UserScript==

window.location.href = window.location.href.replace(/^http:/, ‘https:’);