[prev in list] [next in list] [prev in thread] [next in thread]
List: kfm-devel
Subject: Need help for a konqueror plugin - Refresh content & javascript
From: "Mathieu Ducharme" <ducharme.mathieu () gmail ! com>
Date: 2007-05-05 5:06:24
Message-ID: 53879e930705042206l46dcb409od8e58403c4217356 () mail ! gmail ! com
[Download RAW message or body]
Hi.
I am currently working on a khtml plugin called "Konqueror Userscript[1]",
which aims to provide GreaseMonkey / Userscripts compatibility to Konqueror
in KDE4.
I uploaded a proof-of-concept version today in svn so you can try by
checking out playground/utils/khtml_userscript (You will need to manually
add user.js files in your .kde(4)/share/apps/konqueror/userscripts
folder...)
I ran into a brickwall with two issues, however, so I hope someone on this
list can help me. Just a pointer to the proper documentation would be a
(very welcome) start.
1. I don't know if this is a kde4 issue or something with my code but after
inserting the new javascript code in the page, the content does not get
updated automatically.
I have a simple test scripts which change all links in red. If I click on
the "enter" key in konq, the script will be successfully injected to the
page but the links won't appear in red until I hit a key or move the mouse
inside the view.
I tried calling m_part->view()->repaint() and m_part->view()->update() but
it doesn't do anything. Am I missing something?
2. Is it possible to "intercept" javascript functions inside my plugins. For
example, GreaseMonkey provides a GM_registerMenuCommand() function that
allows userscripts (javascript) to add items to the menu. Basically I would
like to call C++ code (from the plugin) from javascript. This might be
impossible, this might be trivial, I would just like some pointer to know
where to start.
I tried looking at the existing plugins but I couldn't find any that
implements this kind of feature... This would also be needed I guess if
someone would ever want to implement a firebug debugging console for konq...
[1] More information: http://namshub-kde.blogspot.com
[Attachment #3 (text/html)]
Hi.<br><br>I am currently working on a khtml plugin called "Konqueror \
Userscript[1]", which aims to provide GreaseMonkey / Userscripts compatibility \
to Konqueror in KDE4.<br>I uploaded a proof-of-concept version today in svn so you \
can try by checking out playground/utils/khtml_userscript (You will need to manually \
add user.js files in your .kde(4)/share/apps/konqueror/userscripts \
folder...)<br><br>I ran into a brickwall with two issues, however, so I hope someone \
on this list can help me. Just a pointer to the proper documentation would be a (very \
welcome) start. <br><br>1. I don't know if this is a kde4 issue or something with \
my code but after inserting the new javascript code in the page, the content does not \
get updated automatically.<br>I have a simple test scripts which change all links in \
red. If I click on the "enter" key in konq, the script will be successfully \
injected to the page but the links won't appear in red until I hit a key or move \
the mouse inside the view. <br><br>I tried calling m_part->view()->repaint() \
and m_part->view()->update() but it doesn't do anything. Am I missing \
something?<br><br><br>2. Is it possible to "intercept" javascript functions \
inside my plugins. For example, GreaseMonkey provides a GM_registerMenuCommand() \
function that allows userscripts (javascript) to add items to the menu. Basically I \
would like to call C++ code (from the plugin) from javascript. This might be \
impossible, this might be trivial, I would just like some pointer to know where to \
start. <br><br>I tried looking at the existing plugins but I couldn't find any \
that implements this kind of feature... This would also be needed I guess if someone \
would ever want to implement a firebug debugging console for konq... <br><br><br>[1] \
More information: <a \
href="http://namshub-kde.blogspot.com">http://namshub-kde.blogspot.com</a><br><br>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic