Hey,
I had posted about a product that was involved with assigning online reputation for bloggers and commentators online. Developed by a company called SezWho, they have plugins for WordPress and Moveable type that accumulates the online reputation of people at their servers.
I was looking for something similar for Blogspot. but have not really succeeded in finding one. MyBlogLog is not really about comments, and co.mments is more about tracking. Even the SezWho page does not have any offering for blogspot. So I thought that I could come up with something that would allow rating of people who have commented on a blog to show up on blogs hosted by blogger also.
Blogs allow users to embed scriptlets, and that is one functionality that can be used to achieve this functionality. The end result was not graphically great, but achieved the result. I could not complete it, but here is the way to do it, and I would complete it later when I can squeeze out some time.
The script basically looks for the "comments" div, digs a little deeper to find the individual comments that are defined as the element as shown in line 83. It then basically weeds out anonymous comments and sends request to a server that would return the rating of the commentators if any. The user can also rate the current comment writer and the button would perform a hidden iFrame post, after collecting the rater's unique Id (either blogger id, or the mail address). All the cros site AJAX are done using YUI. The unique id of the comment writer is available inside the tag (line 86) and is passed as a parameter. I also saw it working across a couple of different themes. All I now need is some server space and I could get this system up and running.
So far, so good, but this system does have its problems. The entire UI addition will be visible only when one blog post is seen. It is NOT visible when a user is writing comments as the javascript that we include in the page is not available. This would require a Greasemonkey script, but that is for later.
So the design is ready, all I am waiting is for someone to donate me some server space, and some time that I can squeeze out. I am not sure if this really is going to be useful, but javascript development sure is fun !!
Cardspace, Payments and Business
Hey,
Many people have been toying with the idea of using CardSpace as a vehicle for e-commerce payments. The main driver for this idea I believe is the fact that 3-D secure resembles the federation protocols like SAML or WS-FED. Ironically, 3-D secure and federation seem to have the same problems with user adoption. Thought the technology is simply remarkable, the engineers don't seemed to have covered the last mile of taking it to end users.
I first read about this idea in a blog by Sid Sidner. Many others including Ashish Jain (Ping Identity) and Kim Cameroon had linked to the post. I had also found XMLDAP having simple demos of the concept. The guys at xmldap have put up demo. The sample card issuer that corresponds to a bank, and a sample merchant site. The cards issued at the the bank can be used as currency at the merchant site.
In this post, I try to analyze the various issues with the idea, and potential solutions.
The first problem is that the demo does not work with the Windows Cardspace. Even after importing the card, it does not show up in the Identity selecter at the merchant.
The reason it fails is that the required claims for the cardspace is something like
param id="requiredClaims" name="requiredClaims" value=" http://schemas.xmlsoap.org/PaymentCard/account http://schemas.xmlsoap.org/PaymentCard/VV http://schemas.xmlsoap.org/PaymentCard/expiry http://schemas.xmlsoap.org/PaymentCard/trandata?price=2700EUR
The card that is imported has all the claims except the last line. The URL parameter that follows the question mark (in red) is dynamic and hence is not a part of the claims in the card.
The best way to accomodate this is to enhance the cardspace standards to make it recognise the URL the parameter as separate entities.
A quick fix however is to include this as an optional parameter. In this case, the user will have to explicitly select that parameter when he submits the card. The STS can throw an errorr (new version supports custom error messages) is no value is submitted.
A couple of other enhancements could be to identify this uniquely as a payment card by having an attribute that indicates the type of the card. This could be an attribute that all the merchants and the banks will have to agree upon and would help merchants to show up only the cards that they accept. Additionally, the currency (viz. dollar, rupee or euro) could be a separate url parameter, something like price=2700¤cy=rupee.
The last glaring problem that I see here is the fact that getting the user consent on the money transfer is not simple. The consent is buried with other attributes, but I feel only the money part should be hilighted.
The cardspace standards sure are evolving, and I hope to see a simple single standard protocol for federation. On second thoughts, why should not people use OpenID (and YADIS for discovery) for online payments ?
Many people have been toying with the idea of using CardSpace as a vehicle for e-commerce payments. The main driver for this idea I believe is the fact that 3-D secure resembles the federation protocols like SAML or WS-FED. Ironically, 3-D secure and federation seem to have the same problems with user adoption. Thought the technology is simply remarkable, the engineers don't seemed to have covered the last mile of taking it to end users.
I first read about this idea in a blog by Sid Sidner. Many others including Ashish Jain (Ping Identity) and Kim Cameroon had linked to the post. I had also found XMLDAP having simple demos of the concept. The guys at xmldap have put up demo. The sample card issuer that corresponds to a bank, and a sample merchant site. The cards issued at the the bank can be used as currency at the merchant site.
In this post, I try to analyze the various issues with the idea, and potential solutions.
The first problem is that the demo does not work with the Windows Cardspace. Even after importing the card, it does not show up in the Identity selecter at the merchant.
The reason it fails is that the required claims for the cardspace is something like
param id="requiredClaims" name="requiredClaims" value=" http://schemas.xmlsoap.org/PaymentCard/account http://schemas.xmlsoap.org/PaymentCard/VV http://schemas.xmlsoap.org/PaymentCard/expiry http://schemas.xmlsoap.org/PaymentCard/trandata?price=2700EUR
The card that is imported has all the claims except the last line. The URL parameter that follows the question mark (in red) is dynamic and hence is not a part of the claims in the card.
The best way to accomodate this is to enhance the cardspace standards to make it recognise the URL the parameter as separate entities.
A quick fix however is to include this as an optional parameter. In this case, the user will have to explicitly select that parameter when he submits the card. The STS can throw an errorr (new version supports custom error messages) is no value is submitted.
A couple of other enhancements could be to identify this uniquely as a payment card by having an attribute that indicates the type of the card. This could be an attribute that all the merchants and the banks will have to agree upon and would help merchants to show up only the cards that they accept. Additionally, the currency (viz. dollar, rupee or euro) could be a separate url parameter, something like price=2700¤cy=rupee.
The last glaring problem that I see here is the fact that getting the user consent on the money transfer is not simple. The consent is buried with other attributes, but I feel only the money part should be hilighted.
The cardspace standards sure are evolving, and I hope to see a simple single standard protocol for federation. On second thoughts, why should not people use OpenID (and YADIS for discovery) for online payments ?
Hey,
Another crash and I lost my Firefox. I thought it was time to re-install and re-document the extensions that I have on Firefox. I did a lot of cleanup, and interestingly, I realized that I have only 77 frequently used extensions !!
I used ExtensionDump to generate this list. What extensions do you have ?? :)
Application: Firefox 2.0.0.11 (2007112718)
Operating System: WINNT (x86-msvc)
- Aardvark 1.1
http://karmatics.com/aardvark/
Quickly clean up a page prior to printing. Also web developer tools. - BugMeNot 1.3
http://roachfiend.com
Bypass compulsory web registration with the context menu via www.bugmenot.com. - Cache Status 0.7.2
https://addons.mozilla.org/firefox/addon/1881
Easy cache status & management from status - CacheViewer 0.4.4
http://tinybenki.sblo.jp/
Allows searching and sorting cache files - Chickenfoot 0.9.20070702
http://groups.csail.mit.edu/uid/chickenfoot/
End-user programming tool for Firefox. - ChromEdit Plus 2.6.4
http://webdesigns.ms11.net/chromeditp.html
A User Profile Editor Plus... Open The Chrome, Profile, & Install Folders. Open The File Manager. Restart Firefox. Includes The userChrome.js Extension. - Clean And Close 2.0
http://www.csb7.com/
Adds a Clean And Close button to your download manager. - ColorfulTabs 2.0.8
http://varun21.googlepages.com/
Colorful Tabs colors every tab in a different color and makes them easy to distinguish while beautifying the overall appeal of the interface. - CuteMenus - Crystal SVG 1.9.1
http://www.cutemenuproject.com/
Adds icons to all menus. - DigitalMe 0.3.846
http://digitalme.com
Enables browser support for websites that use information cards - Download Statusbar 0.9.5.2
http://downloadstatusbar.mozdev.org/
View and manage downloads from a tidy statusbar - dragdropupload 1.5.23
http://percro1.sssup.it/~pit/mozilla/dragdropupload/
This extension helps you to upload files - ErrorZilla Mod 0.2
http://www.jaybaldwin.com/News.aspx?id=51
Implements a useful error page when a website cannot be reached. - Extended Copy Menu 1.4
http://www.ryanscook.com
Provides the option to copy selection as plain text or html. - Extension Developer 0.3.0.20060726
http://ted.mielczarek.org/code/mozilla/extensiondev/
A suite of tools for extension developers - Extension List Dumper 1.9.0
http://sogame.awardspace.com/
Dumps a list of the installed extensions. - Extension Manager Extended 2.6.2
http://extended.spanglerco.com/
Use the extension manager to view the id and the folder of an extension. - Extension Tracker 3.0
http://devgoose.com
Tracks your extension stats on addons.mozilla.org - Fasterfox 2.0.0
http://fasterfox.mozdev.org/
Performance and network tweaks for Firefox. - FEBE 5.1.1
http://customsoftwareconsult.com/extensions
FEBE - Backup your Firefox data - Firebug 1.05
http://www.getfirebug.com/
Web Development Evolved - Firedoodle 0.6
http://firedoodle.com/
Turn the web into a whiteboard - FirefoxView 0.31.2
http://www.iosart.com/firefox/firefoxview/
View pages and links loaded into IE in Firefox - FireFTP 0.97.1
http://fireftp.mozdev.org
FTP Client for Mozilla Firefox. - FireShot 0.25
http://screenshot-program.com/fireshot/
Adds the ability to take a screenshot of the page, edit it and save, copy to clipboard, send to external editor or e-mail it. - Fission 0.9
http://mozilla.zeniko.ch/fission.html
Progress bar in the address bar (Safari style). - Flash Switcher (win) 0.2.1
http://www.sephiroth.it
Switch between various flash plugins or remove current plugin - FlashTracer 2.0.0
http://www.sephiroth.it
Display all the running .swf file trace output. You need to have flash player debug version installed to run this extension - FormFox 1.6
http://www.marblehead.com/schools/mhs/headlight/columns/dsteinbrook
Pops up form action when submit button is about to be clicked. - Foxmarks Bookmark Synchronizer 2.0.41
http://www.foxmarks.com/
Synchronizes your bookmarks across machines. - FoxyProxy 2.6.2
http://foxyproxy.mozdev.org
FoxyProxy - Premier proxy management for Firefox - Fullerscreen 2.3.1
http://disruptive-innovations.com/
Really full screen... - Get File 1.2.2
http://www.pastouchexp.info/firefox/
Get a file from an URL - Greasemonkey 0.7.20070607.0
http://greasemonkey.mozdev.org/
A User Script Manager for Firefox - HackBar 1.1.1
(Disabled)
http://www.izi-services.nl
A toolbar that helps you find and test SQL injections - HighlightAll 1.2
(Disabled)
http://goudey70.free.fr/highlightall/
Highlights all occurrences of the selected text - IE Tab 1.3.3.20070528
(Disabled)
http://ietab.mozdev.org/
Enables you to use the embedded IE engine within Mozilla/Firefox. - IE View Lite 1.3.1
(Disabled)
http://www.graysonmixon.com/extension/
Cut down version of IE View by Paul Roub. - Java Console 6.0.03
- Link Alert 0.7.2
(Disabled)
http://conlan89.googlepages.com/
Changes the cursor to indicate the target of a link. - Link Evaluator 0.9.9.5
(Disabled)
http://evaluator.oclc.org
Customizable pre-evaluation of web links and linked content - Long Titles 1.3
(Disabled)
http://home.etu.unige.ch/~robin0/LongTitles_en.html
Prevents tooltips from being cropped - MeasureIt 0.3.6
(Disabled)
http://www.kevinfreitas.net/pro/extensions/
Draw out a ruler to get the pixel width and height of any elements on a webpage. - meebo 1.0
http://www.meebo.com/
instant messaging everywhere - Menu Editor 1.2.3.3
http://menueditor.mozdev.org/
Customize application menus - MIME Edit 0.60
Mozilla Helper Application - More Tools Menu 1.0.8
http://trac.arantius.com/wiki/Extensions/MoreToolsMenu
Unclutter the "Tools" menu by moving new items to a "More Tools" menu. - MozLab 0.1.8.2007072315
http://dev.hyperstruct.net/mozlab
Collection of tools for Mozilla developers - MR Tech About:About 2.4
http://www.mrtech.com/extensions/
Adds about: options to Help Menu and Toolbar buttons. - MR Tech Link Wrapper Lite 2.1
http://www.mrtech.com/extensions/
Wraps long links to spare you from having to scroll left and right. - Organize Status Bar 0.5.2
http://yellow5.us/firefox/osb/
Organize your status bar icons. - Page Update Checker 0.3.1
http://pageupdatechecker.mozdev.org/
Automatically checks to see if a web page has changed. - PDF Download 0.9.3.2
http://www.pdfdownload.org
Allows to choose what you want to do with a PDF file: download it, view it with an external viewer or view it as HTML! - Personas for Firefox 0.9.1
http://people.mozilla.com/~cbeard/personas/
Themes, skins, fur coats and more. - Platypus 0.66
http://platypus.mozdev.org
Dynamically create GreaseMonkey scripts. - Poster 1.4.0
http://www.milowski.com/software/poster
A developer tool for interacting with URLs - Quick Preference Button 0.1.7.4
http://www.geocities.com/max1million/quickprefs.htm
Adds menu button for quickly accessing common preferences. - Save Session 1.3.1.2
http://diary.noasobi.net/
Save Session can save the session only once. - Server Spy 0.1.3
http://jacquetc.free.fr/mozilla/exts/ServerSpy/
Indicates what brand of HTTP server runs on the visited site. - ShowIP 0.8.05
http://l4x.org/showip
Show the IP address of the current page in the status bar. It also allows querying custom services by IP (right mouse button) and Hostname (left mouse button), like whois, netcraft. Additionally you can copy the IP address to the clipboard. This extension was formerly known as ipv6ident. - Snap Links 0.0.4
Opens multiple links contained in a selected area in new tabs - Source Viewer Tab 0.1.2007103001
http://piro.sakura.ne.jp/xul/viewsourceintab/
Shows web page sources in tab. - Speed Dial 0.5.0.2
http://speeddial.uworks.net/
Direct access to your most visited websites - Splash 2.0.0.1
http://www.mrtech.com/extensions/
Adds a splash screen. Supported in Firefox, Flock, Thunderbird, Sunbird, eMusic Remote, Songbird and Sunbird. (en-US) - Split Browser 0.4.2007120601
http://piro.sakura.ne.jp/xul/_splitbrowser.html.en
Splits browser window as you like. - StumbleUpon 3.16
http://www.stumbleupon.com/
StumbleUpon Toolbar - Tab Mix Plus 0.3.6
http://tmp.garyr.net
Tab browsing with an added boost. - Tamper Data 9.8.1
http://tamperdata.mozdev.org
View and modify HTTP/HTTPS headers etc. Track and time requests. - Temporary Inbox 2.1
http://www.temporaryinbox.com
Temporary Inbox - Twitterbar 0.0.8
http://spatialviews.com
Post to Twitter from your address bar - UnHide fields 0.2
http://www.wikistuce.info
View and Edit hidden Field - UrlParams 2.01.02
http://urlparams.blogwart.com/
Displays the websides get/post parameters in the sidebar. - User Agent Switcher 0.6.10
http://chrispederick.com/work/user-agent-switcher/
Adds a menu and a toolbar button to switch the user agent of the browser. - View Cookies 1.6
http://www.bitstorm.org/extensions/view-cookies/
View cookies of the current web page. - Web Developer 1.1.4
http://chrispederick.com/work/web-developer/
Adds a menu and a toolbar with various web developer tools. - XMLDAP Identity Selector 0.8.6
http://xmldap.org
adds selector support to firefox - YSlow 0.9.2
http://developer.yahoo.com/yslow
Make your pages faster with Yahoo!'s performance lint tool.
Scraps-Timeout v2.0 : Is it an idea badly executed
Hey,
I had earlier written about an application that I had been working on for Orkut. Too restless to wait for OpenSocial to make its grand appearance, we cooked up a flash application that could run as scraps.
We also did rigorous viral marketing to start with. Initially, the traffic was good, with around 40K hits in the first week. However, the traffic seems to have dipped. Apparently our first level folks in the viral marketing circle were not very impressed by the idea and did not pass it on to others. We have been trying to figure out reasons for this, asking many people, and doing unofficial surveys. I thought that it would be interesting to share our findings.
Many people I have seen on Orkut do not seem to be bothered about sending random scraps to all. There are these small Javascriptlets that people paste on the address bar to scrap to all the friends. These have been festival wishes, or plain stupid messages. Taking the cue from it, if people are interested in sending messages as pictures, why not use ScrapsTimeout ?
The initial hiccups (read bugs) that the site had could have detered people, but the meebo box that we put into the page seemed to help a lot. We worked extra hard to nail out the bugs, but I am sure that cost us some users. There were a few dedicated users who lend us their valuable time in patiently telling us about the bugs. Thanks to all of them.
The other barrier could have been the part of copy-pasting the code to Orkut, instead of automatically scrapping friends. I was a little averse to asking for username-passwords (as that is the only way to scrap friends, unless someone figures out a CSRF !! ). However, we decided to give it a try, and put on Gigya. The problem with gigya is that for orkut, they only allow scrapping self. So we decided to write something similar to Gigya to get this done.
I am also working on the page for the last one week, adding more gifts and preview feature for the themes, but the majority of the part was code restructure to clean out that one-night hackish development.
The code may not be the best I have written, but it sure is more maintainable and scalable. Adding themes and gifts is a lot more easier now. We are doing the final phase of testing and are planning to launch the new version very soon.
There is one bug that I am trying to nail down. On IE7, for a div with overflow:hidden, if the child has position:relative, the hidden property does not seem to work. Have to check it out.
We would also be forcing a little more marketing, our last attempt at this idea. I hope it works.
Please do let us your thoughts, if you liked this idea. I think that at this juncture, it is the users who would decide if we work on this, or move on.... :)
I had earlier written about an application that I had been working on for Orkut. Too restless to wait for OpenSocial to make its grand appearance, we cooked up a flash application that could run as scraps.
We also did rigorous viral marketing to start with. Initially, the traffic was good, with around 40K hits in the first week. However, the traffic seems to have dipped. Apparently our first level folks in the viral marketing circle were not very impressed by the idea and did not pass it on to others. We have been trying to figure out reasons for this, asking many people, and doing unofficial surveys. I thought that it would be interesting to share our findings.
Many people I have seen on Orkut do not seem to be bothered about sending random scraps to all. There are these small Javascriptlets that people paste on the address bar to scrap to all the friends. These have been festival wishes, or plain stupid messages. Taking the cue from it, if people are interested in sending messages as pictures, why not use ScrapsTimeout ?
The initial hiccups (read bugs) that the site had could have detered people, but the meebo box that we put into the page seemed to help a lot. We worked extra hard to nail out the bugs, but I am sure that cost us some users. There were a few dedicated users who lend us their valuable time in patiently telling us about the bugs. Thanks to all of them.
The other barrier could have been the part of copy-pasting the code to Orkut, instead of automatically scrapping friends. I was a little averse to asking for username-passwords (as that is the only way to scrap friends, unless someone figures out a CSRF !! ). However, we decided to give it a try, and put on Gigya. The problem with gigya is that for orkut, they only allow scrapping self. So we decided to write something similar to Gigya to get this done.
I am also working on the page for the last one week, adding more gifts and preview feature for the themes, but the majority of the part was code restructure to clean out that one-night hackish development.
The code may not be the best I have written, but it sure is more maintainable and scalable. Adding themes and gifts is a lot more easier now. We are doing the final phase of testing and are planning to launch the new version very soon.
There is one bug that I am trying to nail down. On IE7, for a div with overflow:hidden, if the child has position:relative, the hidden property does not seem to work. Have to check it out.
We would also be forcing a little more marketing, our last attempt at this idea. I hope it works.
Please do let us your thoughts, if you liked this idea. I think that at this juncture, it is the users who would decide if we work on this, or move on.... :)
Cross Domain Server Requests / AJAX
Hi,
With the enforcement of domain of origin security model for browsers, many innovative mash-ups are virtually impossible. There have been hackish ways of achieving this, but quelling cross-browser anomalies warrants for a library that could do this. While writing a bookmarklet, this is a normal situation as you are almost never on the page that fetches more data for the user.
This is where the YUI implementation of YAHOO.util.GET comes in very handy. Though the YUI GET is well documented, I dug into the source code and wanted to write about the internal workings of the file.
To start with, the GET library adds the external file as a script in the HTML document. As the GET request for the scripts always carry the cookies or authentication information of the domain where the script source reside, stateful sessions can be handled without any problems.
The tricky part comes in when the script tag's "onLoad" event is to be detected. For Firefox, the onload works just fine. In case of IE, the onreadystate event is used. Based on the state, the onSuccess handler is fired. In case of safari version < 3.0, there is no way to detect this, and a very interesting implementation is in place. Quoting the comments in the GET file,
One feature or service that I would like to see is a YAHOO proxy that fetches data from any URL, and sends it to the client using the GET utility as var extVariable = []. The extVariable should be configurable. At
the first inspection, this looks pretty safe to get all the data as escaped strings inside the page. The script inside the page could do the harder job of making sense of the data that is fetched, typically using something similar to the paraseJSON method.
Another enhancement could be a possibility to POST forms to the URL. Though it may be difficult to understand the response, an abstraction sure could help passing huge information to servers of different domains.
To summarize, the GET utility is a great step ahead for mash-ups and bookmarklets, and I hope it comes out of beta soon.
With the enforcement of domain of origin security model for browsers, many innovative mash-ups are virtually impossible. There have been hackish ways of achieving this, but quelling cross-browser anomalies warrants for a library that could do this. While writing a bookmarklet, this is a normal situation as you are almost never on the page that fetches more data for the user.
This is where the YUI implementation of YAHOO.util.GET comes in very handy. Though the YUI GET is well documented, I dug into the source code and wanted to write about the internal workings of the file.
To start with, the GET library adds the external file as a script in the HTML document. As the GET request for the scripts always carry the cookies or authentication information of the domain where the script source reside, stateful sessions can be handled without any problems.
The tricky part comes in when the script tag's "onLoad" event is to be detected. For Firefox, the onload works just fine. In case of IE, the onreadystate event is used. Based on the state, the onSuccess handler is fired. In case of safari version < 3.0, there is no way to detect this, and a very interesting implementation is in place. Quoting the comments in the GET file,
script nodes with complete reliability in these browsers, script nodes either need to invoke a function in the window once they are loaded or the implementer needs to provide a well-known property that the utility can poll for.For the CSS style sheets, Firefox does not throw for onload, and hence, the styles are applied as fetched from the server. There are a lot of quirks and hence, the utility is still in beta. There is also a provision to delete the script node to keep the size of the DOM in control.
One feature or service that I would like to see is a YAHOO proxy that fetches data from any URL, and sends it to the client using the GET utility as var extVariable = []. The extVariable should be configurable. At
the first inspection, this looks pretty safe to get all the data as escaped strings inside the page. The script inside the page could do the harder job of making sense of the data that is fetched, typically using something similar to the paraseJSON method.
Another enhancement could be a possibility to POST forms to the URL. Though it may be difficult to understand the response, an abstraction sure could help passing huge information to servers of different domains.
To summarize, the GET utility is a great step ahead for mash-ups and bookmarklets, and I hope it comes out of beta soon.
Writing effective bookmarklets easily
Hey,
Though Browser extensions and Greasemonkey scripts are the obvious choices for extending web pages, bookmarklets still continue to be the only reliable, cross browser choice to easily add custom functionality to sites.
As bookmarklets can simply be scriptlets extracted from a page, and can be later transformed into extensions or greasemonkey scripts, they seem to be obvious choices to prototype extensions for web pages. Most bookmarklets are just about including a remote script file into the current DOM structure. However, a bookmarklet can become even more elegant if it could use libraries and external CSS. Also, it would be a great if the entire bookamarklet functionality could be broken into files for manageability. I was working on a bookmarklet project when I wrote a generic bookmarklet that could be used as a starting point to write new bookmarklets. You can find the source here.
A little explanation of the bookmarklet framework that you could extend it to do your functionality. The 'init' function loads all the scripts and style sheets that you specify. Alternatively, the list of files could be written into this file at the build time. Line 16 checks if the script is already included, and if it is, you should not try including all the files again. A note on trying to fetch data from a site x.com, when you are on a web page from y.com. Due to the same domain restriction policy, AJAX requests cannot be made.
Though I started writing a Cross Site XHR-JSON support, I found that YUI just got it out in its beta. The YUI Get utility is something you may want to take a look at. All that the utility does is add a "script" tag to the DOM, thus including the JS file that is fetched from x.com into the page at y.com. Additional features including cleaning the DOM of such script tags so as not to bloat the source, onload handlers, and attaching the script tag to required DOM elements. This is a particularly useful utility to fetch data from different domains, and even to include style sheets.
A couple of enhancements that I am working on are
1. Check if the included scripts already exist in the page, and if they do, don't load them.
2. Currently, all the scripts have new functions attached to them. That is bad on memory, and I am writing a common singular function that would listen to all the loads.
Please do let me know of any other features that you would want it this generic bookmarklet.
If you are looking at converting your bookmarklet to a greasemonkey script and are having trouble testing it, you could give a shot at a greasemonkey testing framework that I am working on.
Though Browser extensions and Greasemonkey scripts are the obvious choices for extending web pages, bookmarklets still continue to be the only reliable, cross browser choice to easily add custom functionality to sites.
As bookmarklets can simply be scriptlets extracted from a page, and can be later transformed into extensions or greasemonkey scripts, they seem to be obvious choices to prototype extensions for web pages. Most bookmarklets are just about including a remote script file into the current DOM structure. However, a bookmarklet can become even more elegant if it could use libraries and external CSS. Also, it would be a great if the entire bookamarklet functionality could be broken into files for manageability. I was working on a bookmarklet project when I wrote a generic bookmarklet that could be used as a starting point to write new bookmarklets. You can find the source here.
A little explanation of the bookmarklet framework that you could extend it to do your functionality. The 'init' function loads all the scripts and style sheets that you specify. Alternatively, the list of files could be written into this file at the build time. Line 16 checks if the script is already included, and if it is, you should not try including all the files again. A note on trying to fetch data from a site x.com, when you are on a web page from y.com. Due to the same domain restriction policy, AJAX requests cannot be made.
Though I started writing a Cross Site XHR-JSON support, I found that YUI just got it out in its beta. The YUI Get utility is something you may want to take a look at. All that the utility does is add a "script" tag to the DOM, thus including the JS file that is fetched from x.com into the page at y.com. Additional features including cleaning the DOM of such script tags so as not to bloat the source, onload handlers, and attaching the script tag to required DOM elements. This is a particularly useful utility to fetch data from different domains, and even to include style sheets.
A couple of enhancements that I am working on are
1. Check if the included scripts already exist in the page, and if they do, don't load them.
2. Currently, all the scripts have new functions attached to them. That is bad on memory, and I am writing a common singular function that would listen to all the loads.
Please do let me know of any other features that you would want it this generic bookmarklet.
If you are looking at converting your bookmarklet to a greasemonkey script and are having trouble testing it, you could give a shot at a greasemonkey testing framework that I am working on.