Hacking the Web with Greasemonkey
plasticmillion writes "Greasemonkey is a revolutionary Firefox extension that many feel has enormous implications for the future evolution of the web. By making it easy to write client-side scripts that modify webpages as you surf, it shifts the balance of power from content creators to content consumers. Since its inception, it has given rise to an impressive array of scripts for everything from enhancing Gmail with one-click delete functionality to preventing Hotmail from spawning new windows when you click on external links. In recent Greasemonkey news, Mark Pilgrim just published a comprehensive primer called 'Dive Into Greasemonkey', a must-read for those who want to try their hand at writing their own scripts. It should be noted that Greasemonkey is not without controversy, but this has done nothing to reduce its popularity among web programmers. Even Opera has jumped on the bandwagon with their own version of user scripts. To illustrate the principle to /.ers, I whipped up a handy little script called 'Slashdot Live Comment Tree', which lets you expand and collapse entire threads in an article's comments."
If other articles are drawing notice to free registration for articles such as the NYT, why is this one linking to an article trying to charge $34?
"Those who cast the votes decide nothing; those who count the votes decide everything." (attrib. Joseph Stalin)
It should also be noted that the person claiming controvesy is also charging $49.00 for the "research" he has written. Do people buy these things?
Any, the summary of it reads as basically "users might install extensions that don't work with your own corporate pages". Personally, if an end user is installing applications without understanding the implications, you should ask whether that user should be allowed to install applications. The "researcher" claims that this risk should delay Firefox roll-outs in the enterprise.
So you are in full support of the MPAA and the RIAA who want to have full control over their content and only allow people to access it, and use it they way they want you to use it?
your site crashes my firefox 1.04 win32 with 100% CPU freezing after the title loads (i have to taskmanager kill it)
MSIE its fine (albeit a little slow)
perhaps whatever scripting you got going on needs a rethink
Your serving the webpage to me.
As long as you do it in a standards compliant way, then isn't it a bit presumptious to decide how I decide to digest the information.
If I want to use Lynx to view your page, I will, if I want to apply my own java transforms on it I will.
Hell, if I want to print it out and use it as toilet paper, I will.
You seem to have the wrong way of thinking about this web lark.
liqbase
But the web is about sending content to the user - it's up to the user how they want to display it. Unles you're supplying a locked down PC with your own browser configuration you have absolutely no control over what the end user does with the content you send, or how they interpret it.
Sure you can send CSS to the broser, but your visitor using links isn't going to see the result of you work. The visitor using a screen reader or mobile phone will be equally ignorant of your efforts.
These are user installed scripts, and this is the web not television. The folk visiting sites are not their passively, they're there to interact and if they want your site to function a little differently so it better fits with their expectations what rights do you have to stop them?
And how is that? Because HTML was a protocol for transferring information, not for regidly defined formatting or layout. The graphical browsers came along and people started taking the attitude you are espousing "as it was meant to be seen" by you, the creator.
HTML itself however does not support that idea. Different agents (trad. browser, voice agents for the blind etc.), different and also overriding CSS stylessheet et. al. are explicitly catared for in its idea. If the user which to use your content in a manner other than that which you suggested, the intent of the spec is on their side here. HTML is not a fixed layout format. It is for the transmission of information, to be used according to the whims of the receiver.
This seems to be another step in the battle that's as old as the web, over who gets final say as to how a web page is presented.
I feel the (Firefox) user should, and generally is going to have the edge, what with the uriid extension to apply site-specific CSS, greasemonkey, and other tools. But page producers always have wanted to dictate exactly how their pages appear to the user, however misguided that is, and I doubt the battle will ever be over.
Oh no... it's the future.
Websites are a strange medium. Things like greasemonkey and adblock and google toolbar have been spurring these debates about content control.
I would not be suprised if this debate grew bigger as the popularity of client side controll apps gets bigger.
Alot of people want their webpage to look the way they intended it to look, but I think the truth is that you can not count on that. Different browsers, different computers, different monitors...
I am in favor of client side tools, I think that a user getting the best use possible out of a site is a good thing, in fact that is my goal when designing a website. If they think they can do it better, be my guest.
"how can they call it a MINE if everything here is THEIRS?!?!" -Straight Jacket
So I run off in hopes of reading the controversy and it says I need to pay $49.00 to "By the Research"? What gives? Anybody have any worthwhile information to spare us broke college kids a little cash? Or, is my exam fragmented brain missing something that should be obvious?
My lame blog.
Just publish your site as a collection of image files.
That'll teach them young whipper-snappers!
Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
Your analogy is flawed. Artists have never had a right to prevent you from looking at their work in a certain way. Painters can't stop the colorblind or those wearing sunglasses to look at their paintings. Anyone can skip entire chapters when reading a book. I can play Beethoven and Britney Spears at the same time if I please.
What I do with those works in the privacy of my own home is my business. I might just prefer it that way, and there's nothing you can do about it.
Artists do have recourse against people redistributing altered ("raped") works, but that is also limited.
In the case of greasemonkey, it's just a tool you use to view the web; other people might use other tools, like lynx for example, which renders a page completely differently from firefox or internet explorer. It's personal use. So lay off of it.
SCO employee? Check out the bounty
In that case, could you fix the fact that your links column is completely over-writing the little box about the RSS feed on Firefox unless I make my browser window huge?
"I Know You Are But What Am I?"
You can suggest, tell the visitor 'look, this is supposed to look like that', but ultimately the choice is the user's, just as in a book the reading order is merely a hint, if one wants to read the book backwards more power to him, and the author is not supposed to come at him with a big stick saying "no no, you're not supposed to read backwards, you can't skip pages either or i'll beat you to a bloody pulp you crackwhore", which is exactly what mfh intends to do...
"The way we can tell it's C# instead of Haskell is because it's nine lines instead of two." -- wadler
I'll get modded into oblivion, but screw it.
This doesn't make any sense. How is the user capable, or how has the user been capable to display information on the Web (not the internet, just a part) with a web browser.
Remember, this like this never happened before this FF extension, so where do you come off saying that?
People write web pages, the browser displays them. Similar to the television, yet far more versatile, it simply displays a site how the designer attended. How has this been difficult to understand?
Not that I'm against this plug-in, I find it interesting however, but don't understand where you're getting your facts from. On the contrary, the comments on Slashdot so far seem to be this wild notion of "we do what we want", "information wants to be free" and my favorite general attitude "screw the man, I'll display my information the way I want".
No. Sorry. It's not your information. It doesn't belong to anyone. Those that chose to display information a certain way are in their right to do such and lame excuses to justify the bastardization of their attempts to come off a certain way are the rant of the uninformed zealot with a "screw you all" mentality.
Is it a wonder people here aren't terribly popular with employers and don't get the respect they deserve?
It's not something everyone has to get all up in arms about. It's a presentation of information. If you don't like it, go somewhere else! If he chooses to display it and prevent this extension from running on his site, so be it! He's well within his rights to do such.
It's not he evil DRM anal-retentive control the *AA's are trying to do so this won't work. For that kind of argument is just like the way anyone else was to lose if they mentioned something regarding Nazis.
You lose... game over - looks like he won.
I have a web page that runs a little javascript at the end, where it pops up an alert window, then redirects to another page. I would like to write a greasemonkey script to remove this redirection. Unfortunately, the page's javascript gets run before greasemonkeys. Any ideas about how get my greasemonkey script to run sooner?
I'm a leaf on the wind. Watch how I soar.
It does, basically user scripts (Greasemonkey or Opera) are bookmarklets automatically executing when you browse a specific site (pattern matching allows the browser to execute the userscript that should be upon entering the website).
Oh, and there is no limit in a user script size, which isn't the case of a bookmarklet (even though you can execute external scripts from a bookmarklet)
"The way we can tell it's C# instead of Haskell is because it's nine lines instead of two." -- wadler
"Even Opera has jumped on the bandwagon with their own version of user scripts." Well, considering that Opera previewed a similar technology back in early 2003, I'm not so sure you could call that "jumping the bandwagon". But still, it's a nice edition, both to Firefox and Opera.
I provide my content with a Creative Commons license. Everyone is free to modify it. Everyone is free to use the code that generated the website (well soon enough, it's just about ready to be released) and everyone can use my RSS to reformat my site and syndicate it.
So you're ok with people modifying your content, but not your presentation? That's retarded.
You do know that when someone uses Greasemonkey to alter your site, that's only for them, right? No one else is seeing it that way..
Let me put it plainly to you: After the bits leave your server, you have no control over how they are displayed. Morally or tangibly. The sooner you come to grips with this concept, the easier your life will be.
Your sole alternative is to replace all your site content with each page becoming an image. That is the only way you will ever prevent client-side layout alteration.
It's not something everyone has to get all up in arms about. It's a presentation of information. If you don't like it, go somewhere else! If he chooses to display it and prevent this extension from running on his site, so be it! He's well within his rights to do such.
Of course he's within his rights. The real question is what's the benefit to him? People using greasemonkey tend to be people who know what they're doing, so if they break something on a site they'll likely be able to fix it. But just like the article, there seems to be this paranoia that greasmonkey will run rampant and ruin everyone's browsing experience.
Bah! When I go to the poster's website, you know what I see? Overlapping content because I don't run a 1024x768 window. I could fix it with greasemonkey, but that would be 'breaking' the designer's intentions.
I'm a web designer, and I truly believe that a good designer knows better than a user how things should look 95% of the time... but if a user wants to override my design choices that is fine with me. Of course my sites may end up looking up broken and discombobulated, but why should that matter to me? Anyone doing that should know why things are broken, and if not than it's not really worth my time to worry about it. I'd rather have a few idiots think I'm a shitty designer than have my fellow web hackers think I'm a control freak.
"It is nothing personal, it is just business and honestly, my paycheck, not my morals, dictate my work environment."
The second worst thing about that statement is that you sound as if you mean it.
The worst thing is that you sound as if you're proud of it.
This attitude causes most of the suffering and evil in the world. The relatively few people who actually have the goal of harming others wouldn't get very far without lots of wimps with this attitude.
(I may just be troll feeding here, but I still had to call it.)
Exam 4/C again. Maybe I'll do better this time.
If someone can't view your site as influenced by some Greasemonkey script or another, it's their fault and their problem. Not yours. You go ahead and provide standards-compliant, semantic markup, and folks'll use it as-is or filter it through something like Greasemonkey.
What's next---are you going to tell people they can't visit your site using lynx, or with images turned off, or that they can't change their font size, so they'll have to squint like everyone else?
What's the point of making it harder on your users, of taking away functionality from them?
--grendel drago
Laws do not persuade just because they threaten. --Seneca
Reading the referenced blog entry, there is a good point to be made where GM breaks sites. The point of standard compliance is that consumers are free to see the output that the producers intended, not that consumers would be forced into one way of working, and enjoying content. Now, so long as the default behaviour (i.e. no GM installed) is fully compatible, this doesn't seem to be a problem. (Maybe linkify should be disabled by default.) We need to ensure that users know what modifications they are making to how websites display, and also know how to add to blacklists and stuff to solve the problem when things go wrong. We shouldn't just categorise this as a consumer vs producer struggle - that's just silly. GM script writers and website owners should be working together, to benefit the user. 1. User scripts need some sort of verification process. Something to guarantee safety, to the casual user. Perhaps some centralised list of checksums for 'certified' user scripts. 2. Websites should be able to check for what user scripts are installed. Not so as to ban them, but to provide a message that 'The scripts you are using are known to be incompatible. For optimal results, please turn them off.'
So I guess you're against popup blockers, spam filters, and other "internet filters" then?
"I sent him two dozen emails selling viagra and porn because I wanted them to go to his inbox, not to his spam folder! How do I disable spam filtering toi make him see my email the way I want it seen??"
"I put that popup code in the HTML because I wanted him to see a popup advert! How do I make popups appear when he's got a popup blocker??"
Sorry, but as long as content is appearing on MY screen in MY web-browser following its download via MY bandwidth, I want to have the final say on what I see and how I see it, thank you very much.
So.. it has come to this
But your site looks bad on my browser, it is making assumptions about my screen that are incorrect. Why would you want to prevent me from fixing that?
Your content is not displayed on your site, it is displayed on my computer, and you don't know my local parameters. What is there to gain, for anyone, by not allowing me to adjust for a mismatch there?
What keeps me going is my inertia.
> I'm a web designer, and I truly believe that a good designer knows better
> than a user how things should look 95% of the time...
Yeah, maybe, but the *other* 97.384% of web designers *don't*. For starters, most of them are stuck in a brain-dammaged 1985-esque mindset wherein they pretend they're still working with an ink-on-paper medium. I've given up entirely on the idea of allowing websites to choose their own colors, and I've half a mind to take away their ability to choose their own layouts too, because most webmasters can't design a layout that works at different resolutions and with different text sizes if their lives depend on it.
Cut that out, or I will ship you to Norilsk in a box.
If you're writing static webpages, so what? It won't affect you.
If you're writing server-side scripting, you should already be paranoid-checking for bad user submissions. Time to double-check everything is in place.
If you're writing client-side scripts, welcome to hell. You can no longer assume anything will be where you put it, or, in fact, still exist.
What's more, you can't test your site "with greasemonkey" to see if it's OK. You have no idea what the user is going to do to your page with it.
This leaves a handful of options:
1) Make your scripts disable Greasemonkey (which will work until too many sites do it, and it's updated to allow users the final say)
2) Switch productive time fixing bugs and adding features to adding and subsequently wading through checks on every possible error condition that user scripts might make possible.
3) Ignore Greasemonkey and when the users complain your site is broken, inform them it's their own stupid fault.
My personal leaning is towards (3).
And it's not how it's supposed to work.
You can suggest, tell the visitor 'look, this is supposed to look like that', but ultimately the choice is the user's,
yes it is (the user's choice).. hasn't user-defined colors (or stylesheets in newer versions) been in graphical web browsers since pretty much the beginning?
note to webmasters: if you DONT want people to alter your page on the client-side, code it strict, use css, and leave the annoying scripts, ads, popups, ani gifs and other crap out of it.
once a site is on MY computer, i will do with it as i please. so long as i dont republish it, you can't piss and moan about it.
Despite how useful it is, I have some concern with GreaseMonkey and your browsers security.
The basic problem I see is that user scripts are plug-ins to to a plug-in. User scripts could do things that would be bad for security such as:
GreaseMonkey does not use the white list of sites allowed to install plugins and allows user scripts to be installed from just about anywhere.
I'm worried that somebody could set up a repository of user scripts that appear to do useful things but have spyware embedded in them. Users would install GreaseMonkey user scripts from the site thinking they were getting useful functionality but not realizing they were getting additional "goodies".
I don't install user scripts without knowing how they work and looking over the source myself. Preferably, I write my own. I don't see most users being able to do that sort of analysis. Hence the danger.
--Currency Calculator to Calculate Rates of Exchange for Foreign Currencies
Using Greasemonkey or ANY OTHER WEB CLIENT other than the one(s) the author is targetting does not make this a derived art. The original is still in its badly conceived format.
The problem here is that a large number of web "developers" believe that they can control the user's experience. The reality is that this is completely contrary to the HTML standard.
HTML is a method for giving structure to a document. CSS is a method of suggesting look-and-feel of the document. However, NOTHING prevents me from using an arbitrary web client (note: a "browser" is just one type of web client) that will display the structured document in some other way.
If you are designing a page/site in such a way that you try to force a given look-and-feel to everyone, you are limiting the usefulness of your site...not improving it.
On top of that The primary goal of a website is not to convey "art", it's to convey and publish information...
And as I (and other people) said, if I can't change the font colors, reorganize the page or whatever I want, how pissed the so called artist will be when I'll start using Links or Lynx to browse his website? or Netscape 2?
Fact is, if you want your website to be set in stone and consider it a crime for anyone to modify what he sees on his computer without any impact on whatever the other may be fed you shouldn't be creating a website in the first place.
You should be hacking rocks (even though sculptures can be broken or re-sculpted, you don't own them anymore as soon as they leave you) or painting (see above).
The feelings/emotions are supposed to be conveyed to the reader. If the reader doesn't understand/want them, what are you going to do, try to force your own sensibility on him? Nice way to make him leave forever...
"The way we can tell it's C# instead of Haskell is because it's nine lines instead of two." -- wadler
But they're not displaying their content. The client web browsers are displaying the content and they have a right to display however they please. :)
What next, Real?
"The way we can tell it's C# instead of Haskell is because it's nine lines instead of two." -- wadler
"How is the user capable, or how has the user been capable to display information on the Web (not the internet, just a part) with a web browser... [things]* like this never happened before this FF extension..."
Wrong and wronger. The *whole point* of the WWW is that a document is presented with a documented set of tags, and it's up to the user agent to specify how those tags get interpreted. The first browser I used (Chameleon, ~1995) had a panel for setting prefs on how you wanted to interpret tags. If you want H1...H6 to be interpreted as darker...lighter instead of bigger...smaller, that's OK. If you want <strong> to be big red blinking text, that's up to you.
Furthermore, there are already tons of ways to control how a page looks. FF's web devloper toolbar lets you do all kinds of stuff. Browsers for quite a while have let you choose alternate style sheets, or none at all. There's even an FF extension that lets you *edit* the CSS on your page. No sense mentioning things like Links, Lynx, and screen readers, where most of the presentation information is completely stripped away.
If the site host has an *idea* of how his information should be presented, good for him. But if I want to sit with my back to the screen and pay a friend to read it to me, is the designer gonna come beat me up? I bet you think going to the bathroom during commercials is stealing, too.
"Those that chose to display information a certain way are in their right to do..."
They can *send the bits to my computer*, that is it. It's up to me and my software to interpret them as I wish. Remember, *he's* the one who posted his work in a public place. If he wants to be an anal-retentive, user-fighting dickwad, he can make PDFs. Just don't tell him I own the full version of Acrobat and can edit PDFs, too.
* it seems like "things" was what you meant to say here.
Dear Slashdot: next time you want to mess with the site, add a rich-text editor for comments.
"...it shifts the balance of power from content creators to content consumers."
Shouldn't that be back to content consumers? Am I mis-remembering, or wasn't there once a time when Web browsers had built-in functionality to actually let users customize how certain tags got rendered in the browser window (fonts, colors, etc.)?
AGREED!!!! This "I make no errors" idiot has one of the worst formatted pages I've EVER had the displeasure of viewing. That he'd be the one to go on a rant of "I'm not allowing others to change the way they view my information/art" is laughably ironic.
Leather furniture perhaps? Some tenants can be awful sweaty and actually stain the leather. Seriously nasty. Basically, instead of putting ugly slipcovers on everything, they're asking you to wear your own.
The point of a website can be different for its producer than for its consumer. The producer's point could be to express themself, which requires consumption in exactly the style they publish. The consumer's point could be to get the factual information, regardless of its presentation style, or even for restyled representation. The fact that most web content is inseparable from its presentation style means that you, the graphic designer, are necessary for both points, even if the consumer doesn't share the "style" point.
The "point" it seems that you are missing is that the value of the webpage to the consumer can exclude *you*, even if you don't like that.
--
make install -not war
The difference is that Opera scripting system is backwards-compatible with Greasemonkey, thus setting a precedent for GM to become a de-facto standard for such things.