open source stuff

Posts Tagged ‘plasmaplugin’

Return of the Plasma Browser Plugin

Posted by grundleborg on September 5, 2008

You might remember some months ago that I posted a proof-of-concept plasma plugin for Mozilla Firefox on Linux. Well, a lot of tweaking later, we can now see a wide assortment of clocks in Mozilla Firefox on another platform (no prizes for guessing which one).

The most time consuming part of getting this up and running on Windows was actually just getting KDE compiled in the first place (emerge hates me). After that, it took about 10 lines of code and a few tweaks to CMakeLists.txt and it works.

Well, I say it works, but if I were more honest I’d say I managed to get the clocks to appear once out of many attempts in Firefox, and to grab a quick screenshot before I started trying to interact with them and brought everything crashing down. So, if you want to try this out yourself, be warned: you’ll need a lot of patience to do all the tweaking needed to get it working, and then it’ll still eat your babies.

Source code is in the same git repository as last time. See the README file included for barely-comprehensible instructions on how to destroy your soul.

When I blogged about this originally, there were lots of comments from people worrying about the security implications. I’d like to write about that in more detail, but I don’t have enough time, so it will have to wait for another day. For now I’ll just point out one thing: it is only a proof-of-concept at this stage. Obviously if this ever becomes a finished product, there will be security in place to stop plasmoids from the web interacting with your local computer in inappropriate ways – it will not work like Microsoft’s ActiveX, but much more like Adobe Flash.

Posted in KDE, Plasma | Tagged: , , , , | 7 Comments »

Plasmoids in a web page

Posted by grundleborg on May 30, 2008

After refactoring the core of decibel to be independent of KDE, I’ve decided to take a little break from my summer of code project while my mentor reviews all the changes I’ve made so far. So, instead of taking a holiday from KDE and computers for the last two days I’ve been working on a little project that I’ve wanted to do since I saw the idea mentioned by Aaron in an interview some time ago (when I googled for it this evening, I couldn’t find it again, so forgive me for not linking). I interpreted what he said as meaning “plasma doesn’t just need to revolutionise the desktop but could even spread into the internet space by having plasmoids on web pages”.

So, I set about making this possible. It was easier than I thought thanks to the wonderful trolls who recently released an Open Source QT addon that wraps the Netscape Plugin API. In fact, most of the two days I’ve spent getting this basic browser plugin made were spent tracking down the reason why adding a dependency on KDE stopped mozilla loading it – it turned out to be “-fvisibility=hidden” that is added to the CXX_COMPILER_FLAGS by FindKDE4.cmake.

Now, don’t get excited yet – this really is rudimentary, but there is now a plugin that works with firefox (not tested with anything else yet) and allows web pages to contain plasmoids. It uses the plasmoids already installed on your computer, but in the future I can envision it allowing scripted plasmoids provided by the web site you are visiting. Also, at the moment it only allows embedding of individual plasmoids, but again in future it could allow embedding of containments – you could even have a page that allows rearranging of plasmoids much like how you can rearrange the boxes on your Facebook profile. You could even perhaps drag plasmoids from a web page to your desktop! The posibilites seem endless… (Apologies to Aaron and other plasma devs for any ideas here that are not original and that I poached from them and then forgot about!)

Anyway, bringing my imagination back down to earth, here’s a screenshot of what’s already possible.

Large version

The clocks all work, honest 🙂 (The only major known bug is that the right click menu text doesn’t show up, but I have a feeling that someone with more KDE-fu than me will fix that in a heartbeat).

If you want to have a look for yourself, the code is currently in available here in a git repo. Check out the master branch, then compile it in you KDE4 build environment (you will need very recent trunk), and it should Just Work (TM). See the README file for random ramblings about how to debug when it doesn’t :).

Enough of that sidetrack! Tomorrow I return to Decibel (which I will blog about again shortly as a huge amount has and is happening on that front). Also, there’s a bug day this Sunday… you know the drill by now, and if you don’t, watch the planet for a dedicated blog about that soon.

UPDATE: This approach currently does not work for Konqueror, but it has been pointed out to me that it is already possible to embed local plasmoids in Konqueror via a kpart. Details on Harri Porten’s blog.

Posted in KDE, Plasma | Tagged: , , , , | 26 Comments »