views:

280

answers:

6

There is a particular website I must use for work which is absolutely heinous and despised by all who must use it. In particular, the site's Javascript is fundamentally broken and works only in IE, which pretty much makes it the only site I must use outside my preferred browsers.

So, to the question. If I could 'patch' the javascript after loading the website in such a fashion as to 'do the right thing', I could then use the website without IE.

( Just to cut out some of the superfluous answers: I have already tried masking both browsers as IE, which has no effect because the issue is with the javascript, not browser detection on the server. )

I would prefer solutions which are for Opera, though I'm not opposed to Firefox answers. Also, I would rather not have to view the site though a proxy, though I will entertain such answers.

+4  A: 

For Firefox, you could use the Greasemonkey addon to do this.

Greg
+2  A: 

You could probably use the Greasemonkey addon for firefox to do this. It would let you write javascript to run in their page, and could probably use that to do a "patch" at runtime. I've never written a greasemonkey script before, so I don't know how easy it would be to get something working, but it might be worth a look.

Herms
+8  A: 

For Opera, you want User JavaScript. Similar to Greasemonkey, but built-in to Opera. Built to be used for exactly the sort of situation you're in: fixing sites that are broken in Opera...

Shog9
+1 That looks like just the thing. I'll try it out, and be back for your green check if it solves my issue. Thanks!
Aaron
CHECK This is exactly what I need. User javascripts are executed before the page's Javascripts. Further, Opera has semantics for redefining the elements that bad scripts use, to allow them to function correctly. Thanks @Shog9 for this answer!
Aaron
+2  A: 

Greasemonkey is exactly what you want for this. I have extensively hacked some sites using it and there are a plethora of good examples at www.greasespot.net. Although this page is about Opera it has some good examples that are applicable to Greasemonkey in firefox too. I also noticed that the Greasemonkey wikipedia article has information about using Greasemonkey or equivalents in other browsers too.

scott
A: 

I'm not sure that GreaseMonkey will be much good for patching. GM scripts run after the page has loaded and all native scripts have run so anything that was going to break will already have broken.

meouw
It's not necessarily broken permanently, though. He could patch over some functions, introduce some new ones, and re-run the initialization.
Rob Kennedy
In particular, it breaks based on scripts that run as a result of user input, so patching after load, but before input should be able to fix the site.
Aaron
Well ok, I guess so. silly me :)
meouw
Further info: For Opera, User Javascripts are run before the site's javascripts, GreaseMonkey scripts are run after. In the case of this site, I actually do need to do the patching before the site javascript. (silly html.document.all madness...)
Aaron
+1  A: 

You can use also a proxy (I used Proxomitron a long time ago, there are more modern equivalences) which alters the page on the fly before they reach the browser... Thus you can remove all original JavaScript, and add your own, by this way, or with Greasemonkey or user scripts.

PhiLho