Click here to Skip to main content
15,867,308 members
Articles / Web Development / HTML
Article

CPHog for Internet Explorer

Rate me:
Please Sign up or sign in to vote.
5.00/5 (10 votes)
17 Jun 20052 min read 68.1K   224   12   19
A translation of Shog9's GreaseMonkey script, useable in Internet Explorer with Trixie.

Introduction

Shog[^] has created a nifty little script that uses GreaseMonkey[^] to provide extra goodness to the CodeProject experience, when viewed through FireFox. My particular interest was drawn by the "quick reply" feature it adds to the CodeProject message boards. His original script can be found here[^].

Plug-in Required

As nice as that is, it doesn't work in Internet Explorer. Curious, I looked to see if there was a GreaseMonkey equivalent for Internet Explorer. There happen to be a few, but Trixie[^] looks to be the most reliable among those that I found. You must download and install it (or something similar) in order to use this script in this article.

Update - June 14, 2005: This link[^] shows that Trixie is no longer in development, in favor of Turnabout[^], which works just fine for this script.

Modified Script

The script attached to this article has no significant changes, other than those necessary to make Shog's GreaseMonkey script work inside Internet Explorer with Trixie. Download the script, and copy install it using the directions supplied with Trixie. Enjoy it, and let me know if you create any improvements or find errors.

If you want to explore the code, do a comparison of the JavaScript files. You'll find that I inserted code to replace GreaseMonkey's GM_GetValue and GM_SetValue functions. Also, since IE doesn't support document.evaluate, I had to replace those with a series of loops and "if" statements working through the results of getElementsByTag and getAttribute. (I did find JavaScript code that would implement document.evaluate, but it didn't handle everything, and it was very slow to load the CP Lounge pages.)

You will also notice a "hack" designed to prevent multiple-insertion of the quick-reply links and other features. Basically, we add a tag to the top of the document. If the tag is not already there, we do everything the plug-in needs to do. If the tag was there already, it avoids redoing the same work. Very important, if you want things to work properly. (Note, I didn't find out if this was a Trixie-only issue.)

Updates

  • June 10, 2005 - Corrected a multiple-insert problem when using CPHog in articles and some other parts of CodeProject.
  • June 14, 2005 - Added a link to Turnabout, and wrote up a description of the changes needed for Shog's script to work in Internet Explorer.
  • June 17, 2005 - Made a change to hopefully prevent the mis-attributed quote problem discovered by PJ Arends.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralSaving Data Pin
PJ Arends2-Jul-05 11:46
professionalPJ Arends2-Jul-05 11:46 
GeneralRe: Saving Data Pin
PJ Arends2-Jul-05 13:13
professionalPJ Arends2-Jul-05 13:13 
GeneralRe: Saving Data Pin
PJ Arends2-Jul-05 22:58
professionalPJ Arends2-Jul-05 22:58 
GeneralWierdness Pin
PJ Arends15-Jun-05 18:14
professionalPJ Arends15-Jun-05 18:14 
GeneralRe: Wierdness Pin
PJ Arends15-Jun-05 18:23
professionalPJ Arends15-Jun-05 18:23 
GeneralRe: Wierdness Pin
John Fisher17-Jun-05 6:32
John Fisher17-Jun-05 6:32 
GeneralRe: Wierdness Pin
John Fisher17-Jun-05 7:30
John Fisher17-Jun-05 7:30 
John Fisher wrote:
There is also a weirdness that keeps the quick reply from showing up in this page every once in a while.

Well, happily, I was wrong about that one. I was just impatient, and sometimes it take a bit longer for Turnabout to run through the script (don't know why though).

John
GeneralRe: Wierdness Pin
John Fisher17-Jun-05 7:31
John Fisher17-Jun-05 7:31 
GeneralRe: Wierdness Pin
John Fisher17-Jun-05 7:31
John Fisher17-Jun-05 7:31 
GeneralRe: Wierdness Pin
John Fisher17-Jun-05 7:37
John Fisher17-Jun-05 7:37 
GeneralRe: Wierdness Pin
PJ Arends17-Jun-05 17:17
professionalPJ Arends17-Jun-05 17:17 
GeneralLUCKY Pin
eggie510-Jun-05 13:42
eggie510-Jun-05 13:42 
GeneralRe: LUCKY Pin
John Fisher10-Jun-05 16:21
John Fisher10-Jun-05 16:21 
GeneralKewl Pin
PJ Arends10-Jun-05 9:18
professionalPJ Arends10-Jun-05 9:18 
GeneralRe: Kewl Pin
John Fisher10-Jun-05 10:11
John Fisher10-Jun-05 10:11 
GeneralRe: Kewl Pin
PJ Arends10-Jun-05 10:43
professionalPJ Arends10-Jun-05 10:43 
GeneralRe: Kewl Pin
John Fisher10-Jun-05 12:16
John Fisher10-Jun-05 12:16 
GeneralRe: Kewl Pin
John Fisher10-Jun-05 17:37
John Fisher10-Jun-05 17:37 
GeneralRe: Kewl Pin
PJ Arends11-Jun-05 6:47
professionalPJ Arends11-Jun-05 6:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.