Greasemonkey script can create a page from scratch? How do you fire it?

I was thinking about IdentityBurro. [IdentityBurro is a Greasemonkey script that, for example, when you are on the page of user phauly on del.icio.us, inserts into that page some links to the page of user phauly on flickr, 43things, webjay, last.fm, …]
I was thinking that instead of simply inserting a link I could directly insert into the page some photos of the user on flickr and some things he has been doing and some songs he has been listening. So basically it would be easy enough to produce a page like the ones in which technorati aggregates a lot of information about a tag (example) by showing some photos of the user from flickr, some URLs bookmarked by the user on del.icio.us, etc.
But why inserting all this information into a, for example, already existing flickr page? Why not creating a new page at all?
So the question is: can Greasemonkey be used to create a page from scratch and not just inserting some HTML elements into an already existing page? I guess the answer is yes but are there already examples out there? And, in this case, what fires the script since there is no originating web page? Could I run it just by typing in the address bar something like greasemonkey://my_aggregator.user.js?
I guess this userscript behaviour is in the air and actually, while I was typing this, I kinda remember that was propably jesse who was pondering this possibility loudly enough for me to hear it.

4 thoughts on “Greasemonkey script can create a page from scratch? How do you fire it?

  1. paolo

    I read the extension and got it partially.
    You remove a “footer” element with this code
    var footer = document.getElementById(‘LastFooter’);
    footer.parentNode.removeChild(footer);
    but there is anyway a page already there, right?

    I think I was referring to creating an HTML page from scratch with a line of code in the beginning of your script such as:
    var new_html_page = document.createElement(‘html’);

    Would it be possible? Make sense? How to fire it? Am I missing something?

  2. alf

    It doesn’t matter if there’s a page there or not – in this particular case there’s a 404 error page that gets manipulated, which is what’s most likely to happen. You can just replace document.body with your own HTML.

  3. paolo

    Ok, I’ll try to play with it and report back my findings. I want to create the aggregation technorati page with a greasemonkey script not invoked on a page but fired but itself. I guess you can call it a Web Agent that sits in my browser and get activated by itself sometimes … need to think better about it.

Leave a Reply

Your email address will not be published. Required fields are marked *