Here it is. Day five of the Hoodwink’d docu-drama. Can you believe this? Here, look. We are left with a smoldering meteor from an alien planet in our hands:
There’s so much to say about this proxy. I’ll start by saying that I barely wrote any of the code. MenTaLguY wrote the good stuff. And Goto Kentaro wrote the really good stuff because he wrote WEBrick::HTTPProxy, which we’re just clawing inside and operating from within.
The overhead view is this:
The prewink method rewrites the request. We serve cached stuff from within the proxy (so the JS file doesn’t get retrieved everytime you go anywhere) and mimick HOSTS.
The upwink method injects a Javascript into the page.
The fixup_script method replaces GM_API methods with HoOdLuM_API methods. This is where browser compatibility stuff will go. We could end up implementing all of Firefox inside IE and Safari, though. So this is still up in the air.
I still want to see what MrCode’s got. Wonderland could be a lot cleaner and could use Ruby alot more effectively. For now, Hoodlum sits on the Javascript side.