Reputation: 4161
After reverse engineering the bit.ly and delicious bookmarks I notice they both create iframes.
Is this so that the bookmarklet will have access to the user's information. I don't see any other way that the bookmarklet would know who is creating the bookmarklet.
But there is a pattern in both. The Bookmarklet is just a dumb place holder that calls the actual script. This is so that the bookmarklet can be updated as the code dragged into the bookmark bar is somewhat permanent.
The code that is called then creates and iframe by specifying a url to either bitty or delicious which also contains GET parameters of the information to be saved.
Upvotes: 1
Views: 87
Reputation: 4003
The mentioned bookmarklets might be using iframes, because then they could be styled specifically and include JavaScript which doesn't conflict with the JavaScript of the website.
The GET parameters are being used to transfer the required data from parent to child window without cross-frame scripting protection.
Upvotes: 1