The My Opera forums have been replaced with forums.opera.com. Please head over there to discuss Opera's products and features
See the new ForumsYou need to be logged in to post in the forums. If you do not have an account, please sign up first.
Typically, you would use DOM manipulation directly, as jQuery is pretty heavyweight and you can't safely embed it in any page (especially if the page extends Object.prototype which breaks jQuery).
Since you don't have to worry about IE compatibility you can use methods like addEventListener and querySelectorAll.
As for your specific problem, you would have to tell us more about what you are trying to do. Show an icon when you select some text?
You could have a look in the sources of the In-place translator extension to see how they did it and then adapt that. (you can download the oex and just unzip it). Most of the extension have an open source license, so that shouldn't be a problem.
Since you don't have to worry about IE compatibility you can use methods like addEventListener and querySelectorAll.
As for your specific problem, you would have to tell us more about what you are trying to do. Show an icon when you select some text?
You could have a look in the sources of the In-place translator extension to see how they did it and then adapt that. (you can download the oex and just unzip it). Most of the extension have an open source license, so that shouldn't be a problem.
I appreciate Your help.
I have just cracked inside In-Place translator and it appears all magic is done by using DOM manipulation as you, d4n3, suggested. I think I'll use this approach too. My injected script will monitor mouseup event and if user will select text it will display a window with translation results. Results will be more detail. Well, it will take for me a little time to find good API documentation and study it.
Next objective is to fetch only useful part of translation site result page (I want to use lingvo.abbyyonline.com)
I have just cracked inside In-Place translator and it appears all magic is done by using DOM manipulation as you, d4n3, suggested. I think I'll use this approach too. My injected script will monitor mouseup event and if user will select text it will display a window with translation results. Results will be more detail. Well, it will take for me a little time to find good API documentation and study it.
Next objective is to fetch only useful part of translation site result page (I want to use lingvo.abbyyonline.com)
Forums » Dev.Opera » Opera Extensions Development Discussions