[PATCH] Support for bookmarklets

Aurélien Gâteau aurelien.gateau at free.fr
Wed Feb 4 09:07:08 GMT 2009


David Faure wrote:
> On Thursday 29 January 2009, Aurélien Gâteau wrote:
>> Attached is a patch which adds support for bookmarklets to Konqueror.
>>
>> In case you don't know about them, bookmarklets are one-line javascript 
>> bookmarks which can be triggered by the user to do nifty things with the 
>> current web page, for example enforcing a sane combination of background 
>> and foreground colors. One of the most common bookmarklets is the one 
>> provided by Del.icio.us to bookmark pages to their service. You can find 
>> it here:
>>
>> http://delicious.com/help/bookmarklets
>>
>> The patch is quite simple, but requires linking libkdeinit_konqueror 
>> with khtml.
> 
> Maybe the additional linking isn't needed if you just let konqueror ask
> khtml to open the javascript url (using KParts::ReadOnlyPart::openUrl)?
> Just wondering; otherwise no strong objection against linking khtml.

Good idea! I gave it a try this morning and came up with a much simpler 
patch. This approach has the additional benefits of obeying javascript 
enabled/disabled state and making it possible for another html part 
(*cough* webkit *cough*) to implement bookmarklet support as well.

Aurélien

-------------- next part --------------
A non-text attachment was scrubbed...
Name: konqueror-bookmarklet-2-khtml.diff
Type: text/x-diff
Size: 651 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20090204/bb9b2ac4/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: konqueror-bookmarklet-2-konqueror.diff
Type: text/x-diff
Size: 578 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20090204/bb9b2ac4/attachment-0001.diff>


More information about the kde-core-devel mailing list