The key to converting it to a bookmarklet was to move all the chrome extensions specific functions to a separate file. In this case, the chrome.* API calls were moved to PageActions.js. The real logic lies in FlashPlus and Commands. FlashPlus enumerates all the flash content on the page while Commands is responsible for defining actions that can be taken over individual flash elements.
Hence, the difference between the bookmarklet and the extension is the entry point. The Chrome extension uses PageActions.js to insert the script within the page. This is supported by the background page and the popup icon in the URL bar. On the other hand, Bookmarklet.js is a simpler entry point that simply enables the functionality for all available media content.
This leads to slightly different capabilities between the two.
- The bookmarklet cannot work on Media content inside iFrames as the script is inserted only for the current frame.
- Pop out functionality does not currently work as it requires additional javascript to be executed once the new window is created.
- Media content may restart after starting the bookmarklet as the wmode parameters have to be re-written.
The bookmarklet now lives in a different branch and the releases are tagged as bookmarklet. Regular development would continue on the extension and changes to FlashPlus and Commands would be merged back to the bookmarklet branch.
You can watch out this and this space for updates on the bookmarklet and the extension respectively.