Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

CPHog for Internet Explorer

0.00/5 (No votes)
17 Jun 2005 1  
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