homepage Welcome to WebmasterWorld Guest from 54.161.175.231
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Browsers / Opera Browser Usage and Support
Forum Library, Charter, Moderator: open

Opera Browser Usage and Support Forum

    
Event capture in Opera
Is it actually possible?
Stue




msg:1586242
 9:45 am on May 29, 2002 (gmt 0)

Ok i have found many sources saying it wont work with opera (speaking of right-click-protection and stuff). Is this true? Isnt there ANY way around?

 

tedster




msg:1586243
 12:06 pm on May 29, 2002 (gmt 0)

As far as I know there is no way - and that's by design. Opera is the "friendly to the user browser" and it doesn't allow many kinds of manipulation by the website that the others do.

Stue




msg:1586244
 3:11 pm on May 29, 2002 (gmt 0)

Well, capturing events doesnt always mean manipulation. In my case im about to cap the right key and instead of popping up the context menu there will be a custom menu (of course "view source" isnt in it).

Actually tho, i have found to workaround by assigning the <BODY> tag the "onclick" handler, this way opera gets it. But when youre talking about remodding one js-file in 100 projects you dont want to edit each and every HTML site to make it work with the new right-click-script. You would rather just exchange the js files. Thus, the mentioned workaround isnt an option.

Im wondering why it eats
<BODY onclick="function();">

but not
document.body.onclick = function();

or
document.onclick = function();

As you see, im not about to abuse or manipulate anything, im just replacing (except that i substract the "view source" and other unimitatable functions). Opera being the "user friendliest" is the "developer meanest" at the same time...well besides NS4 of course.

MikeFoster




msg:1586245
 11:53 pm on May 29, 2002 (gmt 0)

try

document.body.onclick = function;

leave off the parens, you don't want to assign the return value of the function, but rather a reference to the function itself.

Opera doesn't support right click events at all. Or has someone discovered differently with the newer Opera versions?

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Browsers / Opera Browser Usage and Support
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved